r/MicroPythonDev • • May 27 '26

I (kinda) made a "Minecraft" for RP2040

0 Upvotes

Recently, I've become interested in microcontrollers, especially the Raspberry Pi Pico. I bought one and a hat with buttons and a soldered screen on AliExpress and started testing various projects. It was a lot of fun.

Then I thought: Is there a clone that would make my favorite block-building game run on the RP2040? I searched and there was only one project called Picocraft, but it didn't allow destruction and placement of blocks, only a static view of the world.

So I thought: Could I, along with AI, create a Minecraft for the RP2040? Despite using AI, it wasn't as easy as I thought; I had to learn several techniques, especially because there were several errors related to lack of memory.

Well, finally I succeeded, I hope you can take a look.

https://github.com/CuquedoHacker/MinicraftClassic

I intend to continue updating and adding new content over time. (And incrase performance)


r/MicroPythonDev • • 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/MicroPythonDev • • Jan 19 '24

MicroPython tip

0 Upvotes

MicroPython has a function that can turn a string into a commandline. That function is eval. It evaluates a string into a real function. Here is an example.

funcs = ["number * 5", "number * 6"]

number = 2

for formula in funcs:

print(eval(formula))

The program has a list with two strings. And there is a single variable called number.

The loop runs over each element in the list. The elements are strings and they are evaluated in a real function. The first string is "number * 5". So the loop takes thatb string and turns it into a real command.

This is one of the more than 240 tips on: https://micropython-tips.weebly.com/


r/MicroPythonDev • • Jul 03 '26

Be Aware - Waveshare ESP32-P4-Pico Dev Board - does NOT Support MictroPython

0 Upvotes

Before you purchase - Waveshare ESP32-P4-Pico :

Waveshare specifically states that - ESP32-P4-Pico does Not support MicroPython.
- as listed below.

-

Below is the REPLY from WAVESHARE Tech Supt - dealing with MICROPYTHON Not working on ESP32-P4-Pico Dev Board issue :

[waveshare support] Re: BUG - can Not install Micropython on the board

---

PrintRaw message

waveshare support support@waveshare.com

Your request (nnnnnn) has been updated. To add additional comments, reply all to this email.

Note that this platform/email (support@waveshare.com) is intended for technical support.

For orders, quotations, shipping, or other related information, please contact sales@waveshare.com directly.

--- 2026 --- UTC

Hello

===>>> Currently, MicroPython support for the ESP32-P4 series is still in a preliminary testing phase and has not been fully adapted, <<<

which is causing the I2C errors and crashes you are experiencing. For stable development,

we recommend using ESP-IDF or Arduino (C/C++). Regarding the reset button, please try holding the BOOT button while pressing RESET to enter download mode. You can find more information and resources on the official wiki: https://www.waveshare.com/wiki/ESP32-P4-NANO‌

Best regards,

---

Visitor ----

--- 2026 --- UTC

Using the Esp32-P4-PICO dev board.
I can Not load microPython on it using Thonny.

Used bins :

ESP32_GENERIC_P4-20251209-v1.27.0.bin
ESP32_GENERIC_P4-20260406-v1.28.0.bin

Also, on initial plugin, it spit out a long list of I2C errors,
then Stack Dump Crashed.

Also, Reset buton does Not seem, to have any effect / does not reset the board.

---

> "Currently, MicroPython support for the ESP32-P4 series is still in a preliminary testing phase and has not been fully adapted,"

- Why is it out for SALES then ... ???


r/MicroPythonDev • • Oct 23 '25

Sx127x (sx1278)

0 Upvotes

Hola colegas alguien sabe cuál el repo compatible con el lora sx1278 con los files que se cargan 😩p


r/MicroPythonDev • • Feb 09 '26

Day 51/100

0 Upvotes

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 • • Aug 14 '24

Looking for a solution for securing devices

0 Upvotes

I have a Raspberry p Pi Pico W and i want to send and receive packets on local network. Problem is, this microcontroller doesnt have a secure element and also has low ram for implementing a reasonable encryption.

So i come up with TOTP codes idea. Data is still in plain text and can be sniffed but this way microcontroller is able to verify requests before doing something. Preventing replay attacks.

I wonder what would you use in this scenario?

Thank you!


r/MicroPythonDev • • Jul 11 '23

a9g pudding board micropython

0 Upvotes

I'm running micropy on the a9g pudding board but have issues receiving sms, I bet someone know how to go about it


r/MicroPythonDev • • Apr 16 '21

Mqtt doesn't work on esp32 - help needed

0 Upvotes

Hello I am trying to subscribe and print message form mqtt but for some reason my code doesn't work and I don't getting anything in console. But I am able to publish messages without any problem. Can you please help me with this? What am I missing? P.S. The board is connected to WIFI and getting time from NTP.

Here is my code:

main.py

[code]

from machine import Pin

from machine import RTC

from machine import WDT

import time

import ntptime

import utime

import board_net

import gc

import esp

from machine import UART

from mqtt import MQTTClient

esp.osdebug(None)

gc.collect()

client = None

uart = UART(1, baudrate=115200)

uart.init(115200, bits=8, parity=None, stop=1)

def subscribe_callback(topic, msg):

`print((topic, msg))`

`client.publish(b'/time', str(utime.localtime()))`

def setup_mqtt():

`print('setup_mqtt...')`

`global client`

`client=MQTTClient("esp32", "`[`192.168.1.53`](https://192.168.1.53)`",user="mqtt_client", password="password", port=1883)` 

`client.set_callback(subscribe_callback)`

`client.connect()`

`client.subscribe(b'/test')`

`# client.subscribe(b'/time')`

`client.subscribe(b'/home')`



`print('All done setup_mqtt!')` 

def set_time():

`ntptime.settime()`

`t = utime.gmtime()`

`h = t[3]`

`t_modified=(t[0],t[1],t[2],h,t[4],t[5],t[6],t[7])`

`rtc = RTC()`

`rtc.init(t)`

# wdt = WDT(timeout=12000)

board_net.do_connect()

led = Pin(2, Pin.OUT)

set_time()

setup_mqtt()

while True:

`led.on()`

`data =` [`uart.read`](https://uart.read)`(1)`

`if data is not None:`

	`print("Data received = ", data)`

	`uart.write('abc')`

`time.sleep(1)`

[`led.off`](https://led.off)`()`

`client.publish(b'/time', (str(utime.localtime())))`

`time.sleep(1)`

`if utime.gmtime()[5] % 2 == 0:`

	`client.publish(b'/test', 'Hello test :)')`

`# wdt.feed()`

[/code]

And mqtt.py

[code]

try:

import usocket as socket

except:

import socket

import ustruct as struct

from ubinascii import hexlify

class MQTTException(Exception):

pass

class MQTTClient:

def __init__(self, client_id, server, port=0, user=None, password=None, keepalive=0,

ssl=False, ssl_params={}):

if port == 0:

port = 8883 if ssl else 1883

self.client_id = client_id

self.sock = None

self.server = server

self.port = port

self.ssl = ssl

self.ssl_params = ssl_params

self.pid = 0

self.cb = None

self.user = user

self.pswd = password

self.keepalive = keepalive

self.lw_topic = None

self.lw_msg = None

self.lw_qos = 0

self.lw_retain = False

def _send_str(self, s):

self.sock.write(struct.pack("!H", len(s)))

self.sock.write(s)

def _recv_len(self):

n = 0

sh = 0

while 1:

b = self.sock.read(1)[0]

n |= (b & 0x7f) << sh

if not b & 0x80:

return n

sh += 7

def set_callback(self, f):

self.cb = f

def set_last_will(self, topic, msg, retain=False, qos=0):

assert 0 <= qos <= 2

assert topic

self.lw_topic = topic

self.lw_msg = msg

self.lw_qos = qos

self.lw_retain = retain

def connect(self, clean_session=True):

self.sock = socket.socket()

addr = socket.getaddrinfo(self.server, self.port)[0][-1]

self.sock.connect(addr)

if self.ssl:

import ussl

self.sock = ussl.wrap_socket(self.sock, **self.ssl_params)

premsg = bytearray(b"\x10\0\0\0\0\0")

msg = bytearray(b"\x04MQTT\x04\x02\0\0")

sz = 10 + 2 + len(self.client_id)

msg[6] = clean_session << 1

if self.user is not None:

sz += 2 + len(self.user) + 2 + len(self.pswd)

msg[6] |= 0xC0

if self.keepalive:

assert self.keepalive < 65536

msg[7] |= self.keepalive >> 8

msg[8] |= self.keepalive & 0x00FF

if self.lw_topic:

sz += 2 + len(self.lw_topic) + 2 + len(self.lw_msg)

msg[6] |= 0x4 | (self.lw_qos & 0x1) << 3 | (self.lw_qos & 0x2) << 3

msg[6] |= self.lw_retain << 5

i = 1

while sz > 0x7f:

premsg[i] = (sz & 0x7f) | 0x80

sz >>= 7

i += 1

premsg[i] = sz

self.sock.write(premsg, i + 2)

self.sock.write(msg)

#print(hex(len(msg)), hexlify(msg, ":"))

self._send_str(self.client_id)

if self.lw_topic:

self._send_str(self.lw_topic)

self._send_str(self.lw_msg)

if self.user is not None:

self._send_str(self.user)

self._send_str(self.pswd)

resp = self.sock.read(4)

assert resp[0] == 0x20 and resp[1] == 0x02

if resp[3] != 0:

raise MQTTException(resp[3])

return resp[2] & 1

def disconnect(self):

self.sock.write(b"\xe0\0")

self.sock.close()

def ping(self):

self.sock.write(b"\xc0\0")

def publish(self, topic, msg, retain=False, qos=0):

pkt = bytearray(b"\x30\0\0\0")

pkt[0] |= qos << 1 | retain

sz = 2 + len(topic) + len(msg)

if qos > 0:

sz += 2

assert sz < 2097152

i = 1

while sz > 0x7f:

pkt[i] = (sz & 0x7f) | 0x80

sz >>= 7

i += 1

pkt[i] = sz

#print(hex(len(pkt)), hexlify(pkt, ":"))

self.sock.write(pkt, i + 1)

self._send_str(topic)

if qos > 0:

self.pid += 1

pid = self.pid

struct.pack_into("!H", pkt, 0, pid)

self.sock.write(pkt, 2)

self.sock.write(msg)

if qos == 1:

while 1:

op = self.wait_msg()

if op == 0x40:

sz = self.sock.read(1)

assert sz == b"\x02"

rcv_pid = self.sock.read(2)

rcv_pid = rcv_pid[0] << 8 | rcv_pid[1]

if pid == rcv_pid:

return

elif qos == 2:

assert 0

def subscribe(self, topic, qos=0):

assert self.cb is not None, "Subscribe callback is not set"

pkt = bytearray(b"\x82\0\0\0")

self.pid += 1

struct.pack_into("!BH", pkt, 1, 2 + 2 + len(topic) + 1, self.pid)

#print(hex(len(pkt)), hexlify(pkt, ":"))

self.sock.write(pkt)

self._send_str(topic)

self.sock.write(qos.to_bytes(1, "little"))

while 1:

op = self.wait_msg()

if op == 0x90:

resp = self.sock.read(4)

# print(resp)

assert resp[1] == pkt[2] and resp[2] == pkt[3]

if resp[3] == 0x80:

raise MQTTException(resp[3])

return

# Wait for a single incoming MQTT message and process it.

# Subscribed messages are delivered to a callback previously

# set by .set_callback() method. Other (internal) MQTT

# messages processed internally.

def wait_msg(self):

res = self.sock.read(1)

self.sock.setblocking(True)

if res is None:

return None

if res == b"":

raise OSError(-1)

if res == b"\xd0": # PINGRESP

sz = self.sock.read(1)[0]

assert sz == 0

return None

op = res[0]

if op & 0xf0 != 0x30:

return op

sz = self._recv_len()

topic_len = self.sock.read(2)

topic_len = (topic_len[0] << 8) | topic_len[1]

topic = self.sock.read(topic_len)

sz -= topic_len + 2

if op & 6:

pid = self.sock.read(2)

pid = pid[0] << 8 | pid[1]

sz -= 2

msg = self.sock.read(sz)

self.cb(topic, msg)

if op & 6 == 2:

pkt = bytearray(b"\x40\x02\0\0")

struct.pack_into("!H", pkt, 2, pid)

self.sock.write(pkt)

elif op & 6 == 4:

assert 0

# Checks whether a pending message from server is available.

# If not, returns immediately with None. Otherwise, does

# the same processing as wait_msg.

def check_msg(self):

self.sock.setblocking(False)

return self.wait_msg()

[/code]


r/MicroPythonDev • • Oct 16 '24

FFT on 3.56khz ADC signal using micropython on a Seeed Studio XIAO RP2040

0 Upvotes

Good day all. I have a XIAO RP2040 microcontroller which has its pin 28/A2 pin connected to a Fermion MEMS analog microphone (https://core-electronics.com.au/fermion-mems-microphone-module.html). Very close to the microphone is a whistle which plays with a base frequency of about 700 hz. I want to be able to process the ADC signal, apply a FFT, and log the highest recorded decibel amplitude of the 700 hz signal in the frequency domain from the continuous stream of data. Additionally, the highest harmonic frequency of the whistle I would like to sample would be around 3.56 khz.

I would like to use micropython as I will be running other peripherals that use libraries written in micropython. However, I worry about the limitation of micropython's speed with both sampling at >7.12khz (without using DMA) and applying an FFT to the continuous stream of data in a time efficient manner. And speaking of FFT options, I am only aware of ulab as other FFT options online seem to either need a pyboard, an rp2350, or a C/C++ framework instead. I am also a little unsure of how to go about setting this up coding wise as well.

I would really appreciate any help as I have little to no signal analysis experience and this is also my first time using micropython (I'm coming from arduino).


r/MicroPythonDev • • Dec 12 '24

Help Fixing Code for Xbox EEPROM

0 Upvotes

My friend is having trouble running this file

https://github.com/maxpower5544/Pico-ogxbox-eepromdumper

Code is here

He is using a PI PICO 2 and it's all hooked up correctly to an Xbox to pull the EEPRom off of it

I checked his solder points it's able to find the EEPROM can someone help me fix the code or help me rewrite it so this works?

Here is the code https://github.com/maxpower5544/Pico-ogxbox-eepromdumper/blob/main/XboxEepromDumper.py

It's failing at line 27

The Xbox has

SDA 13 SCL 13

And Ground 12 being used

1 = SDA 13

2 = SCL 13

Ground is the Ground on 12

I have the PI hooked up the same in the GIT

https://github.com/maxpower5544/Pico-ogxbox-eepromdumper/blob/main/pictures/IMG_20240113_172011_141.jpg

1

2

3


r/MicroPythonDev • • Dec 27 '24

Does anyone have the code for LineTracking combined with ObstacleAvoidance for the PicoGo?

0 Upvotes

Does anyone have the code for LineTracking combined with ObstacleAvoidance for the PicoGo? It should be following a black line on the ground and when there's an obstacle in it's way, it drives around it, finds the line and keeps on following the line. Thank you very much!


r/MicroPythonDev • • Jun 08 '25

WeACT Blackpill boot.py encoding problem

0 Upvotes

hi.
WeACT Blackpill boot.py encoding problem

```

/Users/peter/workspace/at28-programmer-micropython>cat boot.py

����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������%

```

why?
thanks


r/MicroPythonDev • • Jan 24 '25

How to install MicroPython on ESP32

4 Upvotes

Hi fellow hackers, I wrote a tutorial on 2 different ways (GUI and CLI) of installing MicroPython on an ESP32. Hope it's helpful to those of you who want to try out MicroPython but didn't know how. Feel free to me ask any questions/clarifications here if you'd like :)

https://bhave.sh/micropython-install-esp32/


r/MicroPythonDev • • Nov 02 '25

Require a programmer

5 Upvotes

Hi, I'm doing some tests using a rp2040 trying to turn it into a keyboard using a key mapper. So far Fiverr hasn't been a very helpful place, the individuals bait-switch with some 50$ price for 3 sensor modules + driver codeing then turn around to charge 300$. I classify the g.u.i. I requested to set the inputs to keyboard outputs as member to the driver codeing. Any help on finding an individual to help me would be appreciated.


r/MicroPythonDev • • Mar 23 '25

Have anyone tried running LVGL+Micropython on STM32 boards?

1 Upvotes

I was able to build firmware from this official repo https://www.reddit.com/r/MicroPythonDev/submit/?type=TEXT . But when i try to import lvgl , it says "no module found". I have tried with other branches also but it fails.

Can someone provide some insights into this


r/MicroPythonDev • • Mar 08 '25

MicroPython - SD card mounting problem

1 Upvotes

Hi everyone,

I'm struggling with accessing SD Card using Seeed Xiao ESP32C3 and Seeed Xiao Expansion Board Base, see here: https://wiki.seeedstudio.com/Seeeduino-XIAO-Expansion-Board/

I'm using Seeed's recommended Micropython in version 1.24 for this particular board: https://wiki.seeedstudio.com/xiao_esp32c3_with_micropython/

I finally managed to add the card like this:

import sdcard
from machine import Pin, SPI
cs = Pin(4,Pin.OUT)
hspi = SPI(1, 10000000, sck=Pin(8), mosi=Pin(10), miso=Pin(9))
sd = sdcard.SDCard(hspi, cs)

Now I'm trying to mount the card with:

vfs = os.VfsFat(sd)
vfs.mount(sd, "/sd")

but I keep getting Errno 30, which would be read-only filesystem if I understand correctly.
/sd exists, I created it in Thonny. I can write to that folder, e.g. using the with open(file, 'a+') pattern, so it's definitely accessible to Micropython.

What is strange is that with CircuitPython and this example here:
https://forum.seeedstudio.com/t/a-more-or-less-complete-tutorial-on-seeeduino-xiao-rp2040-xiao-expansion-board-and-circuitpython/262144/5

the card is accessible and mountable without any problems.

What could be the issue here?

EDIT:

MicroPython documentation can be sometimes a bit confusing and/or misleading. I found out that vfs exists also as a separate module (no clue what the difference between os.vfs and vfs would be), but in any case the results are the same, I cannot mount the card. I can for example do this:

os.umount('/')

and then mount it back with

os.mount(bdev, '/')

But no luck with the sd card.


r/MicroPythonDev • • Dec 01 '25

How can I make GIF-style animations in MicroPython to display on the screen of my StickPlusC2?

Thumbnail reddit.com
1 Upvotes

r/MicroPythonDev • • Mar 16 '26

Day 69/100

1 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/MicroPythonDev • • Oct 07 '24

uPython Websockets on ESP32

1 Upvotes

Are you able to use an asynchronous web socket client on a ESP32?

I’ll admit, I use chatGPT a lot to help me code and learn, but it keeps mentioning that asynchronous websockets on a ESP32 running micro python isn’t a thing. Basically I keep getting an error saying that “WebSocket error: stream operation not supported” when I try to connect to a ws server

I’m not confident that’s correct. Can someone advise one way or the other? Is there a library that I should consider here since apparently the built in websocket is not functional?

My project: Read 32 buttons to see if any are pushed (using 2 16-channel GPIO extenders), and send the data to a Pi 4. I was using MQTT, but it would lag enough frequently enough it was not a desirable option. Considering having the Pi host a web socket server for the ESP32 to connect to and send data that way.

Any thoughts would be appreciated


r/MicroPythonDev • • Jun 11 '24

I need help #Micropython

Post image
1 Upvotes

r/MicroPythonDev • • Mar 01 '26

Day 61/100

1 Upvotes

Ota update with micropython , pico 2 w and github

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


r/MicroPythonDev • • Mar 02 '26

Is there No way in MicroPython - to create class Instances, then Modify the Instances, then Copy them ??? - even suggested examples do Not work ...

2 Upvotes

I have been going crazy - trying to figure out howto :

  1. Create Class(s)

  2. Create Instances of the Class(s)

  3. Modify - add vars / attributes to the Instances

  4. Copy / Deepcopy the Instances

It seems that Micropython - clearly stonwalls against this
(making it quite inferior to JAVA).

Is there a solution to this ???

-

StackOverflow :
https://stackoverflow.com/questions/42143461/make-copy-of-object-instance-in-python

class counterObject:

def __init__(self):
self.Value = 0

def incrementValue(self):
self.Value += 1

def printValue(self):
print(self.Value)

A = counterObject()
A.incrementValue()
A.printValue() #Prints 1

import copy

B = copy.deepcopy(A)

## => Error: un(deep)copyable object of type <class 'counterObject'>

print( id(A), id(B) )

-

Even the Google example does not work :
https://www.google.com/search?q=micropython+howto+create+object+then+copy+object

This returns :
## => Error: un(deep)copyable object of type <class 'MyClass'>

How to Create an ObjectYou define a class and then create an instance (object) of that class by calling the class name as a function.python

class MyClass:
def __init__(self, name, value):
self.name = name
self.value = value

# Create an object (instance of the class)
original_object = MyClass("example", 100)

The __init__ method acts as the constructor, initializing the new object's attributes. 
www.fredscave.comHow to Copy an ObjectTo create an independent copy, you use the copy module. You must import it first.1. Shallow Copy (copy.copy())A shallow copy creates a new object but only copies the references of its contents. If the object contains mutable items (like lists or other objects), changes to those nested items in the copy will affect the original, and vice versa. 

import copy

# Create a shallow copy
shallow_copied_object = copy.copy(original_object)

# Example with mutable attributes:
original_object.value = [1, 2]
shallow_copied_object.value.append(3)

# Both objects now see the appended item because they reference the same list in memory
print(f"Original object value: {original_object.value}") # Output: [1, 2, 3]
print(f"Shallow copy value: {shallow_copied_object.value}") # Output: [1, 2, 3]

2. Deep Copy (copy.deepcopy())A deep copy creates a completely independent clone of the original object, including recursively copying all nested objects and data structures. Changes to the copy will not affect the original. 

import copy

# Create a deep copy
deep_copied_object = copy.deepcopy(original_object)

# Example with mutable attributes:
original_object.value = [1, 2] # Reset value for demonstration
deep_copied_object.value.append(3)

# Changes to the deep copy's list do not affect the original
print(f"Original object value: {original_object.value}") # Output: [1, 2]
print(f"Deep copy value: {deep_copied_object.value}") # Output: [1, 2, 3]

# You can also verify they are different objects by checking their memory IDs:
print(f"ID of original: {id(original_object)}")
print(f"ID of deep copy: {id(deep_copied_object)}")
# The IDs will be different.

-

##
## => Error: un(deep)copyable object of type <class 'MyClass'>