#microcontrollers

1 messages · Page 9 of 1

elfin sphinx
#

also , if you didnt use the resistors for the first time , it may or may not have damaged the ESP32

cloud hinge
#

yes, that makes perfect sense. i might got the multiplexer route and add the 3.3v to 5v module if possible on top of that. that or just use a arduino nano to feed in the v and amp data to esp32 via rx tx . will still need 3.3 to 5v converter though. trying to take the easiest route

elfin sphinx
#

you dont need all this fancy multiplexer , extra arduino and whatnot

cloud hinge
# elfin sphinx all you need is 2 resistors lol

yeah i have the resistors ready but only pin 35 seems to be compatible with the cyd at this point. need two modules so i can measure amps and voltas at same time to caculate watts to create other features i need for projects

elfin sphinx
#

you can measure voltage with another 2 resistors forming a resistor divider , you dont need a whole new ACS module

cloud hinge
#

i like having the volt and amp meter seporate but maybe i should opt for the all in one module

elfin sphinx
#

what is the "max voltage and current" you want to measure ?

cloud hinge
elfin sphinx
#

and with what resolution

cloud hinge
#

25v is decent

elfin sphinx
cloud hinge
elfin sphinx
elfin sphinx
cloud hinge
#

i was hopeing to have the full 5a to be able to measure solar panel output

elfin sphinx
cloud hinge
#

ok , 6amp max

elfin sphinx
cloud hinge
#

my solar panel is 100w at 5.6 amps i think or something like that

cloud hinge
elfin sphinx
#

sure

cloud hinge
# elfin sphinx sure

will the ressitor divider have to be on another pin? do u think this example in the esp32 picture on this page is good for the acs? mainly the resistor specs?

humble kraken
# cloud hinge will the ressitor divider have to be on another pin? do u think this example in ...

The range is set by which ACs712 you are using, if you use the 05 version then it can measure 5 amps max.

If you use a voltage divider of 39k on the top, and 10k on the bottom, then you will get a division of ~4, and the 0-5V anologue output of the ACS712 will get translated to 0-1.05V for the esp32 to read; it has a second attenuation option where its ADC is configured to read 0-1.1V which is its voltage reference value

#

I suggest put the divider output on one of the ADC1 pins

cloud hinge
cloud hinge
wispy lintel
#

Is C++ good for microcontrollers

elfin sphinx
#

if you are doing microcontrollers , you should know C/C++

cursive hamlet
#

Has anyone come across an issue where code works when run through thonny but not when running on boot?

#

I have been trying to sort this error for a while and have built the system on two devices in order to try and fix it but can't work it out

#

It loads well until I run it headless and then it always gives the same error

#

It is loading the sd card, for some reason it just wont do it when the pico is running not connected to the computer

#

I am have made a reprex file is anyone would be happy to have a lok over it? I am wondering if it is because of the way that I am setting up the vfs but it is the same as I see working all the time online

#

although admittedly they do not try to run it headless

cursive hamlet
#

I have also tried it with the esp32 and gotten the same issue

#

Meaning it really must be:
1 - The code
2 - The sd card adaptor
3 - The sd card

elfin sphinx
cursive hamlet
#

Here is a reprex of the code

#

from machine import Pin, SPI
import sdcard
import uos

SD_MISO = Pin(19)
SD_MOSI = Pin(23)
SD_SCK = Pin(18)
SD_CS = Pin(5)

cs = SD_CS
spi = SPI(1, baudrate=1000000, phase=0, polarity=0, sck=SD_SCK, mosi=SD_MOSI, miso=SD_MISO)
sd = sdcard.SDCard(spi, cs)
vfs = uos.VfsFat(sd)
uos.mount(vfs, "/sd")
uos.listdir()

with open("/sd/tester.txt", "w") as f:
f.write("HelloWorld!\r\n")

#

I am using this board

#

With the pins as specified in the code. The ground is connected to the top right pin and the VDD to the opposite "+5V" pin.

#

Bit of a messy setup with the other components but everything is wired correctly I believe

#

The code works great when run from thonny

#

But not when run headless, I have tested to make sure that it is actually trying to run the code when running headless by putting LED flashes in at various places which all work up until the line
"sd = sdcard.SDCard(spi, cs)"
I have also wired this up to a pi pico and had the same issue

#

I have also previously sent the error messages to the display so that I get them even whilst running headless and I get the error.

"couldn't determine SD card version"
But I do not get this error when run through thonny

#

In terms of the power supply I use the same usb hub as when I am running it from thonny as it runs the program when I connect it without needing prompting if I put it in the boot file. I have also tried it historically with usb wall plugs with no luck.

cloud hinge
#

I want to connect arduino to esp32 via Bluetooth . I seem to be struggling, can anyone recommend a website or video that would work. I've tried a lot of things but can't seem to connect

cursive hamlet
#

If anyone is able to give me any advice I would really appreciate it, I have been stuck on this for months and spend hours and hours searching the web for a fix

errant wigeon
cursive hamlet
#

Sure I will absolutely try that! From memory I tried putting in a 1s sleep between every line one at a time between the stary line and the line that broke and still couldn't get it to work in the main file I am using

elfin sphinx
cursive hamlet
#

Yeah I have kept it consistent

#

I have swapped out during my testing:

The board: Pico to ESP32
The power supply: From the usb hub that is used to connect it to my mac to an external usb block (2.5A)

#

I am happy to take any photos or videos that would be helpful

#

I have also put a flash in the code in every line to find out where it breaks

#

And I have also used logging to log the error to a text file on the board as well as sending the error to the lcd screen which returns "couldn't determine SD card version"

cursive hamlet
#

I have also tried swapping it from the 5v pin to the 3.3 but admittedly not when running headless as it breaks even when not doing that

cursive hamlet
#

I am not sure it can be done with the package

#

I actually haven’t found anyone who has run it headless

#

At all

cursive hamlet
#

Does anyone have any examples of projects using micro python that use an sd card?

#

This is the sd card reader I am using

#

I have it currently set to the 5v pin but with the 3.3 it won't work for some reason

#
formal thistle
#

Are you putting it on an Arduino? Step 7 says there's "3.3V level converter chip"

elfin sphinx
cursive hamlet
cursive hamlet
elfin sphinx
#

also , dont try to change too much stuff , choose some things and keep them constant throughout experimentation

for example , choose a main board - either ESP32 or pi pico , and stick with it throughout your whole experiment , dont swap around boards

#

we need to keep everything constant and check 1 factor at a time

#

first we will check SD card

#

lmk the results

cursive hamlet
#

Absolutely I should be back at my house in half an hour or so, I will let you know

#

Thank you for the help 🙂

wispy lintel
#

has anybody here every taken embedded systems before with using both Assembly Language and C with programming out microcontrollers and if so can you tell me your experience
I am supposed to be taking this course as it is a 8 week course that is 4 credits with lab attached to them. I been told that this is a challenging course itself and if somebody can tell me more about it.

elfin sphinx
#

i did make stuff with arduinos before i knew C and assembly
but it was just finding project on internet and replicating it , i didnt write any code ,if i was stuck , i would post question on random forums and search answers

then after some time i learnt C/C++ , that got used in microcontroller extensively

then in our college we had a course on microprocessors and microcontrollers where they taught us assembly code

#

also " embedded systems" is a big term
post syllabus of your specific course , we might be able to help you better knowing what microcontrollers you are expected to use in there

wispy lintel
#

@elfin sphinx I will do that and thankyou

#

The use of computing devices in embedded applications is introduced. Computer organization topics include the functional architecture of microcontrollers, timing and control, memory, serial and parallel I/O ports, and the bus system. Additional topics include peripheral interface control, interrupts serial communication, and applications. Programs are written and run in assembly language or higher-level languages. This course presumes an introductory-level understanding of structured programming techniques.

#

Course description

#

At the end of this course the student will be able to:

  1. Understand the architecture of a microcontroller (MCU) system.
  2. Use an integrated development environment (IDE) to program an MCU.
  3. Write programs in C or assembly language to perform tasks.
  4. Use registers to configure an MCU to do various tasks.
  5. Use internal timers and external interrupts to control processes.
  6. Use an MCU to:
    a. Control an external peripheral device using digital output.
    b. Respond to a digital input.
    c. Generate an analog signal using pulse-width modulation (PWM).
    d. Respond to an analog input through an analog-to-digital converter (ADC).
    e. Send and receive serial digital data using a serial communication protocol.
#

Course objectves

#

Been told nobody can tell me how it might go as everybody is different

#

textbooks to be used

#

Embedded Systems Design using the MSP430FR2355 LaunchPad™ (Brock J. LaMeres) Springer Nature Switzerland, 2020
ISBN: 978-3-030-40574-8

MSP430 Microcontroller Basics (J.H. Davies) Newnes Press (Elsevier), 2008.
ISBN: 978-0-7506- 8276-3

faint lichen
#

i got 2 pico w and adafruit oled 0.96 and arducamera for live feed and 2 drv8833 and i need some help making code for rc i'm planning to build

cursive hamlet
#

I am wondering if part of the problem I have been having with this sd card is that I formatted it on mac

#

I am trying to redo it now and don't actually have the option of fat 32 from what I can see

#

Only ExFAT or MS-DOS

cursive hamlet
#

I have reformatted the card as MS-DOS and am using this code

#

from machine import Pin, SPI
import sdcard
import uos
import time

SD_MISO = Pin(19)
SD_MOSI = Pin(23)
SD_SCK = Pin(18)
SD_CS = Pin(5)

with open("/tester.txt", "w") as f:
f.write("HelloWorld, Headless!\r\n")

cs = SD_CS
spi = SPI(1, baudrate=1000000, phase=0, polarity=0, sck=SD_SCK, mosi=SD_MOSI, miso=SD_MISO)
sd = sdcard.SDCard(spi, cs)
vfs = uos.VfsFat(sd)
uos.mount(vfs, "/sd")
uos.listdir()

with open("/sd/tester.txt", "w") as f:
f.write("HelloWorld, Headless!\r\n")

#

I have also removed all other components

cursive hamlet
#

I have been able to get it to work!

#

But it is not very consistent

#

It takes a few resets for it to work for some reason

#

I guess I could put in a loop which tries until it works

#

but that is not a great solution

cursive hamlet
#

It worked once and then never worked again

#

I have updated the code so that it tries it over and over again

cursive hamlet
#

It works flawlessly when run through thonny but not at all when headless

#

Apart from that one random time

#

but now I set it to try 50 times and it will not do it

cursive hamlet
#

Does anyone else have a board setup with micropython and an sd card reader to hand?

elfin sphinx
#

can you show your setup ?? a wiring diagram , and photo of what SD card module you have ??

#

also one small thing , i have not used uos module for my SD card project, i have used the os module
i am not sure what the difference between the two is , its just what i have used

#
# SPI bus initialization for SD card with 80Mhz frequency
spi = SPI(0, baudrate=80_000_000, polarity=0, phase=0, bits=8, sck=Pin(2), mosi=Pin(3), miso=Pin(4))
# Chip Select pin
CS = Pin(5, Pin.OUT)

#SD card initialization and mounting
sd = sdcard.SDCard(spi,CS)
vfs = os.VfsFat(sd)
os.mount(vfs, "/sd")

here is how i had setup my sd card with pico using micropython

elfin sphinx
cursive hamlet
#

Awesome thank you I will do that now

elfin sphinx
#

i am not sure how formatting is done on mac

but if you are comfortable with command line interface, i am pretty sure you can find a tutorial giving you the command u need to run

cursive hamlet
#

My next thought is that it may have something to do with the SD card reader

#

I can not find an ESP32 on a software to do the pins but they are specified in the code

#

I will try soldering pins to an adaptor and see if I can use that instead

elfin sphinx
#

how do you power the thing when u want to power it headlessly ??

do you plug in a USB cable into ESP32 and the other end into USB hub ?

cursive hamlet
#

You can see them all from here:

SD_MISO = Pin(19)
SD_MOSI = Pin(23)
SD_SCK = Pin(18)
SD_CS = Pin(5)

#

I literally just unplug it from the usb hub on the laptop and replug it back in

#

The power boots the program

elfin sphinx
#

and u are saying that , in this exact setup , everything works as expected every single time when run through thonny ?

cursive hamlet
#

Yeah I will send a video to show you

#

It works every time in thonny but it has only worked one time ever headless

elfin sphinx
#

have you made sure you are storing the code on ESP32's memory ??

cursive hamlet
#

And I can currently using code that tries 50 times

#

Yeah 100%

elfin sphinx
#

can you try a different power source ?

#

a wall adapater ?

#

for headless power

cursive hamlet
#

I have tried with a 2.5A adapter which also doesn’t work unfortunately

elfin sphinx
#

also change uos to os in your code and run that

cursive hamlet
#

Will do

#

That is it working through thonny

#

Not headless for the end sorry should have said text stuff in it

elfin sphinx
#

yea i understood u

#

!code

#

could you reformat it ?

cursive hamlet
#

Yeah sure

#
from machine import Pin, SPI
import sdcard
import uos
import time
import logging

SD_MISO = Pin(19)
SD_MOSI = Pin(23)
SD_SCK = Pin(18)
SD_CS = Pin(5)

cs = SD_CS
spi = SPI(1, baudrate=1000000, phase=0, polarity=0, sck=SD_SCK, mosi=SD_MOSI, miso=SD_MISO)

logging.basicConfig(filename='errors.log', level=logging.ERROR)

Loop to try multiple times
if "/sd" in uos.listdir():
    print("SD card is already mounted")
else:
    print(uos.listdir())
    max_attempts = 50
    for attempt in range(max_attempts):
        try:
            sd = sdcard.SDCard(spi, cs)
            vfs = uos.VfsFat(sd)
            uos.mount(vfs, "/sd")
            print(uos.listdir())
            print("SD card mounted successfully!")
            # Now you can use the SD card
            with open("/sd/tester.txt", "w") as f:
                f.write("HelloWorld, Headless!\r\n")
            break  # Exit the loop only if successful
        except OSError as e:
            print(f"SD card mount failed (attempt {attempt + 1}): {e}")
            logging.error(f"Error: {str(e)}")
            time.sleep(0.2)  # Wait before retrying

If all attempts failed, print an error message
if attempt == max_attempts - 1:
    print("SD card mount failed after all attempts")

#

I actually just tried to record it not working but it worked headless for the secodn time ever, but it has only worked two out of maybe 50 tries

elfin sphinx
#

loll

#

try 3rd time now

elfin sphinx
cursive hamlet
cursive hamlet
#

The terminal output when it works is as follows:

%Run -c $EDITOR_CONTENT

MPY: soft reboot
['SDCardReader.py', 'boot.py', 'errors.log', 'lib']
['sd', 'SDCardReader.py', 'boot.py', 'errors.log', 'lib']
SD card mounted successfully!

#

I have set it up to log errors to the board's storage when an error occure and it produced this file when running headlessly

#

Traceback (most recent call last):
File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tkinter/init.py", line 1921, in call
return self.func(*args)
File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/thonny/base_file_browser.py", line 590, in on_double_click
self.open_file(path)
File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/thonny/base_file_browser.py", line 1205, in open_file
get_workbench().get_editor_notebook().show_remote_file(path)
File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/thonny/editors.py", line 1076, in show_remote_file
return self.show_file(make_remote_path(target_filename))
File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/thonny/editors.py", line 1063, in show_file
self.select(editor)
File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tkinter/ttk.py", line 885, in select
return self.tk.call(self._w, "select", tab_id)
_tkinter.TclError: .!frame.!automaticpanedwindow.!automaticpanedwindow2.!editornotebook.!editor22 is not managed by .!frame.!automaticpanedwindow.!automaticpanedwindow2.!editornotebook

#

But I am not using tkinter so I have no idea what it means by that?

elfin sphinx
#
import machine, os, vfs

# Slot 2 uses pins sck=18, cs=5, miso=19, mosi=23
sd = machine.SDCard(slot=2)
vfs.mount(sd, '/sd') # mount

os.listdir('/sd')    # list directory contents

with open("/sd/hello.txt", "w") as f:
  f.write("HelloWorld, Headless!\r\n")

vfs.umount('/sd')    # eject

can you run this code and lmk the results ??

#

in both , headless as well as through thonny

cursive hamlet
#

%Run -c $EDITOR_CONTENT

MPY: soft reboot
Traceback (most recent call last):
File "<stdin>", line 5, in <module>
OSError: 16

#

That is in thonny

#

Headless won't give me an output because to won't be connected to the terminal

#

Do you want me to mount the sd with the previous code first?

elfin sphinx
#

umm , i do not have the exact same ESP32 as you on hand rn so i wont be able to reproduce that bug

are you able to wire up a pico on your machine and test this ? ( Since you said you had same issue on pico as well )

Ill reproduce the setup here and let you know what happens

cursive hamlet
#

Yeah absolutely can do I will just need a second if that is alright I have been called for dinner so I may be about 15 mins no worries at all if you are not around to answer at that point I really am thankful for your help already!

elfin sphinx
#

all good , if i am on by the time you are here , we will dig through it
if not , you post the results ill check when i wake up tomorrow

cursive hamlet
#

Just wiring it up now

#

RIght it it up and working

#

from machine import Pin, SPI
import sdcard
import uos
import time
import logging

SD_MISO = Pin(12)
SD_MOSI = Pin(11)
SD_SCK = Pin(10)
SD_CS = Pin(13)

cs = SD_CS
spi = SPI(1, baudrate=1000000, phase=0, polarity=0, sck=SD_SCK, mosi=SD_MOSI, miso=SD_MISO)

logging.basicConfig(filename='errors.log', level=logging.ERROR)

# Loop to try multiple times
if "/sd" in uos.listdir():
    print("SD card is already mounted")
else:
    print(uos.listdir())
    max_attempts = 50
    for attempt in range(max_attempts):
        try:
            sd = sdcard.SDCard(spi, cs)
            vfs = uos.VfsFat(sd)
            uos.mount(vfs, "/sd")
            print(uos.listdir())
            print("SD card mounted successfully!")
            # Now you can use the SD card
            with open("/sd/tester.txt", "w") as f:
                f.write("HelloWorld, Headless!\r\n")
            break  # Exit the loop only if successful
        except OSError as e:
            print(f"SD card mount failed (attempt {attempt + 1}): {e}")
            logging.error(f"Error: {str(e)}")
            time.sleep(0.2)  # Wait before retrying

# If all attempts failed, print an error message
if attempt == max_attempts - 1:
    print("SD card mount failed after all attempts")


#

I am so confused

#

I have set it all back up on the pico

#

and now it works flawlessly

#

Headless

#

and I only got the board because of the fact that the pico didnt work

elfin sphinx
#

happens to the best of us

#

glad you got it working now

cursive hamlet
#

Thank you fro the help I really appreciate it

#

I actually think it is the mass trials that are letting it work interestingly

#

Looking at the error log

#

looks like it failed a few times and the finally works

#

The last time I was using it I didn't have it set to try multiple times

#

I have no ide why it takes multiple attempts to load when headless but at least it works

stoic mason
elfin sphinx
#

also try out a different SD card

weak tusk
#

Hello, how to program controllers via python ? Or where can I find information ?

elfin sphinx
#

also , not every microcontroller supports to be programmed with python

C/C++ is more widely used for microcontrollers

#

some microcontrollers support a derivative of python called micropython or circuitpython

weak tusk
#

Well, does arduino support Python ?

elfin sphinx
#

if you want to write full fledged python, you probably need a single board computer like raspberry pi 3 or 4 or 5 or zero 2 w etc

#

for microcontrollers, you are usually limited to writing micropython

elfin sphinx
cloud hinge
#

I wonder what the implications for the microcontroller world will be. https://youtu.be/HmM9tHwfN5M

What if your body could become a USB cable? Ixana, a cutting-edge wearable hardware company, is revolutionizing how we connect our devices by using our bodies as conductors.

Subscribe to Freethink on YouTube ► https://freeth.ink/youtube-subscribe
Up Next ► Former SpaceX engineer invents a “Robotic Blacksmith Army” https://www.youtube.com/watch...

▶ Play video
graceful bison
hearty cliff
#

Hey yall, is there any library or any way that helps me(client) mark destinations on the map to command my robot car to travel to that marked destination.

I'm using Pi 4 with a GPS Module and for app I'm developing it using React Native with react-native-maps lib to implement a map into my app. I have no idea how to communicate from client to my Pi 4 and give destinations to it.

If you have any vids/websites or you have any guidance for me then please LMK I'm ready to listen. I did not start yet, still in the process of planning everything.

unique valve
#

HILO

#

Anyone alive?

#

SOMEONE

#

ANYONE?

elfin sphinx
unique valve
#

So I wanted to connect my ESP32 using pymakr

#

But it keeps on giving me an error

elfin sphinx
#

ok whats the error ?

#

@unique valve

unique valve
#

Wait I just turned my PC off

#

I will turn it back on and show it to you

elfin sphinx
#

aight , nw , post it when u are available

unique valve
#

Yea sure I will be back in a bit then

hallow igloo
#

Skibdi

elfin sphinx
#

and please make sure yuou describe all the things about your issue , the error , the code , a photo of your setup , a circuit diagram , basically everything that is relevent
dont just ask stuff like "is anyone there" then wait for someone to reply "show code"

errant wigeon
main nacelle
#

May I ask a question my apologies

naive oyster
main nacelle
#

Are you sure

main nacelle
unique valve
#

Hi so my microcontroller is connected to my pc

#

But the pymakr extension doesn't show it

#

So how to I make it so that my ESP32 is visible

#

Cause I could connect it to Thonny and code there using micropython but something is wrong with VScode

unique valve
#

Also what is wrong with this code?

import machine
import time

motorServo = machine.Pin(18, machine.Pin.OUT)
sw = machine.Pin(0, machine.Pin.IN)

def rotate_motor_ntimes(num, t_on, t_off, rotation_degree, msg):
        counter = 0
        while (counter < num):
            motorServo.on()
            time.sleep(t_on)
            motorServo.off()
            time.sleep(t_off)
            counter +=1
        print (msg)
        
while True:
    if (sw.value() == 0):
        rotate_motor_ntimes(10, 2, 4, 90, 'Done.')
        
warped owl
#

whats better, an rpi 4b or 5b?

mental jungle
#

What equipment will I need to get into microcontrollers (aside from the circuits themselves)? Also please provide the links and possible total cost. I want to get into this area but main issues is the cost. Luckily, managed to get a job at supermarket (starting next week) but dont want to spend too much as I need to set aside some money for my tuition fees

mental jungle
elfin sphinx
mental jungle
#

Know any good resources for learning about electronics? Something to help learn the basics quick and get onto making projects

wispy pond
#

If i wanna get started with robotics and mechatronics, how do I even start?

spiral sandal
#

like everybody, by blinking a led

cloud hinge
vivid fiber
rigid kraken
main nacelle
#

Who here has made a romantic hand with her approximate to human skin my apologies

errant wigeon
#

!ban 868137138091343925 3w You've been told to stop with this kind of message and this specific one is absolutely against our code of conduct. If you want to continue engaging in our community then consider our code of conduct and adhering to it going forward.

hasty zealotBOT
#

:incoming_envelope: :ok_hand: applied ban to @main nacelle until <t:1730852727:f> (21 days).

velvet marsh
#

dumb question: could one theoretically use an Arduino as a means of adding extra GPIO pins to a raspberry pi

spiral sandal
velvet marsh
#

neat, thanks

#

working on a project that may overflow off my pi

elfin sphinx
#

althoug an arduino might be overkill depending on what you are doing

if you want to control lots of outputs that are not really high speed , you can use shift register ICs
ex- controlling lots and lots of LEDs or relays etc

main tapir
#

Wait

#

We can use python on esp32?

elfin sphinx
opal cedar
#

Hello everyone, I’m pretty new to python(for about 3 months ) but I’ve trying to push myself to learn through programming electrical components on a bread board. The dream is like log the temp in my room in the morning and use a 4 digit 7 segment display for current temp. But I’ve been struggling with understanding my understanding of electrical circuits and the general flow of everything. Also, I’ve been learning bash on my Pi 5 for about the same amount of time as I’ve been learning python. So it’s been a learning as I’m going experience but not any insurmountable. Would anyone happen have resources you any would recommend for a novice?

hot basalt
opal cedar
hot basalt
whole meadow
#

Hello, everyone! I have a question for those who once worked with pySerial.

So what is the point of the question, I am trying to access the controller through the COM port using pySerial.
The port connects as it should, I get the value is_connected true, but when I request some data, the response is empty.

This controller, it's an FPV controller, so I can also open these settings through BetaFlight which has its own CLI, but I want to use only python code.
But interestingly, after I run some commands in the BetaFlight CLI, and disconnect to release port access, my own code starts working. However, if I unplug the USB and plug it back in again the same thing...doesn't work

My guess is that my code is, shall we say, unable to "wake up" the controller. Which, in turn, Betaflight successfully does, but I don't know how it does it 🙂
Maybe there are some parameters or methods to fix it? I will be grateful for help or advice on where to look for an answer.

Thank you

port = '/dev/cu.usbmodem0x80000001'
baudrate = 115200

import serial
import time

def read_vtxtable():
    try:
        ser = serial.Serial(port, baudrate, timeout=5, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS)
        time.sleep(2)
    except serial.SerialException as e:
        print(f"Cant open this port {port}: {e}")
        return []

    # Trying to initialize process and make controller alive
    ser.write('status\n'.encode())
    time.sleep(0.05)

    # Asking controller about vtx data
    ser.write('vtxtable\n'.encode())
    time.sleep(0.05)

    response = ""
    start_time = time.time()
    while time.time() - start_time < 5:
        if ser.in_waiting > 0:
            response += ser.read(ser.in_waiting).decode()
        time.sleep(0.05)

    ser.close()
    return response

vtxtable_data = read_vtxtable()

print(vtxtable_data)
dusk light
#

@whole meadow Have you tried parameters rtscts and /or dsrdtr ? For example (and if I remember correctly) the latter happens to reset an Arduino Uno R3, so it may be that your mysterious controller also uses hardware handshake.

jovial pendant
#

hello, i am trying to control servos through an arduino using the processing app. i know its not python but the entire internet cant seem to solve this, or at least help me. i was recomended to try here. I followed this tutorial https://youtu.be/MUM8_4mWxng?si=MgqxrN8TLcfzVu27 but it never talks about how to add buttons, only how to add joysticks to the code. if anyone could take a look, i bet it is simple but im new to this.

Read the full tutorial at https://www.makeuseof.com/tag/arduino-robot-game-controller/

Today we will be exploring a creative way to control a servo using Processing, and an Xbox360 controller. If you are already pretty game development savvy, you might be interested in our Custom Game Controller tutorial, which uses Unity.

********************...

▶ Play video
dusk light
#

Indeed, your chances of getting a response here are pretty low (read: close to inexistent) so you have a few options, which are more sensible to me:

⚠️ Be wise enough to not cross post to spare multiple people from wasting their time giving uncorrelated and potentially contradicting answers.

#

Tip: you don't ask your mechanic how to prepare a pie, do you.

elfin sphinx
#

i think the roadblock for not getting the answer would be that
people have to watch a 22 minute just to understand what he wants to make

#

It would be easier for people if you give a TLDR , show photos of what you have done , your code etc so that people get more info about your setup

keen depot
#

if you like it, maybe buy more

#

then eventually you can start doing more advanced projects

frigid frigate
#

Guys I tried to open my old set-top box but I am confused with this type of motherboard. Can anyone explain to me its parts or can I use it in my projects

elfin sphinx
frigid frigate
elfin sphinx
# frigid frigate Is this of any use? Can I use it in any project

"can i use this in a project"
has a very subjective answer , it all dependss on what kind of project

but 99% of the time , boards made for a specific application like the one you have showed cannt be used "as is" in any project , just salvage parts and use them

also i am not sure how your questions concern python or microcontrollers in any way.....

fading whale
#

oooooooo

#

<@&831776746206265384>

fallow plinth
fading whale
#

my mic

#

does not work here

#

<@&831776746206265384>

#

<@&831776746206265384>

stone crown
fading whale
#

men

#

my mic

stone crown
#
  1. This is not the appropriate channel
  2. Please read #voice-verification
  3. If you need to contact moderators and it's not urgent, then DM @atomic flume
fading whale
#

sorry men 🙂

supple oxide
#

Stoop mate, I am getting constantly pinged

fading whale
#

love you body

supple oxide
#

Tf?

fading whale
#

no i mean thanks men

stone crown
#

This is going to be my only warning to stay on topic in this channel.
Also, please change your nickname to not be blank.

fading whale
#

ok sorry men

#

thanks

cloud hinge
# frigid frigate Is this of any use? Can I use it in any project

https://electronics.stackexchange.com/questions/82553/datasheet-for-this-processorm3329-cpu-mips-architecture looks like a M3329 mips chip. Have to search around how to use it if possible. Might be more work than its worth but anything is possible

cloud hinge
#

Made this today for the amp meter, its a live volt amp watt meter graph

abstract plover
#

tasty

cloud hinge
#

is there a library that connects from esp32 to bt speaker, mac adress ect, audio, ect...?

stone crown
dusk light
#

Ok. Noted. Do you have a more diplomatic approach to favour?

#

(Especially when you suspect the OP should have done some prior research)

errant wigeon
# dusk light (Especially when you suspect the OP should have done some prior research)

Help them learn how to do some research.
Break down the question into blocks, and explain how you approach each block.
It is easy to think that a quick search is the answer, but if you don't know enough to know what keywords to search for, or how to discern between different results, it's easy be overwhelmed.

And if you're not in a position to do that, because it is a lot of work, then don't engage and keep the space open for others to do it. It's ok to not have time, but everyone starts at different square 1s, and there's lots of reasons that what feels like simple research is actually a boon of your experience. So teaching folks how to look into stuff, and discern the helpful from not helpful results is a major way to help folks grow

dusk light
#

Fair. Thanks.

cloud hinge
# dusk light <https://duckduckgo.com/?q=esp32+bluetooth+audio>

I been looking for a few days now testing here and there with no luck with a certain bt audio library. I thought I seen most of his github work and comments. Some how the link you sent me was the one I think takes me to the correct answer and code(I'd been editing a different code for days with no luck from same author). I have been looking high and dry then you really came through. Somehow Google wasn't taking me where I needed to be but your link was spot on. It made me realize the code is way simpler then I thought. Gonna try and make some progress on it later cause I feel its a important project. Thank you so much

dusk light
cloud hinge
elfin sphinx
#

what device would you guys recommend to measure power consumption of devices that are in light sleep / deep sleep (so current would range from few milliamps upto few tens of microamps) ??

soft venture
#

So I have a raspberry Pi 4 2gb model and I tried running an object detection script on it which would tell me where to turn my camera so there's no object in front of it. It uses open cv and pre-trained model (yolov3). Issue is that when I run it on my pi, my open cv window never appears tho according to my camera its on, and after that my python process stops with a message in my terminal just saying "Killed" and I really have 0 idea what's going on.

cloud hinge
# elfin sphinx what device would you guys recommend to measure power consumption of devices tha...

Ina226 with proper resistor shunt. Can ask ai or someone to figure out the shunt needs . there's a better module but this is the ina226 is the mid budget and very accurate. The more tunned in the shunt the more exact readings you will get. If u want the best module ill look it up and get back. I chose a r010 resistor for my ina226 cause I'm using a 100w solar panel and wanted a shunt for around 6amps max to but when it comes to small micro amps then the r010 resistor would not be as accurate prob within 100 mili amps I'm guessing bit with the right shunt and code should be about as accurate as a dialed in store bought tunned in amp meter. I can't say for micro amps accuracy but I'm thinking the upgraded version of the ina226 will be within closer accuracy to what your looking for

#

I see more than one rx TX data pins on chip, do they all connect to same rx TX data lines or do u guys think they are seporate. Hoping to listen in on the TX output

#

Not sure if I should test pin 18 and 19 or pin 1 and 2 But mainly TX not TX so much at this point

elfin sphinx
elfin sphinx
cloud hinge
# elfin sphinx i dont want something that i have to second guess "is this correct or not " , i ...

I have one, for my readings its very accurate on r010 resistor, for the more smaller amps I have not seen that done in person with needed resistor except for seeing on youtube, looked to be very accurate for some folks, just have to look if the +- is I'm your range. if you send me a dm I can look it up later. There's another ina module that has higher accuracy but cost about 15$. I can find it later if ya like, I can also look up the shunt needed(very important). The shunt really determines a lot of accuracy for these modules. Other than that I'm not sure what the best regular product is to buy. I just use a standard multimeter other than the module cause its all I have at the moment

cloud hinge
#

@elfin sphinx I think the first tx is the one used but can be configured to use multiple or reconfigured or all in different ways. I also asked another source but I'm still not clear whats really going on

elfin sphinx
# cloud hinge I have one, for my readings its very accurate on r010 resistor, for the more sma...

for my readings its very accurate on r010 resistor
are you reading microamps/milliamps ?

except for seeing on youtube
well , do you have a link for it ?

just have to look if the +- is I'm your range
its not exactly that simple

I can find it later if ya like
I was looking for someone who has some firsthand experience with this
I have googled, found some ICs that look they could work
but at the end of the day ,its something i threw together , i dont have any way of verifying if its accurate
nor do i have the equipment needed to properly calibrate it

I can also look up the shunt needed(very important)
The shunt just determines the range , the critcal stuff is ADC used

Also , when you are measuring microamps of current , you dont want the shunt to draw more current than the actual load and alter the readings

All the reliable options i have yet found boil down to high end bench multimeters or power profiler kits , i am looking if there is some middle ground

#

I currently use a power meter I made with INA current sensor and its "ok" , not the best. The readings fluctuate randomly , sometimes it conflicts with my multimeter etc etc , so i just dont want there to be doubt

elfin sphinx
# cloud hinge

thats not a pin diagram , i want you to look at a pin diagram

which pins do you think are the two conflicting ones ??
per the pin diagram , looks like you can use pins 11 and 13 for serial communication on port 1

cloud hinge
#

@elfin sphinx miliamps, but like I said my setup is not designed for micro or miliamps exact readings but the range I set it for goes 6 digits past the decimal, yes the chip on the module plays the major role in accuracy so ill try and find the most accurate one for you in a bit but second to the chip in the shunt to be dialed in. Ill find the YouTube video too, was very tired last night after watching the Mike Tyson fight. The plus and minus I refered to is referee to in the one chip spec and being more accurate .1% or something of that nature. I think the ina chips might be the best budget amp multimeter for Arduino and accuracy one can buy but I could be wrong. What ics are you leaning toward to? The calibration is done in arduino ide through the code basically 3 factory shunts you can choose from. The 15$ ina ( more expensive one) is the most calibrated by factory out the box with extra high low features to insure accuracy. As far as verifying it for 100% accuracy you would probably need a side by side with a known accurate meter. At the moment I don't have a way to verify accuracy either with a side by side, I hope to try the more expensive ina in the future to verify accuracy with a smaller shunt for similar reasons as you. And I agree and those micro mili amps accuracy is super important. I just woke up but ill get back asap today with the info

#

@elfin sphinx this is a display I designed for the ina specifically to read on a graph and show history, it works amazing so far. I havnt released to the public yet but hopefully soon. It has some really nice integrations and extra features not seen anywhere else based on the cyd.

elfin sphinx
# cloud hinge <@671318664280145920> miliamps, but like I said my setup is not designed for mic...

but like I said my setup is not designed for micro or miliamps exact readings
well thats pretty much what i am looking for
so ill try and find the most accurate one for you
there is no need , its pretty easy to find stuff using googling and i can google myself and read datasheets , buti dont want the theory part
I want to know what people actually use , how stuff works in the real world
for example - there are tons and tons of multimeters out there with "high accuracy and precision" on the market , but can we trust all of them ? ofcourse not , thats why expereience of people is important
I am not looking for someone to google the answers for me

What ics are you leaning toward to?
I would like to avoid the DIY router if possible

The calibration is done in arduino ide through the code basically 3 factory shunts you can choose from
Thats not the calibration i am talking about
like sure , the chip will show me current 6 digits or 8 digits or whatever , but is what it saying actually accurate ? are the readings stable ? etc etc
"on paper" pretty much every IC is "good"
In conclusion , i am not really looking for you to do some googling about "best ICs to monitor low currents" , like i can do that . I want to see what people use in their day to day life

the only good options i have seen so far are expensive bench multimeters and power profiler kits, wondering if there is anything else aswell

cloud hinge
elfin sphinx
cloud hinge
#

@elfin sphinx https://youtu.be/otcygsfQmX0 can use auto translate, its a very informative video and there's a couple other really good ones when it comes to accuracy

Друзья кому нужны платы обращайтесь (отдам по вкусной цене), только по Украине.

Instagram , следи за мной - https://www.instagram.com/taras.burko

Платы можно здесь JLCPCB - https://jlcpcb.com

Много интересного материала, смотри в этом видео - https://youtu.be/1ZTTSeCOSwo

Arduino Pro mini - https://ali.ski/wwLO1Z
INA226 - https://ali.ski/CF...

▶ Play video
#

@elfin sphinx awesome thank you, I been there once but I forgot all about it. Much apprecieted.

cloud hinge
#

@elfin sphinx the ina260 is the most accurate I found so far without testing. https://youtu.be/pu8YlI39l8Y

Texas Instruments INA260 Digital Current/Power Monitor comes with an I2C and SMBus™-compatible interface with an integrated precision shunt resistor. This device enables high-accuracy current and power measurements and over-current detection at common-mode voltages.

Learn More: http://mou.sr/2m8kcPi

▶ Play video
elfin sphinx
#

yea , i dont think i want to look for a DIY solution , there is pretty much no way for me to verify if what i made is actaully saying correct things

cloud hinge
cunning lance
#

guys, if anyone here in Arduino Community, then please request them to unban me...

errant wigeon
cunning lance
#

ok

#

how to appeal, by the way?

errant wigeon
#

I do not know. This is probably not going to be the place to find out how to do so either.

cunning lance
#

oh ok thanks a lot

#

hmm, i would really like to hear your opinion and if you could also help me...

errant wigeon
# elfin sphinx what device would you guys recommend to measure power consumption of devices tha...

There is this: https://www.nordicsemi.com/Products/Development-hardware/Power-Profiler-Kit-2
which is on my wishlist/going to be my first purchase if I ever need to design something that needs a long battery life. So I haven't used it but it seems pretty well liked from the folks I've seen use it.

To supplement it's measurement scale, and to predict things like 10y battery life on a coin cell, you can build multiple prototypes and run a test over like a day or week per prototype, then you'll get a sense of the variance in power usage by component variance which usually becomes the significant source of error in prediction at that level. I don't know if you're trying to measure that fine of a detail, but it's a helpful methodology regardless

elfin sphinx
errant wigeon
limber field
#

So many parts to choose from

dusk light
# cunning lance hmm, i would really like to hear your opinion and if you could also help me...

I used to be part of the Helper community on Arduino Discord. I know the moderators and I also know they don't ban out of a spree or just because they don't like you. Rules are pretty clear on the server and people who get banned in general are ones who did not bother reading/applying them. I'm speaking out of experience but I admit I don't know your case.
EDIT: I also know they don't ban without prior warning.

cold torrent
#

is anyone online

#

here

#

?

elfin sphinx
rancid wagon
#

I'm tryna solve an issue involving ROS2. We're builsing a robot that uses lidar and camera feed to detect objects in an environment, move up to them, take pictures from a bunch of angles then move onto the next. Our original plan was to have it do a lidar scan after each object has been inspected but I literally just realised we have no way to know where the robot is on the occupancy grid. Can anyone help?

proud rivet
#

Does anyone have a good recommendation for the specific model of raspberry pi i should be using when i want to attach sensors to it?

elfin sphinx
proud rivet
#

im looking to use it for monitoring the concentration of chlorine in a liquid

#

i am still trying to decide on how i should do it

#

ive asked chatgpt n one method which uses light seems much simpler, but i prefer not to choose it cuz i need to be able to measure the lvl of concentration

#

im assuming dat im sticking some sort of sensor into the wall of the liquid's container

elfin sphinx
#

ok , lets say you choose some XYZ raspberry pi , it interfaces with the sensor and gets the chlorine level data , what next ?? how would you know what the value is ??

cunning lance
elfin sphinx
cunning lance
#

yes true

#

thanks a lot

#

i was just feeling humiliated for being kicked out of the server for no specified reason, and also not able to appeal to any moderators. but now i am fine, i can ask my questions here also.

elfin sphinx
cunning lance
#

nah nothing man...

#

i am just working on a line following system, with an IR array, and I am designing a support for my IR array to hang from the metal chassis.

#

this is the AGV i'm working on for now, its just a prototype, its a bit shabby too. I have also mounted a robotic arm, which uses speed control instead of position control. My MG996R 180deg motors stop working every 3 days, its an expensive trash. the gears i get in it are plastic, and i don't want to manually change the gears of the servo to metal. its a tedious job and i do it only in emergency. so i use 360deg servo, which works well with encoders.

#

I am using a lot of cool stuff, like NEMA23, A4988 Stepper Motor Driver, l298n, arduino giga shield and giga, encoders, dc motors and a tailormade PCB for Servo Operations, i am also using Raspberry Pi for Master-Slave connection, like the main head of the swarm of AGVs, its a cool project i'm working on. I'm also using Radiofrequency to communicate V2V in AGVs.

#

I was thinking to use SLAM for natural mapping of its surroundings using lidar, but its too expensive as i have already crossed my budget line

cunning lance
dusk light
cunning lance
#

i dont know brother if its hacked or not

cunning lance
#

i dont know actually

dusk light
#

If you don't know, then you can't tell if it has been or not.

cunning lance
#

how to notice if it is hacked or not bro?

elfin sphinx
#

ehh i wouldnt be surprised if the mods on arduino server banned you after small inconvinience to a helper or smth , all of them form like a clout , most people are good , but there are those some people who just..
i have observed that they do lots of stuff without directly telling people
also not having a ban appeal for such a big community is crazy to me

anyway , dont think discussing the policies of arduino server is suited for this channel , so...

cunning lance
#

yea man, i understand, thanks a lot

cunning lance
#

Thanks a lot brother

#

really greatful

dusk light
#

There are also a lot of articles about security on Discord web site. You should also take a look.

#

I can't reasonably share them all here.

cunning lance
#

yea

#

no problem my friend

#

but i don't have any symptoms of my discord getting hacked. Let's forget whatever happened, and move forward 😄

dusk light
#

That's the whole point: there is no symptom at all. That's the purpose of hacking an account: be as discrete as possible.

cunning lance
#

yes absolutely right

#

anyways

#

no problem, whatever happened is done now... lets talk something productive

#

@dusk light are you working on any projects? like I am working on AGV...

dusk light
#

I am indeed. My current project is an alarm clock with a AVR microcontroller. Unrelated to Python though.

cunning lance
#

yea

#

no problem

cunning lance
#

which type of AVR?

dusk light
#
  • ATmega328 (the main clock engine and state machine manager)
  • ATtiny25 (melody/tone generator)
cunning lance
#

ah

#

atmega

#

nice nice

cunning lance
#

so, are you programming it using arduino only

#

or esp?

dusk light
#

I use only C++ and my own framework.

cunning lance
#

oh cool

dusk light
#

I haven't touched ESP yet.

cunning lance
#

hmmm

#

whats your age btw, and how long have you been working with microcontrollers?

#

just asking for reference

#

i am 26 and i have completed my graduation from MIT

dusk light
#

I generally don't disclose that information 😉
Just know that I grew up in a time internet didn't exist yet.

cunning lance
#

older than me at least 🤣🤣

cunning lance
#

so, have you worked with Arduinos and ESPs yet?

#

like the projects which make you soooo irritated and exhausted?

#

because, during my college time, i tried making a home automation system, and it took me 2 semesters to complete it

#

but i could sell it and earn more than $400

dusk light
#

I have worked with Arduino (I suppose you mean the microcontroller board and the IDE).

cunning lance
#

yea

#

i started working with microcontrollers when i was 12

dusk light
cunning lance
#

hmmm

cunning lance
#

but my peers made it simple and easy so they could complete it within 3 months

#

i was using machine learning to understand behavorial complexions

#

and various hi-fi technological systems and components

#

so it took me a lot of time

#

the most useful topic for me to know was the PID controller system

#

Proportional Integral Derivative

#

it was little confusing, but slowly as i got hold on it, it became really easy and fun...

dusk light
#

Good 🙂

#

It is indeed not that easy to understand at first.

twin skiff
#

UART / Fingerprint Sensor not working by Simple Test

#

Out of my depth here. Trying to connect the RPi to a fingerprint sensor. Tested some code which didn't work. Tried to connect the 2 UART pins together (GPIO 14 and 15) and gives me a blank response. Even if I connect the fingerprint sensor on those pins, I get a blank response.

fallow plinth
#

!cban 996271968179462205 This server is not the place to advertise your tiktok account.

hasty zealotBOT
#

:incoming_envelope: :ok_hand: applied ban to @quasi cobalt permanently.

jolly light
#

I have a question, if i were making a project that needed to 1. connect to the internet, 2. display things on a screen, and 3. be compatable with some other hard ware what computer would i use. a rasp pi?

jolly light
#

Then for what im displaying on the screen which is basically a big menu i would want it to be like hard inside the rasp pi so would i have to make my own pi distro?

#

Cause i dont want to have to turn it on and then run my program to display whats on the screen i just want to be able to turn it on and it will open to what i want to display

true cradle
jolly light
jolly light
#

Oh wait

jolly light
true cradle
#

u can look into micropython but you are probably better off just running normal cpp code its much easier with amount of examples available online

elfin sphinx
dusk light
# twin skiff

Do you have an oscilloscope to confirm there's a pulse train output from the assigned Tx pin?

#

And what RPi are we talking about? RP2040? Or SBC version 1-5?

#

Finally /dev/ttyAMA10 looks weird. Are you sure that peripheral is correct? On SBC Raspberry Pi boards, /dev/ttyAMA0 (not /dev/ttyAMA10) is the debugging console. You may want to double check that device name.

cloud hinge
jolly light
#

yeah i got a tft screen for it and the bluetooth, price was my main reason

elfin sphinx
cloud hinge
#

@elfin sphinx options are always good, what do you recomend?

elfin sphinx
cunning lance
tulip hollow
dull hatch
#

Best starter kit and tools for building microcontrollers. Id like to practice with wifi chips and implementing Python code to automate something simple on a rc car.

winged sky
#

For Wifi, use the esp32

hallow igloo
#

Anyone have a discord server for microcontrollers, coding, robotics and AI stuff? I need to find communities that share my interests

hearty flower
#

Can anyone tell me how can i get a precise 1 microsec delay in python on RPI zero 2w, I have tried time.sleep() but it is highly inaccurate.

hallow igloo
# hearty flower Can anyone tell me how can i get a precise 1 microsec delay in python on RPI zer...

What is the problem you are trying to solve? Python is inherently non deterministic when it comes to super accurate timing. GC languages struggle with it. There are probably some ways around it, but there is always a chance the GC will start or something will lock the GIL and you will miss your timing window.

There is also an element of OS/cpu scheduler tolerance. It is really hard to guarantee that you are going to be getting all of the cycles on a given core for your entire runtime. If the OS decides to give some cycles away to another program you could miss your timing and python can’t do anything about it.

There are entire specialized operating systems that guarantee execution determinism. Linux, windows, and Mac are not those.

#

That being said there are things you can do to help get close to the timing, but I’m not sure if you will ever be 100% sure of hitting it within idk, 1%.

errant wigeon
# hearty flower Can anyone tell me how can i get a precise 1 microsec delay in python on RPI zer...

As KalaldinCodes pointed out, perfect precision isn't going to really work. So depending on what you're aiming for micro/circuit python might not be what you need, you might need to look for a real time operating system (rtos)
https://forums.freertos.org/t/using-freertos-with-the-raspberry-pi-pico-blog-series/16497

if perfect isn't as necessary, something similar might be doable but because your level of precision is so small, a microsecond, it might not be possible at all in circuit python. A single line of code could take more than a microsecond to fully complete.
To maintain a constant frequency (at lets say, a few milliseconds/seconds level) you could approach it like this: get a timestamp, do your operation, take a new timestamp, and then sleep for the your period delay minus your time spent in the operation

time.monotonic_ns()
will return an int, but because the microcontrollers don't have huge bits of precision for floats, you'll need to be careful about how you use it. It'll be best to take your stop time minus your start time, then divide that number by 10^9 to turn it into a float. if the number is small enough though, you'll end up with an underflow error and you'll just get a command to sleep for 0 seconds

main nacelle
#

May I ask a question?

cloud hinge
main nacelle
#

Is a raspberry or Arduino better for microcontrols any censor use

cloud hinge
elfin sphinx
# main nacelle Is a raspberry or Arduino better for microcontrols any censor use

both can talk to a variety of sensors , which one of the two is suited for your project depends on the project
so you should t ell us more aobut the project

in general , raspberry pi is basically a whole computer shrunk down , whereas arduino is something of much much much low power made to talk to sensor and control stuff

#

so if all you do is read some simple sensor data , you dont really need the rpi's computing power , arduino can do it just fine as well
you would be wasting performance and money and power if you used rpi

main nacelle
#

It's supposed to be for a hexapod

elfin sphinx
main nacelle
#

camra tilt and tempetuer sensors

cloud hinge
# main nacelle It's supposed to be for a hexapod

I hope to build the hexapod too one day, that thing is super futuristic, the control menus are top notch too. Great project! The amount of movement in each leg is like nothing I've seen in any other robot yet

near drift
#

If I wanted to create an LED matrix powered by python, is it a bad idea to buy a matrix from aliexpress rather than an adafruit one?

#

I'm worried about python library support that will power this project

#

adafruit seems to have some tools figured out and i dont want to be stuck in the mud by buying a cheaper alibaba led matrix

cloud hinge
#

What's everyone's favorite projects these days? DIY 24 channel pico logic analyzer looks promising

jolly light
#

Right now I have a DFPlayerMini hooked up to my ESP32-s3 and a speaker and I can play audio with it when I put audio on the sd card. I was wondering if It would be possible to somehow be able to upload audio to the sd card from the ESP32 so I don't have to unplug it plug it in my computer and upload files. The ESP32 would just write to the SD card and the DFPlayerMini would be able to play the added files and all.

gleaming sky
jolly light
elfin sphinx
# jolly light Right now I have a DFPlayerMini hooked up to my ESP32-s3 and a speaker and I can...

short answer is , no

you cant write to a SD card that is plugged into the dfplayer module from ESP32

the long answer is , maybe
if you really want to stick to using dfplayer module, then
like , instead of plugging the card directly into the df player board , what you can do is , solder wires to a simple SD card module used to communicate to a microcontroller , plug your SD card into that , then design some sort of switching circuit using mosfets or smth similar that switches the SD card between the ESP32 and the dfplayer board

so when ESP32 wants to write files to it , the switching circuit will break the connections between df player module and the sd card and make connections between the SD card and ESP32 and vice versa

and this is exteramly complicated for no reason

like ,if you are at that stage , you might as well use the SD card directly with ESP32 and use some sort of I2S amplifier to play sound

also there is always the big question of , where is ESP32 getting the files from ?? if you have to plug your ESP32 into something to upload files , you might asw well just unplug the Sd card and use that

cloud hinge
jolly light
jolly light
cloud hinge
# jolly light Well the esp32 dac is insanely weak

External 16bit dac with 12c or 12s. Also ota is built into arduino ide. Its possible the project has been done on github I'm guessing but I'm not sure. I been working with bluetooth source and sink codes, was able to send .mp3 from one esp32 to bt speaker but it was 8bit and super slowed down. I wasn't able to get it to play at the correct speed with built in esp32 dac but suspect a better external dac would be easier to work with. That's a similar but different project but from what Ive noticed it's not having the external dac that holds many projects back for esp32

jolly light
dusk light
jolly light
#

especially with ble

jolly light
dusk light
#

lol

#

So you want to use something else but don't know why you would have to?

#

Why not just start with what you have and see/check if you're happy with it?

jolly light
#

idk

#

possibly i can just use a rasp pi to make everything easier

dusk light
#

Why would it be easier with a Raspberry Pi? Actually this would be the exact opposite: there's no DAC in that beast, unlike the ESP32, which has two and makes it possible for stereo.

jolly light
dusk light
jolly light
#

let me just write what im looking for

#

actually wait

#

i dont think a esp32 would work for this

jolly light
dusk light
#

What do you want, exactly? We can't guide you unless you're 100% clear about that 🙂

jolly light
#

sorry

#

I want to download a mp3 with a library called pytube and I want to stream that mp3 audio over bluetooth or through a headphone jack

dusk light
#

BT and a headphone jack are two completely different and unrelated implementations...

#

the former being the most complex among the two.

jolly light
#

But i dont think pytube would even work

dusk light
#

You need a pretty beefy computer to run that

jolly light
#

due to all its dependencies and micropython and the esp32 capabilites

jolly light
dusk light
#

Maybe

#

But since you seem to have a computer for typing here on Discord, doesn't that fit your requirement?

#

Doesn't it have a bluetooth link so that you can test your project?

jolly light
#

first time doing something like this

#

thats not all entirerly software

dusk light
#

Not just "MP3", correct?

jolly light
dusk light
#

Technically youtube is a streaming service, so yes you're streaming in, not out (just yet).

dusk light
#

From pytube description (https://pytube.io/en/latest/):

pytube is a lightweight, Pythonic, dependency-free, library (and command-line utility) for downloading YouTube Videos.
So it's unrelated to MP3, really. Maybe you can convert audio stream to MP3 but then you need to read the documentation further as to how to do that.

#

Besides there's no mention of MP3, only MP4:

jolly light
#

ive used it before

#

you can download the streams

#

including a mp3 stream

dusk light
#

I don't know what you've done but there's no mention of the term "MP3" on the documentation page. That you can fact check on your own.

jolly light
#

but we have establshied that this couldnt be done on a esp?

dusk light
#

That's step zero indeed.

jolly light
dusk light
#

It is not

jolly light
#

especially with all its dependencies

dusk light
#

It's not about dependencies, it's about the required computational power.

#

Stripping youtube streams from all the garbage Google sticks to it requires a heck of a lot of processing, which the ESP is not up to, in a timely fashion.

#

BTW YT terms of service prohibit you from doing what you want.

#

(that's the usual disclaimer)

jolly light
#

or what im doing?

dusk light
#

One is not allowed to download any content from youtube other than with a browser and from the web page contents is available. IANAL though.

dusk light
#

It doesn't comply with YT terms of service.

#

But that doesn't prevent projects such as yt-dlp, youtube-dl or pytube obviously.

jolly light
#

they would get in trouble before me

#

and its not like im making something and pushing it into production

dusk light
#

Your duty is to read terms of service to get to know exactly if/how you're at risk. You're supposed to know. And me to warn you as well, just in case. But that's your responsibility in the end right 😉

jolly light
#

Thanks so much for the help

#

I have a much clearer vision of what im working on]

#

thanks!

dusk light
#

np

#

Quoting Ali Diamond on Hak5: «Good luck, have fun and don't get caught» 😉

jolly light
#

will do 👍

cloud hinge
#

@jolly light ok, I thought u needed mp3 file to play on speaker clearly and be able to update mp3 library only, I'm not sure about any of the youtube mp3 downloading to esp32 or streaming. Maybe gpt can help you brainstorm on how to do it and stay compliant. I think it's a cool idea but i dont know a lot about python. I'm better with c++. Seems like youtube would want something like that if it included there commercials but perhaps it could be the opposite as well.

jolly light
#

well i think im gonna use a rasp pi

jolly light
cloud hinge
#

I'm not qualified to answer that

elfin sphinx
# cloud hinge So making your own esp32 player with dac and sd card holder to get digital sound...

updating files in SD card over wifi uploading is def possible , i have done a project based on that previously
it was basically a wireless SD card reader , the ESP32 creates a webpage where we can see all the contents of SD card , so you can upload files to SD card and you can download files that are already on SD card
i need to look up the git repo to be more specific about how i did it but its def possible

elfin sphinx
# jolly light but wouldnbt a external dac complicate things more like what saul goodman said

external dac module will actually make things a little complicated but it will give you full control over everything happening , because you have full control over how the audio module behaves and you have full access to SD card bcoz it will be controlled by ESP32 , not the MP3 module itself

https://www.youtube.com/watch?v=m-MPBjScNRk
i highly suggest watching this video bcoz it shows you what i2s is and how you can easily use external I2S amplifier module along with SD card to play media

Build an Internet Radio, an MP3 Player, and display microphone waveforms with an ESP32 and some I2S peripherals. Learn to use the I2S sound protocol with the ESP32.

Article with code: https://dronebotworkshop.com/esp32-i2s
More articles and tutorials: https://dronebotworkshop.com
Join the conversation on the forum: https://forum.dronebotworksho...

▶ Play video
elfin sphinx
elfin sphinx
elfin sphinx
#

and unless you are a C++ pro , i highly suggest stickign to python for this project coz its much more easier to do in python

elfin sphinx
# jolly light well i think im gonna use a rasp pi

given your case , i think that is the correct option

i assume you have a display attached to your raspberry pi to allow people to play what they want ??

as for the audio , you can get one of those GPIO hats for raspberry pi to act as DAC
otherwise ,if you are going to use a HDMI dispaly , then those usually have a 3.5mm jack as audio output which you can use with an amplifier to get audio output
there is also the option of using a cheap USB soudcard module that also has a 3.5mm output jack

there is a lot of options it all comes down what you want in your specific case

#

but downloading mp3 from youtube and then playing it to just listen to some songs sounds inefficient

you might wanna look into spotify plaback on raspberry pi tbh

#

https://www.youtube.com/watch?v=ZxdhG1OhVng look at this video for example

Follow me on twitter: https://twitter.com/gvy_dvpont
Support this channel (thank you!): https://www.buymeacoffee.com/guydupont
Email: gvy.dvpont@gmail.com

PART 2 HERE: https://youtu.be/q0pUPab7Rms
^ I answer FAQ's, show hardware upgrades (cough headphone jack, usb-c cough), and demo some gaming.

RE: The high pitched noise - SORRY! I though...

▶ Play video
jolly light
elfin sphinx
jolly light
elfin sphinx
#

also , for streaming music, i would try and use a dedicated music streaming service

elfin sphinx
elfin sphinx
# jolly light For legal purposes?

no , for convinience

bcoz for something like youtube, how would you know which song you are playing , there could exist videos with same title name but like totally different actual audio

there might not be audio that u want
there could also be random stuff added into audio
it could play the "video version" of the song ( a lot of songs have a different video version and a different audio version )

also its easier to pull up album info , artist info and all with a streaming service

#

i mean , the "legal reasons" really come into play strongly if you try to distribute your proiduct to lot of people

for personal usage , youtube isnt really gonna come after you with a legal case or smth

jolly light
jolly light
jolly light
elfin sphinx
#

lets say for example yo uwanted to play "we dont talk anymore "

the official music video has a 2-3 second random noise before starting
but the spotify version is the correct "audio" version
https://www.youtube.com/watch?v=3AtDnEC4zak
https://open.spotify.com/track/06KyNuuMOX1ROXRhj787tj

this is just an example , there is lot of stuff like this , where the actual song differes from music video

also with something liek spotify , you get access to playlists , made by you as well as made by other people , or spotify , that way you can discover new music as well

#

the final decision is obv yours , i was just pointing out the differences in the two approaches

#

if you know you are gonna listen to the same fixed set of songs and maybe add new songs occasinally , then you can use a diy streaming service like navidrome , that is what i use at least. Its basically like "make your own spotify" (minus the cool features like aut generated playlist and all that spotify has)

jolly light
cloud hinge
half junco
#
from pyfirmata import Arduino
import pyfirmata
import time

import pyfirmata.util

port = "COM3"
board = Arduino(port)

pin = board.get_pin("a:0:i")

it = pyfirmata.util.Iterator(board)
it.start()

while True:
    analog_value = pin.read()
    print(analog_value)
    time.sleep(0.1)
#

ok

#

so im trying to read a potentiometer

#

it keeps giving me errors

#

its driving me insane

cloud hinge
half junco
#

pls help, its pyfirmata for arduino bttw

half junco
#

ok so i gave up

#

decided to use pyfirmata2

#

documentation is lovely and for the first time, i was understanding the doc

limber field
#

Is that you playing the piano ? @half junco

half junco
#

are you refering to my yt?

#

then yes

#

that was me 2 years ago

#

i don't play anymore

clear bone
#

I missed this thread.. Just saw this, seems to be relevant. (I also posted in data&AI, sorry).. Check this new NVIDIA OUT!!
https://www.youtube.com/watch?v=QHBr8hekCzg

FREE GIVEAWAY OF JENSEN-HUANG-SIGNED ORIN NANO SUPER! See Below!
Join Dave as he explores NVIDIA's Jetson Orin Nano Super, a compact AI powerhouse with 1024 CUDA cores and 6 ARM cores for just $249. Learn why this could be the best AI board for your projects in robotics, IoT, or AI development. Free Sample of my Book on the Spectrum: https://a...

▶ Play video
dusk light
#

I don't think this relates to microcontrollers, let alone Python in general...

tranquil robin
#

Hey. I use pyboard with micropython and tried last 2 hours to get some key values that are behind the keypresses. I got some from dumpkeys, I got keycodes and scancodes from showkey and a lot more which confused me a lot. But I didn't really think about wether I need this code.

So my question is, if my pyboard should be use as a wireless keyboard, do I need know some values for emulate keypresses or does a library already this?

cloud hinge
#

https://youtu.be/N9f_ElWeNF0 this launcher works great, was wondering what everyone's best thoughts on how this proccess could be done similar to load from sd card without screen. Maybe a button that associates with program that's wanted needed by number needed to install from sd card

The bmorcelli CYD Launcher is a versatile tool for Esp32 2432S028 (cheap yellow display) users. It simplifies application management by allowing you to launch applications stored on an SD card, eliminating the need to reflash your device for each new application.
Key Features:

  • SD Card App Launcher: This is the core function, enabling you to e...
▶ Play video
cloud hinge
# tranquil robin Hey. I use pyboard with micropython and tried last 2 hours to get some key value...

I used this code as my base for a bluetooth keyboard. It's not python but maybe it might have some help on the scan codes. I had to marry this code with another scan code library to make it mostly work. I wish I could help more with python but I'm not versed enough yet. https://github.com/T-vK/ESP32-BLE-Keyboard married to this code https://github.com/fdivitto/FabGL . I'm sure there is a easier way but it's how I got it working and lots of info and the fabgl to help. Not sure if scan codes work in python but it kinda shows the framework

GitHub

Bluetooth LE Keyboard library for the ESP32 (Arduino IDE compatible) - T-vK/ESP32-BLE-Keyboard

GitHub

ESP32 Display Controller (VGA, PAL/NTSC Color Composite, SSD1306, ST7789, ILI9341), PS/2 Mouse and Keyboard Controller, Graphics Library, Sound Engine, Game Engine and ANSI/VT Terminal - fdivitto/F...

#

@tranquil robin if u would like my code I made of those combine I can provide that too

tranquil robin
#

Are scancodes / keycodes standardized?

cloud hinge
tranquil robin
#

So I understand is that keyboards sends scancodes and the OS has a file somewhere that matchs scancodes to keycodes

cloud hinge
cloud hinge
tranquil robin
#

Is 0x6b also k by your project?

cloud hinge
cloud hinge
tranquil robin
#

@cloud hinge I got. I can send my pyboard any input from the my phone (Serial bluetooth app) and it emulate a keypress. Now I just have to find out what hexadecimal codes my OS uses.

#

I will make a github repo later for this project

cloud hinge
tranquil robin
#

PopOS, is an ubuntu OS based OS

#

I found out that I use the REPORT FORMAT that is explains by osdev.com and I have already check every hexadecimal number I can send to the OS.

#

The strange is that after hexadecimal version of 93 of the "emulated Keypresses" does nothing

tranquil robin
cloud hinge
tranquil robin
#

I guess this is a pyboard / firmware thing. So I prepared pyboard for this inputs, but not for system Inputs like "Sleep".

#

Keyboards are definitely more complex than I thought

edgy oyster
#

I'm engineer, is there anything I can do?

elfin sphinx
valid jackal
#

@hollow coral check ur dm

clear bone
#

I have a python script that feeds an arduino data from a wss feed so it can display crypto prices on the LCD display in ticker fashion. The problem is that, as far as I can tell, the python script is working fine and feeding data to the arduino as the rx light flashes every time the script output shows a priceupdate on in the terminal output. I can't run the "serial monitor" on the arduino IDE because my python script is currently using the COM3 port to feed it data. This is preventing me from using any breadcrumbs etc to try to figure out why the LD isn't displaying. I'm not entirely sure my python is sending the data in a format the Arduino can handle. I'm stuck.
https://paste.pythondiscord.com/M3SA

dusk light
#

If I understand you correctly, you'd like to debug-print from your Arduino (which I assume is a Uno R3) to your computer, while the latter is feeding the former with data, correct?
If so, there's nothing you can do, there's only one UART available on an ATmega328. There are alternatives though.

  • If you have a Mega2560, for instance, you may want to test your sketch on that one as a temporary platform.
  • If you have a USB/SPI bridge/adapter, then you might communicate with your Arduino Uno R3 using SPI, not the UART, which will then be freed for use with the serial monitor. However that implies refactoring the communication protocol, so as to send data in binary form, for instance, which is more practical for that transmission method.
clear bone
# dusk light If I understand you correctly, you'd like to debug-print from your Arduino (whic...

Well,.yes, I would like to be able to, but that's secondary to just making it work so if there's another way to monitor it like through the terminal window? I just got the Arduino for Xmas so I'm extremely green on it, although I program a little c++ it was just enough to get into trouble. The LCD works as it should with the sample test sketch. Yes Arduino Uno (Man I really know better than to leave that part out, sorry about that). It's close. I left a paste bin so someone might look at the code. It's not long or elaborate.
I'm guessing I will change it to feed from a list instead of a direct stream and I can push the ticker ticks to the list, then I can start with a message on the list as a prime. If I can get that to print, the rest "should" too. The final goal being a small portable ticker device. Both of these posts were right as I went to bed/woke up so clarity is still powering up.
THANK YOU!!

dusk light
#

I'm afraid I cannot see other ways to monitor your board other than the alternatives I suggested.

#

At least not without defining a more elaborate exchange protocol, which would distinguish between raw data and information.

#

The concept is similar to OSI network layers. You would need only two of them: data and debug.

#

The third one (the hardware layer) is implied and is handled by the Arduino library in the form of Serial.print() and the like.

clear bone
clear bone
#

Think I found it. I had the display set up for one library and then I used a different library not realizing it hooks to the Arduino differently. Still working on it. Thank You for your help.

sharp tinsel
#

which library is best for pico pi /

tight briar
#

anyone have some favorite kits they could recommend

low trellis
#

Why do you need

lethal elm
#

can you use python language for arduinos

clear bone
# lethal elm can you use python language for arduinos

As I understand it, only on some. Not the UNO R3 though (that I have been able to find so far). For my project (crypto ticker) I am using Python on a PC to get the WSS feed and send it to the Arduino (R3) via USB cable on COM3. Not really disimmilar to this video:
https://www.youtube.com/watch?v=UeybhVFqoeg

Check out my follow up video 'How to Make GUIs in Python for Arduino' Here! https://www.youtube.com/watch?v=Z4eUlQnh3sc

Controlling an Arduino from Python could be super useful for a wide variety of applications and using the serial control method we can easily do this in just a few lines of code! All code in both python and the Arduino IDE nee...

▶ Play video
#

So that's not really running Python ON an Arduino, just controlling it with Python.

spiral sandal
errant shell
errant shell
tranquil robin
#

I had an syntax error but the error was showing on ttyACM1

#

Hey I need help with micropython:

I got this error:

pyboard reveived (from HC-06 module):

b'W\xf5\xfd\xfd\xf3\xfd\xfd\xfd\xfd\xfdW\xf5\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd'
Traceback (most recent call last):
  File "main.py", line 71, in <module>
IndexError: tuple index out of range
MicroPython v1.23.0 on 2024-06-02; PYBLITEv1.0 with STM32F411RE

The code:

from pyb import UART, LED, delay, Pin
import pyb
import struct

# UART initialisieren
uart = UART(1, 9600)
uart.init(9600, bits=8, parity=None, stop=1)

# USB HID Setup
hid = pyb.USB_HID()

# Variablen
led = LED(4)

# XOR Schlüssel
XOR_KEY = 0xFF - 0x02  # Beispiel-Schlüssel

# XOR-Verschlüsselungsfunktion
def xor_decrypt(data, key):
    return bytes([b ^ key for b in data])

# Dictionary mit Key-Zuordnungen (Dezimal zu Hexadezimal und Namen)
key_map = {....14: {'hex': 0x0E, 'name': 'KEY_K'},  ....}

# HID-Sende-Funktion
def send_hid_key(modifier, keycode):
    hid.send(struct.pack('BBBBBBBB', modifier, 0x00, keycode, 0x00, 0x00, 0x00, 0x00, 0x00))
    delay(50)
    hid.send(struct.pack('BBBBBBBB', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))  # Release Key

# Hauptschleife
while True:
    print(uart.any())
    delay(50)
    if uart.any():
        received_data = uart.read()
        print(received_data)
        delay(50)
        if received_data:
            decrypted_data = xor_decrypt(received_data, XOR_KEY)
            command = struct.unpack('B', decrypted_data)[2]  # Entpacke Byte zu Integer

            print("Empfangen:", command)
            if command in key_map:
                led.on()
                keycode = key_map[command]['hex']
                send_hid_key(0x00, keycode)
                led.off()
            else:
                print("Ungültiger Befehl:", command)
    delay(100)

errant shell
tranquil robin
clear bone
#

Whoot! Finally getting the crypto ticker working!

#

So what I'm looking for is a microcontroller, that can run python, access public wifi and run the lcd, the size of a keychain. This one here runs python and drives the data (a WSS eed) from a the computer and the arduino just displays the data.

clear bone
hasty pewter
# clear bone

Does it use Wi-Fi to get current prices on the crypto market

hasty pewter
clear bone
clear bone
#

I'm having a problem with my Arduino code (it is fed by my Python script). Is it ok to ask an Arduino question here (It pertains to my python script functioning properly)

#

Well here it goes. Let me know if not ok and I'll delete it.

// Scroll the price message if it exceeds the screen width
if (priceMessage.length() > lcdWidth) {
unsigned long currentTime = millis();
if (currentTime - lastScrollTime >= scrollInterval) {
lastScrollTime = currentTime;

  // Clear the bottom line and display the scrolling portion of the price message
  lcd.setCursor(0, 1);
  lcd.print(priceMessage.substring(scrollPosition, scrollPosition + lcdWidth));

  // Increment the scroll position
  scrollPosition++;
  if (scrollPosition > priceMessage.length() - lcdWidth) {
    scrollPosition = 0; // Reset to the start of the price message
  }
}

} else {
// Display the full price message if it fits on the bottom line
lcd.setCursor(0, 1);
lcd.print(priceMessage);
}
}

#

This is an "if" but I want to change it to just do it.

main nacelle
#

Can ai run on a raspberry pi?

errant wigeon
# clear bone I'm having a problem with my Arduino code (it is fed by my Python script). Is it...

Yes, this channel frequently spans embedded languages, python, and embedded linux devices. You can check the pinned messages for a lot of info by the way, but you are welcome to ask this kind of question. Arduion c, embedded c, and micro and circuit python are the most common languages that folks here have some familiarity with, as you move away from it into other languages you'll have a smaller chance of finding folks who can help who are also here, but you are welcome to ask. From time to time folks will direct you to other servers that might have more people who are able to help as well

errant wigeon
errant wigeon
# main nacelle Can ai run on a raspberry pi?

Kind of--it depends on how big of a model you want to run. But there are a lot of raspberry pi, machine learning projects out there. It can't handle the biggest ollama model, but it can still do quite a bit. To help much more it would be good to know what you want to run. AI is a very broad term, and usually it's just a term people use for advertisement. If I told you "AI is really just three if statements in a linear approximation of a trench coat", it wouldn't have the same appeal. But that's what "AI" usually is under the hood.

main nacelle
# errant wigeon Kind of--it depends on how big of a model you want to run. But there are a lot o...

I wanted it to encode and be able to tell me what I'm doing wrong if I'm working on a craft project I'm going to be playing them into some steampunk goggles I want to know what I could use for raspberry pi so I don't have it running on my mean system constantly like I'm system in a box somewhere else and it means in censor data through Bluetooth or even broadcasting it almost like a radio and it would broadcast data back on what needs to get done sorry

errant wigeon
#

That is a very big project.
Breaking it down,
what do you mean by if you're doing a craft project wrong? Is there an example of the craft project?

main nacelle
errant wigeon
main nacelle
#

I'm part of skilled training and I wanted to make some goggles that allowed me to at least know what I'm working with what temperature I'm using when I'm doing something like forging or even braiding telling me how much time has passed and when I should possibly check up on it sorry

errant wigeon
#

Ok if it's that specific, then we can break down the project some
first, what's the hottest the metal gets to?

#

or the forge?

#

also are you wearing a mask, like a welders mask while dealing with it?

main nacelle
#

Something that looks like steampunk goggles

errant wigeon
#

Projects like these: https://hackaday.com/blog/?s=ar+glasses
are a good place to get a sense of diy ar glasses. They're all easy, and the easy ones are not all that great, but you can kind of do some things with it.

I'm going to use https://www.adafruit.com/product/4469 eventually for a stove top sensor project. It has some limitations (the max temp is 300C which is below metal melting points so it's too low for your use case) but the idea is to do a pass of feature identification: https://scikit-learn.org/1.5/modules/feature_extraction.html and https://scikit-image.org/docs/stable/auto_examples/features_detection/index.html then use that to track the temperature of specific objects over time as I move it on the stove.

Other issues are that reflective, metal surfaces will not show their temperature but act like mirror to the camera, so they'll display the temperature of objects near then.

Once you have the object mapped, you can track the temperature over time and see how long it's been heating, at a temperature, or cooling and display timers etc as needed

clear bone
#

Tonight's ticker progress

elfin sphinx
# main nacelle Something that looks like steampunk goggles

I would say first make the AI on your computer which you want
then think about putting it on the pi

its not easy to make a generic AI that can just tell you if you are doing something wrong when making something as the scope is insanely broad

if you want the AI to do a specific task like observe the temprature doesnt go too far or smth then thats possible
but a generic AI that can tell you if you are doing something wrong is very hard

at any rate , dont think about the pi or uptting it in goggles. Firstly make the AI that you want on your PC , then once you do that , you will have good estimate about the resources it will consume then you can decide if a pi; is even suitable candidate for your project or not

clear bone
#

Anyon here using VSC to program their Arduino?

hardy falcon
#

Anyone try the new ESP32-S3 + Openai Real time Api integration? The SDK is open sourced, But the ESP32-S3 they used has embedded mic and speakers on the chip itself. Wondering If any of yall know alternatives to adding speakers and mics that are small to a normal ESP32-S3.

elfin sphinx
clear bone
# elfin sphinx yes

OK, cool!. I've installed 3 of the extensions and haven't found a way to upload yet. Care to share what extension you use? All the searches say to use the "microsoft" extension, alas, haven't found one yet.

broken lodge
#

how can i use micropython, when i plug in my esp32 to flash the custom firmware, some weird stuff happens with the ports and it goes under unknown devices in device manager and i dont know how to accesss the port in cmd to flash the firmware

spiral sandal
#

if marking is erased on the chip, check the usb vid/pid in device manager system info boxes/tabs and google for them

#

sidenote some counterfeit chips work way better on linux

elfin sphinx
broken lodge
elfin sphinx
broken lodge
#

ok

elfin sphinx
#

show us and explain to us what happens when you plug in your ESP32 board

explain this "weird behaviour with ports"

#

also , which ESP32 do you have ?

#

i want to see the USB to Serial chip on it

#

it will either be CH340 or CP2102

#

and you will need to install drivers for the one you have if you havent done that already

broken lodge
#

wroom kit thingy, also its too late rn, im not going go and dig for it in my tech bin, its ch340

#

wroom32

elfin sphinx
#

aight , then install the drivers for it

broken lodge
#

kay

elfin sphinx
#

here is a link if you need help with it

#

after that is done , if the issue still is there , explain to us what happens

broken lodge
#

ok, probably tommorow because rn its too late for me too get it out of my tech bin

#

also the sparkfun guide is preety confusing because the board they use is not esp32

spiral sandal
#

does not matter the serial chip is separate from the esp*

broken lodge
#

what? so i had to buy a seperate chip?

elfin sphinx
#

just
install
the
drivers

spiral sandal
#

and maybe reboot

broken lodge
#

ok

elfin sphinx
#

you dont even need to have your board plugged in to install it fwiw

broken lodge
#

my sleepy brain is really confused rn ill do it tmrw

dusk abyss
#

I have a fastapi application which uses llms to generate streaming responses(chat bot) . It works fine on corp network, but if i use my home network it doesnt give response in streaming manner. Does anyone have an idea about this? Anyone who worked on streaming with fastapi?

round hedge
#

Can we discuss BADUSB projects?

#

Im making a rickroll

errant wigeon
# round hedge Can we discuss BADUSB projects?

Kind of but not really. Rubber duckies and hid type projects are fine, but when it's aimed at someone else it begins to cross the line. You're welcome to ask about hid type projects, we just can't help if some third party is the focus of the project

errant wigeon
#

That's kind of not really a rick roll then.

#

What technology and libraries are you using? Maybe I could point you elsewhere where you'd be able to get more help

round hedge
#

Yeah, well I get lonely

errant wigeon
#

Look, you know the rules and so do I
this project in its current form is too close to being disallowed

round hedge
#

Aight

open fox
# dusk abyss I have a fastapi application which uses llms to generate streaming responses(cha...

https://stackoverflow.com/a/75851218/819417

from fastapi import FastAPI
from fastapi.responses import StreamingResponse
from langchain.llms import OpenAI


llm = OpenAI(
    streaming=True,
    verbose=True,
    temperature=0,
)

app = FastAPI()


def chat_gpt_streamer(query: str):
    for resp in llm.stream(query):
        yield resp["choices"][0]["text"]


@app.get('/streaming/ask')
async def main(query: str):
    return StreamingResponse(chat_gpt_streamer(query), media_type='text/event-stream')

if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=8000, log_level="debug")
velvet copper
clear bone
# velvet copper this looks pretty

Thanks! I've been sourcing parts to build a small batch of desktop Crypto scrollers. I am currently looking at nano versions but I'm pretty new to arduinos. I've seen small Raspberry Pi's that can run micropython. This is driven by python on a computer pumping the data through the com port. I want it to all run local so they just plug it into a usb hub and it just works after they put their variables in (coin, country) I only have an UNO R3 currently.

clear bone
#

Seems like cost being the same, I could run micropython on a $5 arduino or a raspberry pi. Anyone here have a preference?

elfin sphinx
#

and what do you need it for ?

#

board selection depends on the project

elfin sphinx
#

and they are magnitutdes better and faster than arduino uno or nano or mega

clear bone
#

With the one I've made so far, it gets the data from the com3, that's being sent from my python script running. I want to have python locally so it's only really getting power from the usb

#

Can I access internet wss feeds through a com3 connection or should I use something wifi enabled?

#

Still looking, that's why I'm asking!

elfin sphinx
elfin sphinx
#

look into ESP32

they have all u want
they have wifi , they are powerful, they can work with your display , they have micropython support

clear bone
elfin sphinx
elfin sphinx
jolly ocean
#

nb

#

nb

lavish turret
#

?

elfin sphinx
#

<@&831776746206265384>

somber fox
elfin sphinx
covert summit
#

I recently got my hands on a Flipper, and installed extreme on it.

#

I noticed the installer was written in python which I thought was cool.

#

Now I can PWN the world.

vapid badger
#

Nice 👍

#

I need to charge mine and play around with it again

covert summit
#

I hope to use it as a robot brain using I2C sometime.

#

I can't use I2C and wifi at the same time though... Hmm. I'm gonna have to read up on this.

#

Maybe I make my own custom board for the flipper?

limber field
#

ohh , thats cool @covert summit

bleak locust
#

I need an algorithm to denoise accelerometer data that's streamed from my phone
the accelerometer is pretty accurate after phyphox's filter, has a

  • noise of about ±0.02m/s²
  • frequency of 250+hz
  • latency of about 1 to 5ms

the data is used to control the cursor, the issue is that small deviations already cause huge amounts of drift over time, does anyone have experiences with this?

#

I can provide my code, it has a few draft functions that all have either one of these issues:

  • cursor moves back after you stop
  • cursor is shaky
  • velocity is messed up when acceleration is relatively constant

the main limitation is that the algorithms have to be able to polish the data in real time

true cradle
#

u might need some form of controller similar to a pid

stiff quest
#

Higher end systems sometimes have two accelerometers, a high-g accelerometer for shock filtering and a normal one. This way you can apply specialised filters to get high quality position tracking.

bleak locust
bronze mural
limber field
#

Great show @bronze mural

thin pulsar
#

Does anyone know of a lightweight web panel for raspberry pi? Preferably similar asphetics to ptero panel, but that's not a crucial

dark trout
bitter swallow
#

some interesting ideas to do with microcontrollers?

spiral sandal
bitter swallow
#

that's interesting

mortal vine
#

Hello everyone this is my first message.
I need some help on a project of mine I'am trying to get a 64x128 pixels led matrix to work with python. I'am using the hzeller library. but when i want to run code in the in the virtual enviroment the library tells me to run it in root(raspberry pi3), then i try sudo and all the packages that i have installed wont work obviously because i'am running it on root.

hallow igloo
#

How do make you make your microcontroller (raspberry pi pico w) act as a HID but be undetected to things like anticheats or other software? Not for anything nefarious.

rugged sonnet
#

Unless your doing something weird already

warped sage
hallow igloo
#

im probably going to make the pico act as a usb sheild hub

barren island
median venture
#

also would this double as a mechatronics server or should i just look for another discord

fast wagon
#

hey guys, if i want to get into embedded systems, specifically object detection with drones, what should i have learnt before?

hallow igloo
wraith helm
#

goodday, so I have this "project set: Fysetc Voron Rok Hot Key Pcb Botton Mod" and I want to make it "simple" numpad sized keyboard.
after I opend the "boots"
UF2 Bootloader v3.0
Model: Raspberry Pi RP2
Board-ID: RPI-RP2

so far no code worked (basic first time codes)
also ask chat gp (looked like something i needed, but not worked)
and i have no idea where to start
so i found some yt with circuit manger + kmk
after using "circuit manger" uf2 thing
i tryed to get KMK on my board
kmk = 2 mb my board 999kb/Kb

so is there a smaller version ? or more direct coding

stray lichen
#

Hello everyone, need guide about connecting python server hosted anywhere with the microcontroller esp8266 to post and get data.

I have Flask sever, created end point to get data locally on 5000. And Connected successfully server running on localhost 5000 port with esp8266. But i want to live my Flask server using ngrok and but after exposing port on ngrok i am not able to connect with microcontroller.
Can anyone guide me how i can get this done, i searched on google but not able to get done
Thank you

main tapir
#

How do I use python in microcontrollers such as arduino and esp32

spiral sandal
next shoal
#

Anyone ever used micropython for micro:bit? Specially the radio module.

limber field
#

who said , radio @next shoal

elfin sphinx
reef ember
clear bone
sharp geyser
#

amazon

elfin sphinx
# clear bone We're all ears to your superior shopping place!

wouldnt recommend amazon for electronics parts. They are overpriced.

Check local reputed electronics sites first.

if not , use mouser, digikey , etc

and lastly , there is always aliexpress. although if its "superior" or not , is a different question.

clear bone
#

Well, I live deep in the woods so there are no "local" anything. I've even had the bad idea of opening an electronics shop because of the scarcity in my region. I can get esp32s and 8266nodemcus for less then a couple of bucks each off of either Amazon or temu and both will quickly credit me if there are any issues with the product and both only take 3 days or so on orders. I'll check out mouser and Digi key, but I highly doubt smaller sites are going to give free shipping and I've had return problems with smaller sites too. Often, when something is bad, there is no return required where most smaller sites still require a return where I would have to cover shipping.. I'm all ears to new sites but your bashing is off mark and unfounded.

elfin sphinx
#

also where r u from if u dont mind sharing ?

clear bone
#

Deep woods Kentucky so shipping is always an arm and 1/2 a leg. I haven't gotten a single bad part from Amazon or Temu and they also have millions of components. I haven't NOT been able to find any specific part on Amazon for cheap yet. I'f you look back to the thread you had to comment on, the user was looking for cheap parts, I provided a link to said parts and you clearly have a hangup about those sources.

#

Also, you advice should have been for the user I was talking too as they also don't have anything local so the source, was really, for them.

#

IT's SaulGoodMan though... I appreciate you trying to help me get better prices though. Sorry if I come off harsh...

reef ember
clear bone
#

If china was interested in me, at least someone would be interested in me. I got nothing to hide from anyone. If you think those other sites aren't selling your info, you're still wrong because you used a card to make the purchase and THEY ARE selling your info too.. Paranoia will destroy'ya...

#

And as I noted, I haven't gotten a single doa piece of hardware and all have worked as advertised.

spiral sandal
#

also aliexpress AI is very efficient at sourcing your wishlist for you giving more choices or bundle deals that way, it saves hours of manual searching

clear bone
#

I would use them on larger orders if anything takes off for me. I seldom need more then 5 of anything and I can get 15 MCU's for $13 on amazon if needed...

#

No shipping..

#

easy returns (as in, they don't want it back)

reef ember
clear bone
#

I'll digress from the political statement about our current president and the chinese spy staying with all the top secret docks at marlargo....

#

I get it, you don't trust them. Thanks for the heads up and the other options. I'm comfortable buying where I currently buy.

#

And if someone wants to know where to get stuff, I'll probably still refer them to amazon and temu.

#

Now if you know where to get a Jetson Orin Nano for $30 I'm all in... Probably from china though...

hushed aspen
#

Guys

#

Does micropython supports pygame?

spiral sandal
#

best choice to use with micropython is probably lvgl.io

#

lvgl also support cpython so it is not time wasted

reef ember
elfin sphinx
# clear bone Also, you advice should have been for the user I was talking too as they also do...

i had no idea what the previous conversation was as it was quiet a while ago

i saw your message wanting better shopping places than temu right here #microcontrollers message so thats what i replied to

there is no need to state it explicitly that temu is not a site you can blindly trust on. We all know what temu is.
so is aliexpress for that matter. But most of the times , aliexpress delievers what they say. (maybe so does temu , i havent used it )

so i presented few reliable options that can be trusted like mouser and digikey. If you are in the US , maybe they charge like 5-7 USD for the basic shipping option. And whenever people buy , they usually buy a lot of stuff at once. So i usually order lots of components in one order. so the shipping cost is like a one time cost to get lot of components and its mostly ok.

and as for amazon..... well lets just say the sellers think they can buy from source for cheap and sell on amazon for inflated prices. Except for few parts and kits , i would say amazon almost always has slightly higher prices. in some cases (like rapsberry pi boards , the prices are sometimes inflated by like 100 % and are almost always out of stock, check images for example)

For "common stuff" like boost converters and allat , sure amazon is usually fine (although i would still double check all other places to make sure you are not overpaying). As soon as you start to get into niche stuff. like wanting just the ICs or a component with specific value, or bunch of specific SMD components , components that are per your specs etc , amazon falls short.

One thing amazon indeed does great is returns. But the need for returns is if you get bad parts in first place. With these sites , the chances of that happening are very very rare.

#

it all boils down to -> if i need some parts that are not "critical" ,i firstly check my local site, if they have it and its not overpriced, i just use that, if not , i order them from aliexpress , if i need parts that im using for long term like raspberry pis or other debuggers etc, i order from a good site.

#

and as for the political aspect , i personally couldnt care less

they already have our data anyways ,like , i just need my parts , i dont really care what "intel " they get on me from that

clear bone
#

@elfin sphinx I'm currently only buying small quantities. When I buy 5 - 8266s for $6 I can't be spending 5 more on shipping.

frail rover
#

Guys uhh

#

Is esp32 cool

#

I need to choose between an arduino and esp, not sure which one doe. Heard esp32 leaks charge a lot

tiny burrow
#

Hello

frail rover
# frail rover
poll_question_text

Cool?

victor_answer_votes

4

total_votes

9

reef ember
#

when I think of a ESP32 I think of a micro controller that can be connected to other ESP32s for a massive high tech home

onyx glade
#

I need a microcontroller which has both serial and wifi, support https, and smaller then your standard esp32

reef ember
#

ESP8266: This is a smaller and more cost-effective alternative to the ESP32. It has built-in Wi-Fi and supports HTTPS. However, it has fewer GPIO pins and lacks Bluetooth capabilities.

Raspberry Pi Pico W: This microcontroller is compact and comes with built-in Wi-Fi. It supports HTTPS and has a good number of GPIO pins. It's a great choice for projects that require a small form factor.

Arduino Nano 33 IoT: This microcontroller is smaller than the ESP32 and comes with built-in Wi-Fi and Bluetooth. It supports HTTPS and has a range of GPIO pins for various applications

#

ty copilot

spiral sandal
onyx glade
#

$0.99, free shipping, and even usbc as an added bonus tysm

spiral sandal
#

take a bag they often sale by 5 or 10 , for even cheaper

onyx glade
spiral sandal
#

and sometimes you can get lucky and have counterfeit FTDI on them so they can work with ... python in the browser ( pygbag or pyodide )

#

otherwise just use Telemetrix for esp8266 directly via usb or wifi

onyx glade
#

Literally all I need to do with it is sniff data from a processor's serial, forward it to a webserver, and then write data into another serial line

#

Had it working on a standard esp32 just was too big sadly

spiral sandal
#

yeah D1 mini is a perfect match for that

onyx glade
#

ty again

spiral sandal
#

yw

soft loom
#

Hello all! I'm extremely new to all this, but im wanting to go into robotics and prosthetics and was told that everyone here might be able to help with getting started. Main goals at the moment are to start a few beginner friendly projects and learn how to code while doing them. Any advice would be great.

wet spoke
#

is there a big difference between coding in CircuitPython and MicroPython ?

elfin sphinx
#

Syntax is same like python but the libraries and all used are different , so yes ?

wet spoke
#

im asking because i can't find ESP32-S2 specifically for CircuitPython (The board my group got is custom made by sponsor and uses ESP32-S2 and now i dont know which download to use). i mean i can find some boards but not the generic one

#

for context my school picked me into a group for minisumo contest where they give you the board and nothing else

#

this is how the board looks and i have a presentation file labelling all the connections but it's in Polish

#

this are the specs provided

#

it says 2022 but that's because it's the year the board got introduced in

#

before it was based on STM32F103RBT6

limber field
#

start identifying all the components on the board - collect PDFs @wet spoke

wet spoke
#

you mean this?

#

i never really worked with boards like these

limber field
#

the chips outputs / inputs will lead to the pins , the components will tell voltage and amp maximums , usually the intended purpose also like - motor controller or whatever - Its a detective story ... need them clues @wet spoke

#

Look for a ultra simple version of a ESP32 board , at least will show the basic parts to make a interface to talk to it @wet spoke

reef ember
dreamy wasp
#

How hard would it be to make a hid device without ic's or microcontrollers

past tendon
#

hii

main nacelle
#

Hello has anyone ever made there own microscope controller?

paper pike
#

Has anyone made there own microcontrollers

indigo plover
# paper pike Has anyone made there own microcontrollers

Functionally speaking, you can make something that works and behaves the same as a microcontroller : a processor with peripherals. You can pick an FPGA, load a RISC-V processor into it, hook up a few peripherals of your own, such as a DAC, an ADC, memory, etc. Then you would be able to program the RISC-V core and use it as a controller for the peripherals. Making it a microcontroller is much more complex, as it would require a silicon fab, which is difficult, expensive and time consuming

scenic root
#

I am trying to make a object tracking robot using raspberry pi, python, and servos. But idk why this is having an existential crisis

#

here is the code ☝️

indigo plover
paper pike
#

Yes

indigo plover
#

Of course. That's how sensors exist. Otherwise, I'm not sure I fully understand the meaning of your question

paper pike
#

Dose anyone know how to make a homemade sensor

indigo plover
#

For example, measuring water level : make a pcb with various conductors to measure which ones are shorted

paper pike
#

Spectral data for samples

indigo plover
#

Samples -> FFT -> spectrum

paper pike
#

FFT

paper pike
indigo plover
paper pike
indigo plover
#

What do you mean by confirmation?

paper pike
#

Configuration of wires

indigo plover
#

Basically that

paper pike
indigo plover
sand acorn
#

does anyone know where i can find BrickPi documentation (it's a raspberry pi). I want to see the library with all the different types of methods to use

#

i can't find any docs on the internet

sand acorn
#

thanks

fast wagon
#

hey guys, what's the best way to get started with embedded systems?

indigo plover
#

It's a broad field

spiral sandal
fast wagon
indigo plover
fast wagon
#

do you guys recommend learning C for embedded systems

pseudo sinew
#

I got myself some ESP32. I wonder if I can turn them into like a wifi/bluetooth dongle for computers? Also what are some projects yall did with ESP32s?

spiral sandal
dreamy wasp
dreamy wasp
limber field
#

slow as a WIFI , BT modem ? @dreamy wasp

dreamy wasp
limber field
#

can it do better than 250 Kbaud ? as a modem link for other type MCU ( microcontroller ) @dreamy wasp

dreamy wasp
limber field
#

I use propeller 1 chip , no WIFI / BT , but has 250 Kbaud FULL-DUPLEX serial , now Im considering a RP3B+ as a serial link @dreamy wasp

#

all python based

dreamy wasp
limber field
#

Looking to experiment with the full functionality of a now 'old' RP3B+ , GPIO blinky lights boring .. however making it a secure ETHER , WIFI , BT data link is interesting ---> to a MCU or array of MCUs @dreamy wasp

dreamy wasp
#

valid, i just use my esp32 for automation or hacking legal

limber field
#

IM using Python for now , C / C++ is down the road ( speedy graphics )

pseudo sinew
# dreamy wasp You can but its slow, i would not recommend it

Oh, that's interesting. I guess the slowness is not worth it then LOL. What kinda projects you did with your ESP 32? I only made like a detector thingy where two ESP32s are linked, one makes a wifi and becomes a webserver, the other connects to the wifi and goes to the webpage. So when they are close, they connect and the Blue LED turns on so I know that they are both close to each other. When they are far the Blue LED turns off since they can't connect to each other.

tepid violet
#

so

#

i have to

#

work abouit

#

sorry wrong sever

#

thihih

fast wagon
#

bro must've had too much to drink

shrewd rune
#

is there a way i can use both micro-python and idf-esp on the esp32?

strong geode
#

hi

fast wagon
#

yo guys after learning basic c do you think i should start with embedded systems or should i first do some practice with pointers and such before getting started with it

#

just spent all of today learning c (have never learned any c before today but i know java and the syntax is pretty similar and so not very hard to get used to)

#

only thing new to me is pointers and structs, but those don't seem too bad

fast wagon
#

perhaps should i work with implementing data structures and algorithms in c

floral spruce
#

Can't hurt to just jump into embedded systems stuff, you'll make mistakes but that's fine, you'll learn as you go

fast wagon
fast wagon
#
#

i can't really tell if it comes with the wire or not

fast wagon
#

should i get arduino r4 minima or wifi

indigo plover
#

Better even, take the cheapest

fast wagon
#

minima it is then

fast wagon
indigo plover
fast wagon
# indigo plover A spool of single core 22 or 24 AWG, cutters, skinners, pliers
#

showed at the bottom of the arduino product page as frequently bought together

fast wagon
fast wagon
#

i don't know anything lol

#

when i search it up i either see socks or a knife

#

and for cutters and pliers does the size matter

#
indigo plover
fast wagon
#

these are all for cutting wires right

indigo plover
#

One is for cutting, the other is for stripping, the other is for bedding. Try to do all three with the stripper and you will break it within 4 weeks

fast wagon
#

i see

chilly veldt
#

I was wondering what software should I use to program my arduino in python?

spiral sandal
# chilly veldt I was wondering what software should I use to program my arduino in python?

you can flash arduino boards with python, but can't program them they just don't have enough memory. But there's is a way to "drive" them from python https://github.com/MrYsLab/Telemetrix4Arduino/

GitHub

The Telemetrix Project Server For Arduino-Core. Contribute to MrYsLab/Telemetrix4Arduino development by creating an account on GitHub.

chilly veldt
#

hmmmm, at that point do you think it might be more benficial to just learn c++?

spiral sandal
#

no idea i use C even with arduino tools which are c++

chilly veldt
#

Ok, thanks!

spiral sandal
#

Nim-lang seems also a very decent alternative to C/C++

#

it is way closer to python

#

i know people do program arduino with it but did not try myself yet.

fast wagon
#

yo guys i'm getting an arduino board, does this type of wire work
https://www.amazon.com/Adafruit-Solid-Core-Wire-Spool-ADA290/dp/B00KAE3NTQ

elfin sphinx
fervent viper
#

I bought a sim800c with usb but im unable to establish a connection, the only response im getting is those weird characters at connection

indigo plover
fast wagon
indigo plover
fast wagon
#

cause for this one most of the blades are the stripping part, only a small part is for cutting

indigo plover