r/MicroPythonDev • u/Tankista42 • Mar 02 '25
How i start with micropython
Im new at programming, i barely know anything about it, but i really wanna make some stuff with ESP32 and micropython seems pretty fun, any tip is welcome
r/MicroPythonDev • u/Tankista42 • Mar 02 '25
Im new at programming, i barely know anything about it, but i really wanna make some stuff with ESP32 and micropython seems pretty fun, any tip is welcome
r/MicroPythonDev • u/Remarkable_Mud_8024 • Jan 02 '25
Hi! I need to implement something extremely simple but I did not expect to struggle so long with no results at the end.
I need while main.py is running to read the stdin. Want to use stdin as configuration channel while the WiFi/MQTT/BLE affairs are running in parallel. All my code is written in async-await approach by using asyncio.
The board is ESP32 WROOM with the latest Micropython - v1.24.1 (2024-11-29) .bin
The last code I tried is that one from ChatGPT (attached a link) and I'm constantly hitting a wall after wall with it because of unavailable method in Micropython.
Did someone managed to read stdin with by using asyncio approach?
r/MicroPythonDev • u/jonnor • Dec 27 '24
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 • u/Troglodyte_Techie • Dec 02 '24
airport resolute cow run sink merciful plant work subsequent tidy
This post was mass deleted and anonymized with Redact
r/MicroPythonDev • u/Able_Loan4467 • Aug 01 '24
I'm aware the main approach is to freeze modules into the firmware of a board, but I like to keep things modular and multi purpose when I can... and avoid compiling stuff :P. I see back in 2022 there was some effort to change the way .mpy files work so that even after importing modules that are in .mpy format, most of it resides in flash instead of RAM. Is this still in development or is there a way to do this now? https://git.kfayun.com/xpstem/micropython/-/commit/f2040bfc7ee033e48acef9f289790f3b4e6b74e5
r/MicroPythonDev • u/joey_speedy • Jun 26 '24
Hello. This is Automatic key box project. I am trying to have 2 processes running simultaneously and continuously. One is handling Username/Password Loggin. The other is listening to reset command. I have been trying Asynchronous function, but in vain. Per attached screenshot below, process A is working fine, while process B has not even started.
Hardware is ESP32-WROOM-32. Appreciate your advice please.

r/MicroPythonDev • u/Wake-Of-Chaos • Jun 03 '24
Trying to work with a SHTC3 temperature/humidity sensor. I have the I2C address and the device datasheet but can't figure out how to read the two addresses. I'm new to Micropython on a raspberry pi pico. Any help would be appreciated.
r/MicroPythonDev • u/WZab • May 15 '24
I have seen a few different debouncing routines for MicroPython. Today I needed to implement debouncing immediately for ESP32. Below are the results of such a fresh attempt. I think that it may be interesting for somebody due to its simplicity.
print("Debouncing demo")
import machine as m
settling_time = 20 # Set to 1000 to see how does it work
p1=m.Pin(32,m.Pin.IN, m.Pin.PULL_UP)
p2=m.Pin(33,m.Pin.IN, m.Pin.PULL_UP)
t1 = m.Timer(1)
t2 = m.Timer(2)
def t1_cb(t):
print('pin 1 change to ', p1.value())
# Of course, you may add here your own code
def p1_cb(p):
t1.init(mode=m.Timer.ONE_SHOT, period=settling_time, callback=t1_cb)
def t2_cb(t):
print('pin 2 change to ', p2.value())
# Of course, you may add here your own code
def p2_cb(p):
t2.init(mode=m.Timer.ONE_SHOT, period=settling_time, callback=t2_cb)
p1.irq(trigger=m.Pin.IRQ_RISING | m.Pin.IRQ_FALLING, handler=p1_cb)
p2.irq(trigger=m.Pin.IRQ_RISING | m.Pin.IRQ_FALLING, handler=p2_cb)After running the above code, the correctly debounced values of the pins are printed after you press or release a button connected to 32 or 33 GPIO. You may add another code here (for example, in my final code I send the appropriate event codes to a queue). I have tested it in wokwi on ESP32 (https://wokwi.com/projects/397948297142838273 , use Q and W keys to control buttons).
r/MicroPythonDev • u/LucVolders • Apr 05 '24
Last time there were 240 tips on the site. Now there are more than 330 !!!
No advertisements, just plain tips for programming with MicroPython:
https://micropython-tips.weebly.com/
r/MicroPythonDev • u/yukiiiiii2008 • Feb 06 '24
There is now a package manager called mip, but it only downloads packages to the board. I use VSCode + PyMakr to develop MicroPython project currently. So there won't be IntelliSense if I install packages this way.
What is your way to install packages to your project? Copy and Paste source code in your workspace directly from Git Hub?
I also found there are much less libraries in micropython-lib than in arduino/library-registry. Is MicroPython a good choice for production development? I'm still pretty new to both MicroPython and Arduino, and hesitate on which way to go.
Thank you.
r/MicroPythonDev • u/cubbieco • Jan 19 '24
Has anybody successfully enabled and used a hostname to connect remotely on a Pi Pico W in Micropython? It works fine for me in CircuitPython but I don't want to use that. Here is my boot.py.
import network
import socket
from time import sleep
import machine
from config import *
def connect():
wlan = network.WLAN(network.STA_IF)
wlan.config(hostname=host)
network.hostname(host)
wlan.active(True)
wlan.connect(ssid, wifipass)
while wlan.isconnected() == False:
sleep(1)
ip = wlan.ifconfig()[0]
print(f'Connected on {ip}')
print(f"Hostname: {network.hostname()}")
try:
connect()
except KeyboardInterrupt:
machine.reset()
import webrepl
webrepl.start()And here is the REPL output:
MPY: soft reboot
Connected on 192.168.86.35
Hostname: meetinginator
WebREPL server started on http://192.168.86.35:8266/
Started webrepl in normal modeI can connect to the WebREPL just fine at 192.168.86.35 but I can't use the hostname like I should. Am I doing something wrong or is the functionality just not there? Remembering the ip address for a bunch of pico Ws around the house just isn't feasable.
r/MicroPythonDev • u/CuriousHurry5927 • Jan 10 '24
Hello! I hope this question is not too silly. I have to run three function at the same time in micropython so its obvious i need threading. My main problem is that i can not reach the "us level" (microsecond time) with the "asyncio" library in Micropython (just the millisecond time). Does anyone have any ideas on how I can achieve the microsecond time? I mean with other libraries or maybe with a built-in modul? Thank you so much for your answer! (i am using Pyboard)
r/MicroPythonDev • u/LucVolders • Dec 04 '23
A few weeks ago I posted that there are 90 tips on my MicroPython tips site.
Well now there are more than 170 !!!
Have a look: https://micropython-tips.weebly.com/
No advertising, no tricks. All tips documented with an example.
Keep following as there are more tips to come !!
r/MicroPythonDev • u/LucVolders • Nov 13 '23
https://micropython-tips.weebly.com/
And still growing
r/MicroPythonDev • u/ZenFox411 • Sep 11 '23
r/MicroPythonDev • u/TyGy08 • Jul 01 '23
Hello all! I am decently new with micropython and I had an issue where whenever I ran code, it would spit out this in the shell. "MPY: soft reboot"
I have reset, re-imaged, reinstalled thonny, and I am STILL having issues. It's becoming really frustrating. Can anyone help?
r/MicroPythonDev • u/[deleted] • Jun 08 '23
I’m learning how to build my own micropython firmware and was hoping to get some input on how to restructure the firmware based on my custom boards needs.
In the firmware I am planning to implement over the air updates to flash the opposite partition then set the next boot to it then boot over to it. I have checks in there as well and the ability for user to manually fail back if an error occurs.
On my board I also have 1 mb FRAM that I use for storing all my essential configuration data. So the esp32-s2 is really just responsible for executing code. My esp32-s2 is the 4mb 2sram model: ESP32-S2FN4R2
The attached picture is the generic ota memory layout from micropython
So here is where I need help. What I want to do is split my available resources directly in half. OTA_O and OTA_1 that’s straight forward. But since I am using an external FRAM with 1 mb of storage do I need the NVS? Second, do I need the “otadata” if I only intend to use either partition? I can’t think of why or how to use the otadata partition in this situation. And I don’t know what the VFS is. Any guidance here is appreciated. Thanks!
r/MicroPythonDev • u/Gloppinboobin • May 26 '23
Does anyone know of any good online micropython IDEs? I was hoping to run code from it to a Pi Pico. Thanks!
r/MicroPythonDev • u/oksbwn • May 01 '23
r/MicroPythonDev • u/TheCommonRedditer • Apr 30 '23
I recently bought a casio fx-9750giii calculator for my SAT exam in a week and im permitted to use all its features, including python, so i tried to import a variey of different types of python codes, including hello world, which all ended up not running and giving me errors, how do i fix these problems? is there any specific type of code/software/method im supposed to use? please help me out here.
r/MicroPythonDev • u/oksbwn • Apr 15 '23
r/MicroPythonDev • u/fxwiegand • Apr 11 '23
I’ve stumbled across the btree module that actually seems to be a perfect fit for my project as the data (pre calculated in regular python) I’m using (stored in a dict) is exceeding the picos ram. I would like to store my data on the picos flash so I can access individual keys by loading them in my micropython script.
My question is if there’s a way to serialize a python dict to a db file that can then be loaded onto the pico.
r/MicroPythonDev • u/eskimo_1 • Mar 04 '23
I'm looking into the best way to receive webhooks using (a Pi Pico W that runs) Micropython. There are many posts about sending requests, but I find it difficult to find information on receiving them.
I got some pointers and insights from this post, but still have some questions about the best approach.
I'm primarily puzzled as to why I would need to setup port forwarding while other smart home devices obviously don't require users to do this. Shouldn't this be possible with just software?
As indicated in the post: if it turns out to be very complicated to setup or maintain, or it poses significant security risks, then I'm considering falling back to an implementation where each device would make GET requests every X seconds to check if there are updates.
Would love to know if anyone has experience with this in Micropython, preferably combined with any dev board (Raspberry, Arduino, etc).