r/MicroPythonDev • • Apr 09 '21

STM32F407 Discovery Board for MicroPython

2 Upvotes

Has anyone used the STM32F407 Discovery Board with MicroPython? Does it create a USB Virtual Drive, allowing external file access?

I'm new to MicroPython. Installing it on a NUCLEO-F411RE was rather painless. I can blink the LED, but I would like to work with I2C devices attached to the I2C bus.


r/MicroPythonDev • • May 28 '22

TTGO firmware flashing

1 Upvotes

Could anyone point me in to the right direction please? Spent most of the day trying different ways and all failed. Windows 10.


r/MicroPythonDev • • Aug 31 '21

Library for Byte Manipulation!

5 Upvotes

Hey guys! I recently had quite a bit of frustration with manipulating hardware level bytes in MicroPython, so I made my own library, “PyBytes”, to help with it! If any of you have any suggestions or want to help me further develop it, let me know!

GitHub Repository:

https://github.com/dgrantpete/PyBytes

Also us been published to PyPi, so can be installed with “pip install pybytes”


r/MicroPythonDev • • May 25 '21

Noob question: Does ntptime maintain time in background and prevent drift? What is the best practice for maintaining a reliable real time clock?

1 Upvotes

r/MicroPythonDev • • Jan 06 '22

When running projectname.py menuconfig on either Thonny or ESP-IDF terminals it just open Thonny window with the project on it

1 Upvotes

Does anyone know how to enable CONFIG_FREERTOS_UNICORE? Thanks in advance


r/MicroPythonDev • • Aug 22 '21

new Lolin S2 Mini - ESP32-S2 & pin compatible w/Wemos D1 mini

8 Upvotes

Lolin S2 Mini

I recently used MicroPython in a project with D1 Minis (ESP8266). Program & libs fit in RAM on a D1 Mini, but I went looking for a beefier WiFi-enabled board for future MicroPython projects.

Found the $4 Wemos/Lolin S2 Mini w/pre-loaded MicroPython. More at the wemos.cc wiki & the CNX Software writeup.

Edit: as firmware is built by Lolin & changes are not yet merged into MicroPython mainline, backup firmware with esptool.py --chip esp32s2 --port /dev/ttyACM0 --baud 460800 read_flash 0x00000 0x400000 lolin_s2_mini_stock_firmware_4M.bin (replace --port .... with your device)

Note that the S2 Mini's USB-C port is wired up to the the ESP32-S2's USB OTG peripheral rather than to a USB-UART chip (edit: with flashing via USB CDC in ROM), and MicroPython will likely someday support full USB host & device functionality.


r/MicroPythonDev • • Feb 28 '21

Pycom boards

Thumbnail docs.pycom.io
4 Upvotes

r/MicroPythonDev • • Mar 02 '21

Micropython stubs on VSCode using micropy-cli, what does anything do?

1 Upvotes

Ok, so I barely understand how python works, but I'm having a hard time understanding how to actually know what to do, When I try to go to definitions of of part of a module, there's nothing of "pass"

https://i.imgur.com/b4d8zFZ.png

I'm messing around with a small display and this is used in some example code, I'm trying to learn what ssd1306.SSD1306_I2C(oled_width, oled_height, i2c) means really, but when I use the "Go to Definitions" and I'm met with basically nothing. "pass" in the entire file

I'm super new to this, so pardon if I'm doing something dumb, but how am I to know how to use anything if everything has nothing?


r/MicroPythonDev • • Mar 19 '21

Getting Started With Pybytes.

Thumbnail
matthewfelgate.wordpress.com
2 Upvotes

r/MicroPythonDev • • Aug 30 '21

How do i divide/subtract from a variable?

1 Upvotes

I am trying to convert the input from a potentiometer into degrees.


r/MicroPythonDev • • Apr 27 '21

How do I add an if/inequality to this?

Thumbnail self.raspberrypipico
1 Upvotes

r/MicroPythonDev • • Mar 05 '21

Using GPS in MicroPython

Thumbnail
matthewfelgate.wordpress.com
5 Upvotes

r/MicroPythonDev • • Feb 26 '22

keyboard emulator for micropython

3 Upvotes

searching for a keyboard emulator for esp8266


r/MicroPythonDev • • Apr 20 '22

Creating a Time Interval

1 Upvotes

Hey guys, I'm taking an introductory programming and microcontroller class. I'm making a program for it where I'm trying to get an LED to toggle every 500ms. I am trying to do this with utime.ticks_ms() rather than utime.sleep() but am not having any luck. I can only get it to toggle once, when the first 500ms is hit. Does anyone have any advice? Please keep in mind that I am extremely new at this.

Thank you!


r/MicroPythonDev • • Mar 08 '21

[HELP] Micropython ESP8622 MQTT Clients Stop Responding

1 Upvotes

I have several ESP8622 running umqtt. While they stay connected to the network often they just stop responding to mqtt messages/topics. Any thoughts?

So... I then have to open WebREPL, login and run machine.reset(). Is there a way to script this process?

Thanks for any help!


r/MicroPythonDev • • Jan 05 '25

What board would you select for this esp32?

1 Upvotes

childlike cake tan knee nail offbeat party instinctive plough husky

This post was mass deleted and anonymized with Redact


r/MicroPythonDev • • Dec 27 '24

Recognizing activities in accelerometer motion data using Machine Learning + DSP

3 Upvotes

I have made a new example/demo application for emlearn-micropython, a Machine Learning and Digital Signal Processing library for MicroPython. I hope people can use it as a starting point to develop fun and useful application using accelerometers and IMUs :)

Code: https://github.com/emlearn/emlearn-micropython/tree/master/examples/har_trees


r/MicroPythonDev • • Feb 21 '25

How to get the cheap yellow display to read/ write to an SD card?

2 Upvotes

I've tried and failed to get my ESP32-2432S028 board to recognize an SD card in Micropython. Has anyone been able to get it to work?


r/MicroPythonDev • • Dec 02 '24

Problems with http request redirects.

3 Upvotes

airport resolute cow run sink merciful plant work subsequent tidy

This post was mass deleted and anonymized with Redact


r/MicroPythonDev • • Dec 16 '24

Attempt to initialize one shot timer yields NameError

1 Upvotes

Hi,

I'm playing around with a XIAO SAMD21 and an RGB LED. I'm trying to activate the individual diodes sequentially at 1 second intervals.

The last line throws:

NameError: Name not defined

I'm at a loss because this is pretty much directly out of the documentation, and I see no reason why it shouldn't work.

What am I missing?

from machine import Pin
from machine import PWM
from machine import Timer


led_1 = Pin('A2_D2',Pin.OUT)#red


led_2 = Pin('A3_D3',Pin.OUT)#green


led_3 = Pin('A4_D4',Pin.OUT)#blue


freq = 4000


duty = 32767


def do_nothing(timer):
    return


while true:


    for i in (led_1,led_2,led_3):


        led = PWM(i,freq=freq,duty_u16=duty)


        t = Timer(mode=Timer.ONE_SHOT, period=1000, callback=do_nothing)

r/MicroPythonDev • • Feb 07 '25

ESP8266 pins functionality different with MicroPython firmware?

1 Upvotes

I have a bit of a strange situation. The project is simple - display text on a 2.7in waveshare e-paper display.

When using a very basic sketch in C++ via Arduino IDE, I can successfully upload the sketch and text is displayed. I can change the sketch and reupload it and that new text is displayed - all is well!

I then erase the flash and upload the latest MP firmware - no errors. I run a small script to blink the onboard LED 10 times just to make sure hardware is working as expected. Again, no issues up to now.

As soon as I plug the screen in (same pins as before) I can’t get anything back from the esp device. When I try running a script (I’m using ampy) the onboard LED flashes but then the command hangs and none of my print statements get returned.

As soon as I unplug the screens power (3.3 pin), I can run the repl and scripts again and I get my print statements returned.

If I erase the flash and go back to C++, it’s works as expected and described at the top of this post. I have replicated this behavior across 3 esp8266 devices.

I didn’t see anything in the docs about pin functionality potentially being different for micropython, so what am I missing? Has anyone else experienced this?


r/MicroPythonDev • • Nov 28 '24

Fan RPM Measurement, Unreliable Reading

1 Upvotes

I'm building a fan controller and have it mostly working, except for trying to read the RPM. I did a bunch of Google-fu and came across this thread.

But much like the OP in that thread, I am getting crazy RPM spikes, reporting RPMs of upwards 20 000 and above. It also gets stuck in the nested while loop for quite a while at times, due to sm.rx_fifo() returning 0.

I feel like it may be something with the StateMachine or trigger, but am at my wits end. I really didn't think trying to read RPM would be this convoluted.

Being able to read the RPM isn't strictly necessary for my main goal, but figured it could be nice to have it figured out if I want to iterate further on this project later.

This is my current code (GitHub Gist).

Some hints on what to try next would be greatly appreciated, still fairly new to this whole kind of thing. Mostly have experience with smaller Arduino projects.

Edit:

I read the Noctua white papers and I should be calculating rpm = frequency * 60 / 2. That's fair, makes sense.

But need to figure out how to get that frequency. The trigger and statmachine is what throws me off.

Will do some more testing later. 😴


r/MicroPythonDev • • Nov 29 '24

Do any of you use VSC instead of Thonny etc?

4 Upvotes

public slim instinctive reminiscent dime spoon aback plough mountainous meeting

This post was mass deleted and anonymized with Redact


r/MicroPythonDev • • Nov 07 '24

MicroPython driver for CrateDB

5 Upvotes

Hi there - I recently wrote and released a first version of a MicroPython driver for CrateDB. I've added a Raspberry Pi Pico W temperature logging demo into the repo and will add more in the near future. I'll also work on CircuitPython support.

I'd love you to try it and let me know how you get on!


r/MicroPythonDev • • Jan 05 '25

Pin map script available for micropython?

1 Upvotes

Hi, I had a look at circuitpython before and there is a pin map script available which lists the output of microcontroller.pin command. Is there some similar command in micropython? My issue is I did not find my board in the download area for the firmware and like to know what pins are available in the firmware I installed.

Thanks in advance