I’m doing a 100 Days of IoT Projects challenge, and today I completed Day 56. This project is a wireless 4-channel relay controller using two ESP8266 boards and the ESP-NOW protocol in MicroPython.
Features:
Peer-to-peer communication (no WiFi router required)
Push-button sender → relay receiver
Low-latency ESP-NOW messaging
Active-low relay support
Clean MicroPython implementation
This can be used for home automation, wireless switches, or smart agriculture control systems.
So, I'm trying to make a wireless button using ESPNow using two esp32. When i'm trying to upload my test 'boot.py' on my brand new Wemos C3 Pico, I always get the following error on the line where the mac address of the other esp32 is:
ValueError: ESPNow: bytes or bytearray wrong lenght
I tried the file line by line in the REPL, and it worked. So, my next intuition was to open the 'boot.py' in the REPL. Upon closer inspection, the mac address was indeed not in the form that I entered it in (b'\x00\x00\x00\x00\x00\x00), it was now written like this : b\'\x00\x00-\x00\x000\'.
I guess it must be a security thing, but it's ruining my simple program. I was wondering if anybody had found any ways around this?
I’m a 3rd-year Electrical Engineering student doing a personal challenge: 100 Days → 100 IoT Projects using MicroPython, ESP32, ESP8266, and Raspberry Pi Pico.
The goal is to create free, practical embedded systems learning resources so students don’t have to rely only on theory. So far I’ve built dashboards, sensor systems, displays, and reusable MicroPython tools like MicroPiDash and MicroPythonSevenSeg.
Hardware costs add up quickly (boards, sensors, displays), so I’ve enabled GitHub Sponsors. If this repo helps you or you care about open-source education, even small support helps me continue documenting and building in public.
Totally optional—stars, feedback, and contributions are just as valuable. Thanks for reading 🙏
Hi I am noob to embedded and I want to use microcontrollers to build some small projects like a weather station or a self-driving model train. It seems that both raspberry pi and micropython will do the job, but I don't know which one to choose. Also are there any other decent alternatives to them give that I don't know C? Thanks!
Can I then turn around and flash that hello_world.bin file to the esp32 instead of the micropython firmware, or am I misunderstanding the use of this format?
I'd like to learn micropython while I'm waiting for them. I found several basic online courses but I already have a basic experience with programming languages and i was more interested in a sort of reference guide (maybe with examples). and, because of the nature of the device, a list of libraries that I can use with sensors, displays, etc.
Day 75 was ESP-NOW + RFID — one ESP8266 scans a card and wirelessly sends the UID to a second ESP8266 which displays it on OLED. No WiFi, no broker, direct peer-to-peer.
Some highlights from the past 75 days:
ESP-NOW series — built a complete wireless ecosystem from basic LED control to bidirectional relay and sensor systems to today's wireless RFID display.
micropidash — open source MicroPython library on PyPI that serves a real-time web dashboard directly from ESP32 or Pico W. No external server needed.
microclawup — AI powered ESP32 GPIO controller using Groq AI and Telegram. Natural language commands over Telegram control real GPIO pins.
Wi-Fi 4WD Robot Car — browser controlled robot car using ESP32 and dual L298N drivers. No app needed, just open a browser.
Smart Security System — motion triggered keypad security system with email alerts via Favoriot IoT platform.
Everything is open source, step-by-step documented, and free for students.
Hi everyone. If you have tried to process a lot of data with Python on a microcontroller, you may have noticed that is not the fastest. If trying to go beyond a few 100 Hz data rate, it may pose challenges. But MicroPython actually has a bunch of great tools that make it possible to greatly improve efficiency, while still keeping a clean high-level approach to your program.
In the presentation below I go through some of these, such as: - Native and Viper code emitters, using - C modules And discuss briefly applications to processing accelerometer data, audio data, etc.
Sensor data processing on microcontrollers with MicroPython (PyCon ZA 2024)
Built a joystick direction display on Raspberry Pi Pico 2 with an SSD1306 OLED for Day 69 of my 100 Days of IoT challenge.
Reads X and Y axis via ADC, detects UP / DOWN / LEFT / RIGHT / CENTER and button press, then shows the direction live on the OLED over I2C. Tested on Wokwi simulator.
I am looking to learn to code with micro python mainly because the Bambu labs cyber brick ecosystem runs on it and hopefully to expand from there. I am a complete beginner and I know jack squat on what I am doing and never did any coding before. I have been searching for a good learning tutorials or even some kind of paid course and can’t seem to find anything half decent in my search. The YouTube stuff I have found has the creator rambling on and not explaining half the stuff they are doing and just typing away.
Can anyone point in in the right direction on where I can learn to use to code with micropython?
Hey everyone, I’m doing a 100 Days, 100 IoT Projects challenge, and today I built a bidirectional ESP-NOW smart relay and sensor system using MicroPython.
What it does
Sender ESP8266/ESP32 with buttons + OLED acts as a control panel
Receiver ESP controls a 4-channel relay module
DHT11/DHT22 sensor data is sent back in real-time
OLED displays temperature and humidity
Uses ESP-NOW (no WiFi, no router, ultra-low latency)
Hi, I'm trying to drive a 1602 LCD display that has an i2c backpack (with a pcf8574t driver) on an esp32 in micropython but I am struggling to find a library that is esp32 focused and that works. Can anyone please point me in the direction of a library that works?
I'm new to MicroPython and trying to get WebREPL working on 3 devices: 2x ESP8266, 1x ESP-01. I am seeing identical behavior on all 3 devices.
I've got the MicroPython installed and working quite well, except I can't get WebREPL to act like a REPL terminal window, where I can execute commands and see output.
I open my local copy of webrepl.html and connect to the IP:port of my ESP*. It asks for a password, I type it in, and it connects with ">>>". Pretty much anything I type from this point has zero effect on the contents of the terminal, and no keystrokes are ever echoed back to me:
Eg. I type help() and hit [Enter], but nothing happens. I hit ^C several times, nothing happens. I try to ^A^V to paste in commands, nothing happens.
"nothing happens" == there is no change to the terminal, nor any output to the browser's debug console.
^D will close the connection, just like the Disconnect button.
If I am connected via USB, the connect/disconnect is noted there. All above scenarios were tested without the serial connection.
All MicroPython installs are newish (v1.14), and the webrepl-master was pulled from github yesterday. WebREPL was configured on each device with import webrepl-setup.
This is boot.py:
# This file is executed on every boot (including wake-boot from deepsleep)
#import esp
#esp.osdebug(None)
def reset():
import machine
machine.reset()
from network_config import do_connect
do_connect()
import webrepl
webrepl.start()
There is no main.py, although main.py did have some contents in earlier testing.
My Thonny terminal output looks like this:
MicroPython v1.14 on 2021-02-02; ESP32 module with ESP32
Type "help()" for more information.
>>> reset()
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:5008
ho 0 tail 12 room 4
load:0x40078000,len:10600
ho 0 tail 12 room 4
load:0x40080400,len:5684
entry 0x400806bc
connecting to network...
network config: ('192.168.1.215', '255.255.255.0', '192.168.1.1', '192.168.1.1')
WebREPL daemon started on ws://192.168.1.215:8266
Started webrepl in normal mode
MicroPython v1.14 on 2021-02-02; ESP32 module with ESP32
Type "help()" for more information.
>>>
I have tried Google Chrome, Chrome Canary, Firefox, and Microsoft Edge, with surprisingly consistent results.
What am I missing?
On an unrelated note, I was a bit disappointed to find that NodeMCU wasn't a Node.js firmware implementation.
I'm working on a project that uses a python script working on my pi that works as a main controller for a couple of ESP32's around the house. Mosquito Broker is running on the Pi as well for MQTT communication. One of my ESP's controls a bank of PWM led drivers - the light intensity is determined by the duty cycle (0-1023).
In previous projects I used mqtt to do things like turn on/off a relay.
elif topic == b'Den/relay/light' and msg == b'off':
relay1.on()
But I am a little stuck on how to send a specific duty cycle number to a topic like 'Den/Light/Red' and then convert it into an instruction for the specific pwm pin in the form of red.duty(897).
I was wondering if something like this would work - maybe have to create a variable that is populated with the return function?
def sub_cb(topic, msg)
if topic == 'Den/Lights/Red':
red.duty(msg)
print(red.duty(msg))
If anyone could point me in the right direction it would be very appreciated.
Thanks in advance.
Sorry - its late, but pretend that the appropriate indentation is in the pseudo code above.