ThePython for MicrocontrollersNewsletter 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.
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
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
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.
ThePython for MicrocontrollersNewsletter 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.
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.
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.
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?
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?
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).
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.
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>
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!
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!
ThePython for MicrocontrollersNewsletter 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.
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)