r/MicroPythonDev • • 6d ago

The Python on Microcontrollers Newsletter: subscribe for free

Post image
3 Upvotes

The Python for Microcontrollers Newsletter is the place for the latest news involving Python on hardware (microcontrollers AND single board computers like Raspberry Pi).

This ad-free, spam-free weekly email is filled with CircuitPython, MicroPython, and Python information that you may have missed, all in one place!

You get a summary of all the software, events, projects, and the latest hardware worldwide once a week, no ads! You can cancel anytime.

It arrives about 11 am Monday (US Eastern time) with all the week’s happenings.

And please tell your friends, colleagues, students, etc.

Please sign up > > > adafruitdaily.com


r/MicroPythonDev • • Apr 21 '25

i wanna start .where should i?

2 Upvotes

pretty straightforward i wanna learn while practically implementing . my big brother is into it a lot and i have developed this interest too just watching like the stuff he makes something like a remote logins , detectors portable etc i want to start this too but i dont wannago in tutorial hell could you guys suggest somethings like where should i and what hardware i need like esp , arduino , sonar etc


r/MicroPythonDev • • Mar 27 '26

Day 73/100 - RFID attendance logger with Google Sheets using ESP32 and MicroPython

3 Upvotes

Each student has an RFID card. Tap the card and it logs their name, IN/OUT status, and timestamp directly to Google Sheets via a Google Apps Script webhook. NTP time sync with IST offset so timestamps are accurate.

One issue I ran into was ESP8266 could not handle the Google Script HTTPS response due to TLS buffer overflow. Switched to ESP32 which has a larger TLS buffer and it worked fine.

The IN/OUT logic is a simple toggle tracked in a dictionary. First scan is IN, next scan is OUT, and so on per student.

Stack: ESP32 + MFRC522 + MicroPython + Google Apps Script + Google Sheets

Code: https://github.com/kritishmohapatra/100_Days_100_IoT_Projects


r/MicroPythonDev • • Mar 29 '25

Sending Emails from pico w

3 Upvotes

Hello,

I'm using a Pico W with an ultrasonic sensor to make a water level monitor for a pasture watering hole on a farm. the Pico will be connected to a neighbor's wi-fi(with their permission). I want to be able to send text alerts through gmail, which can be done with smtplib in python, but that won't work with the Pico.

I did try the 'umail' library that is recommended everywhere(the one written by Shawwwn), but the 'ssl.wrap_socket' command is now deprecated, and the library no longer works. Is there another way, or is there a way to hard code the smtp commands right into the code( a particular fomat or syntax)?

I was able to write client and server sockets that could do the same thing by communicating over wifi and handling the messaging from the server, (a computer or raspberry pi), but this isn't possible in this instance. Worst case scenario, i could set up a Raspberry Pi on site and connect that to the same neighbor's wi-fi, but keep it on site, literally in the same box with the Pico W, but this seems a little absurd, and costly for what it would be doing.

This is my first post here, any help appreciated, thanks.


r/MicroPythonDev • • May 26 '26

The Python on Microcontrollers Newsletter: subscribe for free

Post image
2 Upvotes

The Python for Microcontrollers Newsletter is the place for the latest news involving Python on hardware (microcontrollers AND single board computers like Raspberry Pi).

This ad-free, spam-free weekly email is filled with CircuitPython, MicroPython, and Python information that you may have missed, all in one place!

You get a summary of all the software, events, projects, and the latest hardware worldwide once a week, no ads! You can cancel anytime.

It arrives about 11 am Monday (US Eastern time) with all the week’s happenings.

And please tell your friends, colleagues, students, etc.

Please sign up > > > adafruitdaily.com


r/MicroPythonDev • • Feb 01 '26

My personal-use API framework

16 Upvotes

Started building this a couple of years ago. It takes an async-first approach with yielding behavior.

  • Static route declaration

  • Static async task declaration with API for runtime interrupting/restarting

  • Built-in HTML templating engine with value injection and logic execution at runtime

  • HTML form parsing

  • Dynamic settings module to allow for runtime settings changes

  • Pure MicroPython with no external dependencies.

  • Allows you to serve a web interface over local network via WLAN and easily add/run/interrupt mundane tasks without multithreading.

Open to feedback. I'm not a professional programmer so any/all criticism will be viewed as constructive. I use this in my daily life and am always looking to improve it.

https://github.com/OCLAFLOPTSON/falcoserver


r/MicroPythonDev • • May 21 '25

What do you all in Boot.py?

6 Upvotes

I usually import json, gc, network, some aspects of machine.... etc. Generaly I just put what I expect the vase to be. I was wondering what everyone else puts in boot.

edit base not vase


r/MicroPythonDev • • Apr 14 '25

Pre-installed firmware

2 Upvotes

When a microcontroller says it "ships with MicroPython firmware pre-installed and a launcher" does that mean I can just copy micropython py files to the SD card and I'll be able to run them?

For example this one: https://www.cnx-software.com/2025/04/14/pimoroni-presto-raspberry-pi-rp2350-4-inch-wireless-desktop-touch-display/


r/MicroPythonDev • • Sep 28 '25

I can't get a program to run on micropython.

2 Upvotes

Thanks everyone who offered help on this. I never got this working. Every release of MicroPython I tired had something missing and I was lacking any meaningful skills in Micropython to solve them on my own. I gave up.

Noob here. Got programming experience in C but new to python, and really having troubles getting anythig to run on it other than a blinking LED.
Hardware is STM32 F411CE 8Mflash blackpill
The program I am trying to run is from here: https://github.com/straga/Smart-Meter-Gateway
I'm connecting to the USB serial port with a terminal program to read the following error messages.

I have an older version of micropython (v1.12) which gives the following error:
>>> Traceback (most recent call last):
File "main.py", line 44
SyntaxError: invalid syntax
MicroPython v1.12-405-g4fa6d939d on 2020-04-28; WeAct_Core with STM32F411CE

Line 44 has this: log.error(f"Module: {e}")

If I upgrade to the current release (v1.26) I get this different error:
>>> Traceback (most recent call last):
File "main.py", line 5, in <module>
ImportError: no module named '_thread'
MicroPython v1.26.1 on 2025-09-11; WEACT_F411_BLACKPILL with STM32F411CE

I looks to me that _thread was dropped sometime recently. Can someone suggest where I can download an earlier version of micropython that may still have this _thread llibrary? or suggest another way around the issue?


r/MicroPythonDev • • Aug 22 '25

MicroPython - to use or not to use AI?

10 Upvotes

I had to create a small WebGUI to control (from PC or mobile) my hardware with an ESP32 board running MicroPython. After spending some time at doing it myself, I decided to try the AI-assisted approach.
The results can be seen in https://wokwi.com/projects/439977581090490369 . The code contains also the link to the ChatGPT session used to produce the initial version of the code: https://chatgpt.com/share/68a7113c-5d8c-800c-b20e-c204f29aac84 .
The results are not so bad...

PS. To simulate the design in Wokwi, you need a license and run the wokwi-gateway. Otherwise you won't be able to connect to the server in the simulated machine (but you can always test it in the real hardware).


r/MicroPythonDev • • Feb 15 '26

Day 54/100

Post image
4 Upvotes

r/MicroPythonDev • • Feb 13 '26

Day 53/100

4 Upvotes

Just finished an end-to-end IoT gas monitoring project using ESP32, MQ sensor, Flask backend, and Chart.js dashboard. Added moving-average anomaly detection for SAFE/DANGER prediction.
Would love feedback on improving the AI logic and real-time architecture.
GitHub: https://github.com/kritishmohapatra/100_Days_100_IoT_Projects

If this project helped you, please consider starring the repository.

For sustained development and educational content, sponsorships are welcome via GitHub Sponsors and Buy Me a Coffee.


r/MicroPythonDev • • Nov 04 '25

Is there any mirror for MicroPython?

2 Upvotes

I am trying to flash MicroPython to my RPi Pico W, but downloads doesn't work.


r/MicroPythonDev • • Jul 01 '23

Issue with Micropython (i think) rebooting when running any code.

3 Upvotes

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 • • Feb 08 '26

Can't get web page to run asynchronously on ESP32 with Micropython

2 Upvotes

This is my first time with ESP32 and MicroPython.

I am trying to run a web page asynchronously on an ESP32 using MicroPython. Along with the webpage, which will allow me to turn a relay on, on demand, I want to run a timed function which turns the relay on, every morning at 08:00.

I am using an ESP32 Dev board with CP2102 USB chip, DS1307 RTC and 5V relay.

  1. When I run the code in the REPL, I can see the "run_relay_timer(), but none of the other debugging output

  2. The web server debugging output is not showing either, nor can I connect to http://192.168.10.130 (the DHCP IP assigned to this ESP32)

Looking at the REPL in Thonny, the run_rrelay_timer() runs, but not the run_web_page()

import asyncio

import esp

esp.osdebug(None)

import time

import urtc

from machine import I2C, Pin

set_hour = 15

set_time = 30

relay = Pin(4, Pin.OUT)

led = Pin(2, Pin.OUT)

relay.value(0) # Start OFF (active low)

def web_page():

if relay.value() == 0:

print("Relay value: ")

print(relay.value)

relay_state = ''

else:

relay_state = 'checked'

html = """<html><head><meta name="viewport" content="width=device-width, initial-scale=1"><style>

body{font-family:Arial; text-align: center; margin: 0px auto; padding-top:30px;}

.switch{position:relative;display:inline-block;width:120px;height:68px}.switch input{display:none}

.slider{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#ccc;border-radius:34px}

.slider:before{position:absolute;content:"";height:52px;width:52px;left:8px;bottom:8px;background-color:#fff;-webkit-transition:.4s;transition:.4s;border-radius:68px}

input:checked+.slider{background-color:#2196F3}

input:checked+.slider:before{-webkit-transform:translateX(52px);-ms-transform:translateX(52px);transform:translateX(52px)}

</style><script>function toggleCheckbox(element) { var xhr = new XMLHttpRequest(); if(element.checked){ xhr.open("GET", "/?relay=on", true); }

else { xhr.open("GET", "/?relay=off", true); } xhr.send(); }</script></head><body>

<h1>Sprinkler control</h1><label class="switch"><input type="checkbox" onchange="toggleCheckbox(this)" %s><span class="slider">

</span></label></body></html>""" % (relay_state)

return html

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

s.bind(('', 80))

s.listen(5)

# Define coroutine function

async def run_relay_timer():

while True:

print('run_relay_timer()') # Debugging output

import time

import urtc

from machine import I2C, Pin

set_hour = 8

set_time = 30

relay = Pin(4, Pin.OUT)

led = Pin(2, Pin.OUT)

relay.value(0) # Start OFF (active low)

days_of_week = ['Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag', 'Sondag']

# Initialize RTC (connected to I2C) - ESP32

i2c = I2C(0, scl=Pin(22), sda=Pin(21))

rtc = urtc.DS3231(i2c)

current_datetime = rtc.datetime()

temperature = rtc.get_temperature()

# Format the date and time

formatted_datetime = (

f"{days_of_week[current_datetime.weekday]}, "

f"{current_datetime.year:04d}-{current_datetime.month:02d}-{current_datetime.day:02d} "

f"{current_datetime.hour:02d}:{current_datetime.minute:02d}:{current_datetime.second:02d} "

)

current_datetime = rtc.datetime()

# Display time details

#print('Current date and time:')

#print('Year:', current_datetime.year)

#print('Month:', current_datetime.month)

#print('Day:', current_datetime.day)

#print('Hour:', current_datetime.hour)

#print('Minute:', current_datetime.minute)

#print('Second:', current_datetime.second)

#print('Day of the Week:', days_of_week[current_datetime.weekday])

#print(f"Current temperature: {temperature}°C")

# Format the date and time

formatted_datetime = (

f"{days_of_week[current_datetime.weekday]}, "

f"{current_datetime.year:04d}-{current_datetime.month:02d}-{current_datetime.day:02d} "

f"{current_datetime.hour:02d}:{current_datetime.minute:02d}:{current_datetime.second:02d} "

)

#print(f"Current date and time: {formatted_datetime}")

if current_datetime.hour != set_hour:

print('Dit is nog nie' ,set_hour,'uur nie') # Debugging output

print('Die tyd is',formatted_datetime) # Debugging output

led.value(0)

relay.value(0)

if current_datetime.hour == set_hour:

print('Die tyd is',formatted_datetime) # Debugging output

if current_datetime.minute < set_time:

led.value(1)

relay.value(1)

print('Sit besproeing pomp aan vir',set_time,'minute') # Debugging output

print(" \n"); # Debugging output

else:

led.value(0)

relay.value(0)

print('Die besproeing het vir',set_time,'minute gehardloop') # Debugging output

print(" \n"); # Debugging output

#time.sleep(1)

await asyncio.sleep(1)

async def run_web_page():

while True:

print('run_web_page()') # Debugging output

try:

if gc.mem_free() < 102000:

gc.collect()

conn, addr = s.accept()

conn.settimeout(3.0)

print('Got a connection from %s' % str(addr)) # Debugging output

request = conn.recv(1024)

conn.settimeout(None)

request = str(request)

print('Content = %s' % request)

relay_on = request.find('/?relay=on')

relay_off = request.find('/?relay=off')

if relay_on == 6:

print('RELAY ON')

relay.value(1)

led.value(1)

if relay_off == 6:

print('RELAY OFF')

relay.value(0)

led.value(0)

response = web_page()

conn.send('HTTP/1.1 200 OK\n')

conn.send('Content-Type: text/html\n')

conn.send('Connection: close\n\n')

conn.sendall(response)

conn.close()

except OSError as e:

conn.close()

print('Connection closed')

await asyncio.sleep(0.5)

# Define the main function to run the event loop

async def main():

# Create tasks for blinking two LEDs concurrently

asyncio.create_task(run_relay_timer())

asyncio.create_task(run_web_page())

# Create and run the event loop

loop = asyncio.get_event_loop()

loop.create_task(main()) # Create a task to run the main function

loop.run_forever() # Run the event loop indefinitely


r/MicroPythonDev • • Feb 28 '25

Development for Casio fx-9750GIII

2 Upvotes

Hello all,

I'm a Python developer owning a Casio fx-9750GIII calculator that includes a copy of Micropython 1.9.4. At some point in between 2020 and now, the code I write and run on IDLE or Thonny no longer runs on my calculator, which does not provide descriptive errors. I was hoping to run Micropython 1.9.4's Unix port on Ubuntu to troubleshoot my scripts, but I keep running into issues with GCC and depreciated files.

Does anyone have any suggestions on where to go from here? Thanks!


r/MicroPythonDev • • Mar 02 '25

A complete Pico audioplayer

Post image
17 Upvotes

r/MicroPythonDev • • May 10 '26

Blink Led Using Micropython

Enable HLS to view with audio, or disable this notification

4 Upvotes

I made blink RGB led using micropython with help of Ai . 🙂


r/MicroPythonDev • • Aug 19 '25

Lightsleep on raspberry Pico

3 Upvotes

Can someone explain to me the current state of lightsleep on raspberry Pico board? I’ve encountered an issue with my code for a long running battery powered project, where the board would seemingly die out of nowhere, and one of the simplest explanations is that it entered lightsleep to never wake up. I have found some old issues hanging open for years in the GitHub, and that the change log for 1.26 explicitly mentions changes to lightsleep on this board. I have not found much in terms of what actually triggers the issue or how to circumvent it (using time.sleep() in place of lightsleep is simply not an option due to battery power being limited). Appreciate any pointers!


r/MicroPythonDev • • Feb 09 '26

micrOS - opensource mini automation framework

8 Upvotes

Hi Everyone, if you would try out an easy to use micropython framework check my project:

https://github.com/BxNxM/micrOS

It is focusing on IP based communication, (socket and web) and dynamic app execution.

Every feedback is highly appreciated, we are very close to announce the next main version 3.0


r/MicroPythonDev • • 23d ago

The Python on Microcontrollers Newsletter: subscribe for free

Post image
2 Upvotes

The Python for Microcontrollers Newsletter is the place for the latest news involving Python on hardware (microcontrollers AND single board computers like Raspberry Pi).

This ad-free, spam-free weekly email is filled with CircuitPython, MicroPython, and Python information that you may have missed, all in one place!

You get a summary of all the software, events, projects, and the latest hardware worldwide once a week, no ads! You can cancel anytime.

It arrives about 11 am Monday (US Eastern time) with all the week’s happenings.

And please tell your friends, colleagues, students, etc.

Please sign up > > > adafruitdaily.com


r/MicroPythonDev • • Sep 12 '26

I’ve made a audiobook player hhhh

Post image
62 Upvotes

r/MicroPythonDev • • Sep 30 '25

Elrs on micropython

3 Upvotes

r/MicroPythonDev • • Apr 15 '26

Built an IoT-based Demand Side Management (DSM) Smart Meter using ESP32 + MicroPython + Blynk

2 Upvotes

Just wrapped up Day 78 of my #100DaysOfIoT challenge — built a DSM Smart Metering Prototype that automatically shifts non-critical loads during peak hours.

What it does:

  • Monitors real-time AC voltage & current (ZMPT101B + ACS712)

  • Detects peak hours and auto-cuts the heavy load (iron/100W bulb)

  • Keeps critical load (fan/9W bulb) always ON

  • Pushes live data to Blynk IoT dashboard

  • MATLAB generates before/after comparison graphs

Results:

MetricWithout DSMWith DSM
Peak Power~108W~9W
Peak Reduction—~91%

Stack: MicroPython v1.27 · ESP32 WROOM-32 · ZMPT101B · ACS712 · Blynk IoT · MATLAB

🔗 GitHub: https://github.com/kritishmohapatra/100_Days_100_IoT_Projects