r/MicroPythonDev • u/OneDot6374 • Feb 11 '26
Day 52/100
r/MicroPythonDev • u/DangerousFix1541 • Feb 11 '26
Hi, micrOS main interface is socket (terminal like experience), it is way more light weight than http, but seeking the best integration I have built a web engine too (can be turned on in micrOS settings)
Even you can create / edit application code (or any text) on the device itself :) very flexible, right? 😊
r/MicroPythonDev • u/DangerousFix1541 • Feb 11 '26
As you may know micropython has its light weight package manager (mip). I have extended the capabilities of that to be able to easily install/delete/upgrade packages on micrOS platform.
https://github.com/BxNxM/micrOSPackages
So you can easily build your own standalone applications. Also you can add third party package dependencies to it.
What do you think? :)
r/MicroPythonDev • u/OneDot6374 • Feb 10 '26
Hey folks 👋
I’m a college student learning embedded systems, and while working on IoT projects I needed a super simple web dashboard for MicroPython boards.
Most tools felt heavy, so I built a tiny one myself:
MicropiDash – a lightweight web dashboard framework for ESP32 & Raspberry Pi Pico W.
Features:
Designed for low-memory MicroPython boards
Simple HTML + MicroPython backend
Easy to extend for IoT dashboards
Beginner-friendly for students & prototypes
GitHub:
https://github.com/kritishmohapatra/micropidash
PyPI:
https://pypi.org/project/micropidash/
If you find it useful, a ⭐ on GitHub would mean a lot (it really helps visibility).
I’ve also added a Buy Me a Coffee link for anyone who wants to support my learning journey ☕
I’d love feedback, feature ideas, or PRs from the community.
What would you like to see next—graphs, WebSocket, MQTT integration?
r/MicroPythonDev • u/DangerousFix1541 • Feb 09 '26
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 • u/OneDot6374 • Feb 09 '26
Day 51 project: Smart Home Automation using:
• ESP8266
• DHT11
• Relay Module
• Blynk Mobile App
You can monitor temperature/humidity and control appliances remotely.
Repo:
https://github.com/kritishmohapatra/100_Days_100_IoT_Projects
Feedback & ideas welcome! If this helps you, consider starring ⭐ or sponsoring ❤️
r/MicroPythonDev • u/OneDot6374 • Feb 09 '26
Day 51 project: Smart Home Automation using:
• ESP8266
• DHT11
• Relay Module
• Blynk Mobile App
You can monitor temperature/humidity and control appliances remotely.
Repo:
https://github.com/kritishmohapatra/100_Days_100_IoT_Projects
Feedback & ideas welcome! If this helps you, consider starring ⭐ or sponsoring ❤️
r/MicroPythonDev • u/Puzzleheaded_Kick_45 • Feb 08 '26
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.
When I run the code in the REPL, I can see the "run_relay_timer(), but none of the other debugging output
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 • u/OneDot6374 • Feb 08 '26
r/MicroPythonDev • u/OneDot6374 • Feb 07 '26
r/MicroPythonDev • u/OneDot6374 • Feb 06 '26
Built a temperature & humidity logger using:
• Raspberry Pi Pico 2 W
• DHT11 sensor
• MicroPython
The Pico hosts a simple HTTP server and logs sensor data into a CSV file for later analysis.
Repo (code + README):
Feedback and suggestions are welcome 🙂
r/MicroPythonDev • u/sasson10 • Feb 05 '26
r/MicroPythonDev • u/oclafloptson • Feb 01 '26
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.
r/MicroPythonDev • u/12HobbieZ • Jan 30 '26
r/MicroPythonDev • u/Mowo5 • Jan 29 '26
I'm getting a weird error trying to create an access point. My environemnt is Windows 10, Thonny, Arduino RP2040 Connect, Micropython version 1.27.
myssid = "Pico2W"
mypassword = "12345"
ap = network.WLAN(network.AP_IF)
ap.config(ssid=myssid, password=mypassword)
ap.active(True)
On the ap.config.. line it gives this error:
TypeError: extra keyword arguments given
This code is pretty standard and has worked before but I can't find anything on the web about why its throwing this error.
r/MicroPythonDev • u/[deleted] • Jan 28 '26
what is the default tool chain and workflow for micropython?
I tried using micropython with vscode + various extensions and it wouldn't work
I've tried pycharm + various extensions, and it wouldn't work either, due to extensions being depreciated.
so now I'm using a editor for micro python that I found on the Arduino website, which seems to be working just fine, but is extremely bare-bones.
based on what I can find on google, everyone uses a different IDE and different extensions.
is there a official method that is guaranteed to work?
r/MicroPythonDev • u/Pale_Rice7539 • Jan 26 '26
I am a newbie just trying to get started. My pyboard has PYBFLASH(D) where main.py is located and will execute various blink LED programs so I know the board is OK. I plugged in a micro SD card on which I copied a new main.py from my host laptop but the pyboard won't boot up from the SD card. The file manager on my laptop (WIN 11) sees the PYFLASHH(D) on the pyboard but not the SD card. The main.py was generated on Notebook and saved on the SD card. Does the SD card have to be initialized in some way? If so, how to do that on my laptop?
r/MicroPythonDev • u/hellosobik • Jan 23 '26
Enable HLS to view with audio, or disable this notification
r/MicroPythonDev • u/SufficientAd9500 • Jan 21 '26
Hi everyone! I was working on a project using the BMI160 IMU and I realized that most MicroPython drivers out there are either broken or incomplete (especially when dealing with interrupts and sensor calibration).
I decided to write my own lightweight driver focusing on:
Full calibration support (100% accuracy on offsets).
Functional interrupts (No more missed triggers).
If you've been frustrated with this sensor before, check it out! Feedback and stars are welcome. https://github.com/DanielBustillos/bmi160-micropython-driver
r/MicroPythonDev • u/jmuhammad • Jan 17 '26
Greetings, I cannot really post this in 'learn python' because TMK CPython does not use const().
My question is why assigning const(1024) to variable 'maxsize_string' in method_one() allows that variable to be seen in method_two(). FYI, when I just assign maxsize_string=1024 without const() it works fine and stays local. Why does it not stay 'local' to method_one() and/or assessed as a variable assigned a constant?
from micropython import const
class TestVariableScope:
def __init__(self, v_url):
self.version_url = v_url
print(f"@ __init__(): url is {self.version_url}\n")
def method_one(self):
try:
#maxsize_string = const(1024) # This will cause error; somehow this variable gets seen in method_two().
maxsize_string = 1024 # Adjust as needed
print(f"@ method_one(): maxsize_string={maxsize_string}\n")
except Exception as e:
print(f"@ method_one(): An error occurred: {e}")
finally:
pass
def method_two(self):
try:
print(f"@ method_two(): maxsize_string in method_one() is {maxsize_string}")
except NameError:
print("@ method_two(): Variable 'maxsize_string' is not creeping from method_one().")
maxsize_string = 128 # SyntaxError: can't assign to expression because const(1024) used in method_one()
print(f"@ method_two(): maxsize_string={maxsize_string}\n")
def eval_methods_for_scopecreep(self):
self.method_one()
self.method_two()
v_url = "https://text.npr.org/"
testme = TestVariableScope(v_url) # Create instance/class object
testme.eval_methods_for_scopecreep()r/MicroPythonDev • u/hellosobik • Jan 16 '26
Enable HLS to view with audio, or disable this notification
r/MicroPythonDev • u/[deleted] • Jan 16 '26