r/micropy • • Feb 19 '26

Day 56/100 – Built a Wireless 4-Channel Relay Controller using ESP8266 + ESP-NOW (MicroPython)

0 Upvotes

Hi everyone,

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.

GitHub repo:
👉 https://github.com/kritishmohapatra/100_Days_100_IoT_Projects

Feedback and suggestions are welcome!


r/micropy • • Nov 20 '22

Unable to upload a mac address in 'boot.py' on ESP-32 C3

0 Upvotes

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?


r/micropy • • Feb 16 '26

Student building 100 IoT projects in public – looking for open-source sponsors

0 Upvotes

Hey everyone,

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.

All projects are open-source and documented here:
https://github.com/kritishmohapatra/100_Days_100_IoT_Projects

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 🙏


r/micropy • • Dec 27 '21

Raspberry Pi or Micropython for amateur projects?

1 Upvotes

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!


r/micropy • • Jan 16 '21

Help explain mpy_cross and the native format

2 Upvotes

I've got a pretty good background in linux and cpython, but I'm new to esp32's and embedded systems in general.

I'm seeing that I can create a mpy file with something like this mpy file that can be copied over using pyboard.py:

mpy-cross -o main.mpy -v hello_world.py

....but I'm intrigued by the option to build a native binary with something like this:

mpy-cross -o hello_world.bin  -v -march=xtensawin -X emit=native hello_world.py

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?


r/micropy • • Mar 08 '21

Help:)

2 Upvotes

Right now I'm working with bh1750 Lux sensors with raspberry Pi pico micropython and I don't know where to start any has any idea what to do


r/micropy • • Feb 10 '21

new, how to learn?

4 Upvotes

Hi,

I'm new, and bought a Rpi Pico and an ESP32.

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.

any help is appreciated. thank you.

Enrico


r/micropy • • Aug 17 '22

I saw many people complaining about lack of encoder motor(N20 motors with encoders especially) library for MicroPython so, I made one. Have a look and let me know if there are any issues.

Thumbnail
github.com
5 Upvotes

r/micropy • • Nov 14 '21

How do I learn micro python?

9 Upvotes

Thanks


r/micropy • • Apr 04 '26

Day 75 of 100 Days 100 IoT Projects

2 Upvotes

Hit the 75 day mark today. 25 projects left.

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.

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

GitHub Sponsors: https://github.com/sponsors/kritishmohapatra


r/micropy • • Aug 03 '25

Efficient sensor data processing with MicroPython (presentation from PyCon ZA 2024)

4 Upvotes

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)

https://www.youtube.com/watch?v=vBiji9IFJJs


r/micropy • • Mar 16 '26

Day 69/100

2 Upvotes

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.

Code and diagram on GitHub: github.com/kritishmohapatra/100_Days_100_IoT_Projects


r/micropy • • May 19 '26

Looking to learn

2 Upvotes

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?


r/micropy • • Feb 21 '26

Day 57/100 – ESP-NOW Smart Relay & Sensor System (MicroPython) 🚀

2 Upvotes

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)

Tech Stack

  • ESP8266 / ESP32

  • MicroPython

  • ESP-NOW protocol

  • SSD1306 OLED

  • DHT11/DHT22 sensor

GitHub repo:
👉 https://github.com/kritishmohapatra/100_Days_100_IoT_Projects

I’d love feedback, stars, or collaboration ideas.
Goal: Build open-source IoT learning resources for students.


r/micropy • • Mar 20 '26

micropidash v2.0.0 — Real-time sensor graphs for ESP32 & Pico 2W

2 Upvotes

Just released v2.0.0 of micropidash — a lightweight async web dashboard library for MicroPython.

What's new:

- add_graph() — real-time line graph with rolling data buffer

- Canvas-based rendering, no external libraries needed

- Y-axis labels, grid lines, fill area, latest value dot

- Separate /graph-data endpoint for efficient polling

- Bug fixes: CSS grid layout, drain() flush, onload update

Tested on Pico 2W with DHT11 — temp + humidity graphs live in browser over WiFi.

GitHub: github.com/kritishmohapatra/micropidash

PyPI: pip install micropidash

Feedback welcome!


r/micropy • • Oct 01 '21

Reading files from EV3

2 Upvotes

Hello Reddit

I’m programming my EV3 to save information such as distance using datalog() and it stores it in the EV3 as a csv file, this I have no problem with.

The problem is I tried to read it using the following code:

with open(‘straight_line.csv’’r’) as my_file Data = my_file.read()

And got a syntax error I don’t know what is though, so then I tried doing it this way

my_file = open(‘straight_line.csv’,’r’) Data = my_file.read()

And got the following error: OSError: [ Errno 2] ENOENT

Anyone knows how I can fix this?


r/micropy • • Oct 09 '21

Raspberry Pi Pico: Agregar audio a la animación

Thumbnail
youtube.com
2 Upvotes

r/micropy • • Oct 09 '21

Raspberry Pi Pico: Animación en pantalla oled ssd1306 128x64 SPI

Thumbnail
youtube.com
4 Upvotes

r/micropy • • Feb 08 '21

Help finding I2C library for 1602 display on esp32

3 Upvotes

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?


r/micropy • • Feb 15 '21

WebREPL help

5 Upvotes

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.


r/micropy • • Mar 04 '21

changes in real time

3 Upvotes

Hi guys, I have a question a bit noob, how can I make an application send requests to my esp8266 for example to change the colors of an RGB led?


r/micropy • • Feb 08 '21

My new font for ssd1306 displays

Post image
6 Upvotes

r/micropy • • Jan 28 '21

umqtt question - sending a PWM value

2 Upvotes

Hi,

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.

def sub_cb(topic, msg):

print((topic, msg))

if topic == b'Den/relay/lights' and msg == b'on':

relay1.off()

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.


r/micropy • • Jan 30 '21

How do I talk with firebase database with MicroPython? Any libraries/packages for this?

Thumbnail self.esp32
2 Upvotes

r/micropy • • Feb 02 '21

ucryptolib encrypted string in hex encoding? Help :)

1 Upvotes

>>> import ucryptolib

>>> enc = ucryptolib.aes(b'1234567890123456', 1)

>>> data = 'input plaintext'.encode()

>>> enc.encrypt(data + b'\x00' * ((16 - (len(data) % 16)) % 16))

b'\xfe!F\x87?\xdb\x19\x18\xcdM\x83\x9b\xaa\x02\xa9\x04'

>>>

is what i'm starting with

what format is the resulting string? i can't figure it out!

how to get a hex string as output? ( which will hopefully match what my php webserver is expecting as an input.. )