#microcontrollers

1 messages · Page 28 of 1

soft marten
#

Hi can some tell me way so i can wait with for output that comes out in after couples of lines

#

Basically after i write my certificate to the board i want to wait to wait for 'OK' to show up which sometimes comes after couples of lines and has passed and sometime come in the next line

#

And it always comes at the starting of the string

rocky canopy
#

Hi, is there any way to run micropython on windows? or mock a device? I'm looking to create a micropython project that uses a screen and some buttons, but wish to share that code with a windows application also (data synced across cloud).

Basically is there a way I can do micropython development on a windows device for testing before I actually hook up the hardware?

soft marten
#

python printed: AT+CGREG=?

python printed: +CGREG: (0,1,2)

python printed:

python printed: OK```
#

how can i chk if ok comes in first five lines of the output @opal lodge

#
if 'OK' in response:
    value = response.split(':")[1]
    print response```
cant i do this
opal lodge
soft marten
#

okk

#

i just need to chk frist five if there is ok in it

#

thanks

opal lodge
#

do you know if "OK" will be on it's own line without any other characters other then the newline character(s) after it?

soft marten
#

it will basically be in terminal

#

as output

#

i am wanna chk the resposne of command

#

which show show OK as output in like first 5-7 lines or show error

#

than process was failed

soft marten
#

but i need to chk first five lines if it contains ok or what if give error

opal lodge
soft marten
#

@opal lodge

#

how can i resolve thiis

#

mkdir shows error if folder already exist

#

i want to hide or you can say supress it

opal lodge
# soft marten how can i resolve thiis

i think this is quite off-topic for this channel and i'm really not the right person as i've been a full time linux user for many years
i also don't like microsoft and their products very much (vs code might be an exception) and really loafhe powershell
but if it's anything like unix/linux i would say add a -f on the command line to "force" it

soft marten
#

i actually soved it using -p

opal lodge
soft marten
#

so i am making changes to the script for now

#

is there a way to get user variables

#

????

opal lodge
soft marten
#

lol

#

someelse took it

opal lodge
soft marten
#

command line

#

i want to get user python

opal lodge
#

like parameters?

soft marten
#

i want to get user python envirmennt variable

#

this ones

#

@opal lodge

opal lodge
soft marten
#

i am trying to pass dynamic address to my script

#

string output is same

#

but still it shows in no such file exist

#

@opal lodge

soft marten
#
        lines = []
        response = ""
        while True:
            response += self._serial.readline().decode("utf-8")
            if response.endswith(("\r", "\n", "\r\n")):
                response = response.strip()
                lines.append(response)
                if response == "OK":
                    return lines
                if self.error_response.match(response):
                    raise AtCommandError(lines)
                response = ""
            time.sleep(0.1)
#

dude in your code how mnay lines are you reading

#

if you dont get ok what will you do

#

@opal lodge

opal lodge
#

according to their documentation it seems like one can count on always getting one of those four responses eventually

#

i noticed it was necessary to implement a buffer in the software because of the timeout set to the serial library or else a line could be cut somewhere in between and it wouldn't match anything, hence how some of it is implemented

#

i also built you two functions to read a file from disk in a slightly better way as well as being able to remove crap before and after in the file and only extract the certificate, private key or whatever else that is pem encoded, it should follow all the rules of the pem specification to be versatile

#

i also built a little example for how you could get the imei number from the device if you're want to read it from the device, just need to process the output a bit

soft marten
#

i am on the end part of it

#

i love your read device script

opal lodge
#

otherwise the class and the two functions should be ready to use as they are and you can build upon it

soft marten
#

how can i implement a function getresponse()

#

to chk first reponse for first 5 times

#

i was actually tthinking to implement while loop

#

for 5 times

thin wyvern
#

Hello, i currently have a raspberry pi pico witha laser wired in to the uart pins and i need to write a byte array to the laser to tell it to turn on anyone have an idea on how i would do this?

opal lodge
# soft marten for 5 times

we can surely modify the code a bit to do that as well as an option
maybe even take the time to add proper timeouts to it as well as another option

soft marten
#

I did some changes

#

But for the exact code i need some more refrence

#

😅😅

opal lodge
#

ah, i think we could just patch it in so that it's an option to just add functionality to it

soft marten
#

The problem is when the code will not run

#

Due to errors

#

Or gives ouput with delay

#

Lets say it gives output after 4 sec

#

Than there could issue of buffer

opal lodge
#

not with the code that was there originally, that would only get problems if they didn't follow their own specifications or something really bad happens like if it dies or gets disconnected

hallow igloo
#

guys is microsd card required for raspberry pi?

#

or can i just boot it using a pendrive?

#

?

somber plaza
#

is there a way to pass info from python script directly to ardunio

#

arduino program*

#

so like select options in python gui and pass that to the C program

#

and when arduino ide compiles it it has access to the stuff from the python script

wary musk
opal lodge
# hallow igloo or can i just boot it using a pendrive?

with a raspberry pi 4 (and 400) with modern firmware you can boot from either usb or network (pxe) without a microsd card
this is possible now because the raspberry pi 4 (and 400) has a larger onboard firmware that you can even update

opal lodge
errant wigeon
hallow igloo
#

Thank you @opal lodge

reef onyx
#

yo im trying to get into raspberry pi, and i was wondering if u guys know how i can use my laptop display to control the raspberry pi. my goal is to make a simple program with the gpio turning an led on and off

keen cairn
# reef onyx yo im trying to get into raspberry pi, and i was wondering if u guys know how i ...

You can try follow this instruction https://www.youtube.com/watch?v=NWBmYnNvN3A

VNC Viewer is a way for you to access and control your Raspberry Pi desktop from another computer such as a Mac or Windows machine. And the best part is that VNC Viewer is free.

Pre-Requisite for Raspberry Pi users: Install Raspberry Pi OS
If you're not familiar with Raspberry Pi OS, please see my video here: https://youtu.be/2Jfv9NO6J2Q

Ra...

▶ Play video
opal lodge
# reef onyx yo im trying to get into raspberry pi, and i was wondering if u guys know how i ...

you could setup your raspberry pi in headless mode and just ssh and vnc into it
you might also need an extra monitor or tv with hdmi input and a keyboard that you can connect to the raspberry if you need to troubleshoot bootup issues
if that isn't available to you, a ttl-to-usb cable can be used if the needed GPIO pins aren't occupied by a hat or something else
if you only need to use the laptop screen as a monitor for the raspberry pi you could get a hdmi-to-usb capture card (not to be confused with a usb-to-htmi display adapter) but this only gets you half way as in itself it don't give you a keyboard for the raspberry pi

fluid gull
#

Anyone here using a Raspberry Pi Pico? What's your use-case for it?

analog locust
#

hello every i am a student in 10th grade and i have a competition in which i am making an AI that moves. so here is my problem i have done lots of researches but i didn't find anything to help me, i am trying to control my Arduino code with python so i can make it a fully independent but i have very little experience with Arduino and i see it hard i don't really know but please if anyone can help me just text me thanks (i know i might be asking this question in the wrong place but please just help me).

#

ping me please

silk smelt
#

anyone know a dead simple way to push code on RPI 2020

#

without ide

silk smelt
#

pico people in the house?

tired schooner
#

Where you use a githook whenever something is committed, it updates

#

I’m looking for a wireless button on batteries to toggle my lights. I’ve used a bluetooth remote button before, but this sucks since: to save energy, it disconnects regularly. So I’m looking for a cheap alternative which has the same functionality as you would with a garage door… ( this wouldn’t have to connect / pair anymore like it previously would with the Bluetooth shutter) I have a RPI Zero W. Any recommendations on what CHEAP receiver / transmitter to get?

hallow igloo
#

Would someone kindly be able to help me with micropython?

errant wigeon
hallow igloo
# errant wigeon what do you need help with?

So I installed Micropython on my esp8266 and it seems to work fine. I can see the Micropython wifi running well, and I was able to connect with the default password, but I can't connect to serial at all. I erased data, and the serial gets detected. However, when I flash the.bin file, Micropython seems to be running fine because the wifi there is Micropython, and I can't get serial connection until I get the esp on boot mode.

#

The serial doesn't get detected at all

#

Let me show you my screen

hallow igloo
#

Hey do not be concerned I see I need to connnect usb through the gpio pins

tribal latch
#

Hey, does a time.sleep() really help avoid hogging cpu load? I have an RX loop on an RPi that needs to read messages as fast as possible during some stages, and was wondering if adding in a variable sleep factor would be worth considering instead of just removing the sleep completely

#

I think the rx reads using pyserial in some manner

hallow igloo
#

How do you transfer files to ESP32 devices when the micropython functions deepsleep/lightsleep block any connection?

humble kraken
#

it has to be woken up first

agile shard
#

Hello my amigos, i have an arduino uno and a DHT11 module, im trying to use pyfirmata with it but im not sure how since i know with arduinos ide, you have to use a library for it to work, anyone know how to do it?

fleet pivot
#

yo, lol i wanna buy a raspberry pi Zero..... Where do i buy it? Its out of stock everywhere.

#

even the official sellers of raspberry bi don't have it.

past fossil
#

Is this an appropriate channel to discuss the M5Stack and coding with Python on UIFlow?

hallow igloo
#

Is it perhaps possible to to reprogram this microprocessor of this broken china cell phone though this pins.

#

This is a china fitness watch

hallow igloo
#

I it possible to proggram this with another microprocessor like esp32

#

or arduino r3

steep dune
#

BORGize it!!!!

humble kraken
humble kraken
hallow igloo
#

How can one board a preproggramed baord

hallow igloo
#

PHY6202

analog locust
#

hello dose anyone know a microcontroller that can run python with a microphone and speaker and wifi

spiral sandal
analog locust
#

@spiral sandal okay which one do you recommend me to buy

spiral sandal
#

if you look for cheap soc wih no special gpu caps then look for lichee-pi or raspi zero

analog locust
#

can i connect wifi module to it

#

and a speaker

#

and a micrphone

spiral sandal
#

there are models with amps and microphone and wifi just search with caution

analog locust
#

ok

spiral sandal
#

don't go for lowest prices they could be amputated ( at least for lichee pi D1 they have audio/wifi caps on docks )

spiral sandal
analog locust
#

i already finished the code

#

it is working

#

can you help me

#

i will explain everything

spiral sandal
#

i'm biased toward allwinner soc so i try not to impose my views

analog locust
#

ok

analog locust
spiral sandal
#

you don't have aliexpress or a broker ? maybe make a collective with other people and get a qty

analog locust
#

ok

#

i will see

#

thanks

gentle vapor
#

I wish I could point to an Adafruit board for the example but the boards they put mics on don't have wifi it seems, it's not hard to add an external mic though (well harder than you would on a PC)

flat latch
#

If I want a Python script that controls LEDs to run forever on a pi, what’s the best way of running the file?

analog locust
#

i think i will buy it

elder knot
#

Might not be the right place to ask, but does anyone know of a place where I can find a dockerfile which replicates the jetpack 4.6.1 release? ie, has OpenCV 4.1.1, python 3.6.9, etc.

#

Specifically looking to make a docker container on an nvidia Jetson Nano with GPU accelerated stuff. I've looked around for a very long time now but I'm starting to think I'll need to make some sort of amalgam dockerfile for what we need and I'm not sure what the steps I need to take in a dockerfile are to install opencv with gpu acceleration and gstreamer support (Please @elder knot if you respond btw :))

karmic depot
#

@elder knot I can help u with making the dockerfile and making the container image

karmic depot
flat latch
#

Will that still work if it takes input from a text file that changes every few minutes?

karmic depot
#

Can u explain a bit more

flat latch
#

Basically Im gonna have a text file that represents the total server load that updates ever 5ish minutes and the Python program is gonna do some things with leds based on that number

#

Wasn’t sure if I needed to turn the Python program into a background process or something similar to let the text file update

#

And also I don’t know the method of how the text file gets changed, my sys admin said he would take care of that as long as I write the program

karmic depot
#

ok so means your program will read some numeric value from that text file and update the LEDs. right??

flat latch
#

Correct

karmic depot
#

have you made the program?

#

how are u reading the value?

flat latch
#

Have not made the program yet, was gonna use the built-in file reading functions, open() and read()

karmic depot
#

Ok

flat latch
#

Some reason it was taking a long time to install libraries yesterday and my workday ended before it was done installing

#

The actual program should be pretty simple, my sys admin asked me to control an led strip which is kinda of like a “progress bar” style thing which represents the total server load to be able to get a quick visual of the load without having to view anything

karmic depot
#

if u can give me sample of how the text file looks

#

i can help

flat latch
#

It’s just a single number

#

In a scale of 0-100

karmic depot
#

ok

#

then its pretty easy to do

flat latch
#

Yeah I was just wondering the logistics of actually “deploying” the program

karmic depot
#

The program will start at boot time, if u run it from /etc/rc.local as a background process and your text file should also be present during boot time

#

otherwise u need to run the script after boot

flat latch
#

Would probably be better to run on boot

karmic depot
#

is your file present at boot time?

flat latch
#

This program is the sole purpose of the raspberry po

#

Yes it should be

karmic depot
#

try that

#

or u could use a dummy file with the same name

#

in same path

fluid gull
#

would there be any point in the next Raspberry Pi Pico being slightly more tolerant to running actual operating systems on it? Like Fuzix but with real memory management

#

and > 15 processes

#

I'm just asking because I'm curious; no agenda here.

#

and say > 256k of RAM or however little amount it currently has

#
  • for the same price as current Picos
rain basalt
#

anyone here tried compile micropython for m5stack?

#

successful build but firmware is not working, i get no prompt on serial

elder knot
karmic depot
#

✅✅

trail inlet
#

Hey. Were you able to solve this problem?

#

Did anyone attempt to use pypi package to control lego mindstorms?

steep dune
#

thats a good idea , any one here have a LEGO mindstorm to test

rancid silo
#

Is there a way to communicate to a arduino using iPhone?

undone dust
spiral sandal
#

soundmodem too

rancid silo