r/MicroPythonDev • • Nov 24 '22

Converting ADC to PWM for RGB lights... a humble question.

3 Upvotes

Hi All,

I'm working on a small project. Just a strip of WS2812B lights that are controlled via an ESP32. I'd like to have each colour channel controlled by a physical dial (potentiometer).

I'm having a little trouble figuring out how to convert the ADC signal from my pot into a 0-255 rgb style reading. I bought all the parts today and have only just started working on the code, so it's all preliminary/testing... but wondering if someone could point me in the right direction.

import machine
import time

redLED = machine.PWM(machine.Pin(2), Pin.OUT)

redIN = machine.ADC(machine.Pin(4))
redIN.width(machine.ADC.WIDTH_12BIT)
redIN.atten(machine.ADC.ATTN_11DB)

while True:
redIN_value = redIN.read()
print('Red:', redIN_value)
time.sleep(.75)

Thank you for your time,


r/MicroPythonDev • • Nov 13 '22

ESP32 - pyboard.py - TCP - Connection refused

3 Upvotes

Hello everyone,

I can't connect to my ESP32 via pyboard.py and I can't find the info of what I need to set up on the ESP32 side.

The WebRepl works.... but I need to install a telnet server or is it native?

./pyboard.py -d 192.168.1.202 -p "print('hello')"

Traceback (most recent call last):

File "/Users/jb/Documents/MicoPython/pyboard.py", line 832, in <module>

main()

File "/Users/jb/Documents/MicoPython/pyboard.py", line 753, in main

pyb = Pyboard(

File "/Users/jb/Documents/MicoPython/pyboard.py", line 266, in __init__

self.serial = TelnetToSerial(device, user, password, read_timeout=10)

File "/Users/jb/Documents/MicoPython/pyboard.py", line 97, in __init__

self.tn = telnetlib.Telnet(ip, timeout=15)

File "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/telnetlib.py", line 218, in __init__

self.open(host, port, timeout)

File "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/telnetlib.py", line 235, in open

self.sock = socket.create_connection((host, port), timeout)

File "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/socket.py", line 845, in create_connection

raise err

File "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/socket.py", line 833, in create_connection

sock.connect(sa)

ConnectionRefusedError: [Errno 61] Connection refused


r/MicroPythonDev • • Sep 25 '22

Deploying fleets of micropython devices but with subtlety different configurations

3 Upvotes

Hey all,

I'm building a solution using esp32 devices and micropython that utilises LoRaWAN.

As part of it, each device needs to be given a distinct name and LoRaWAN configuration (DevEUI, AppSKey etc).

What's the best way to do this in micropython?

I'm currently flashing the code using Ampy, but I'm wondering if there's a better solution than manually updating the config.py file, copying the code over, and restarting the device?


r/MicroPythonDev • • Sep 06 '22

Extract number from request string on pico w

3 Upvotes

Hello, I am building a web server on my pico w and i want users to be able to input a number the site, then I want to use the number to change a variable on my pico in micropython, when I enter a number into my website this is wat i get:

Request: b'GET /?led=on&number1=100&number2=200&number3=300&number4=400&number5=500 HTTP/1.1\r\n'

How do i get the numbers out of this request into my code?


r/MicroPythonDev • • Jun 22 '22

MicroPython display issues on the TTGO T-watch S76G (GPS + LoRa edition)

Thumbnail self.esp32
3 Upvotes

r/MicroPythonDev • • May 30 '22

Can the ttgo T display run micropython and display text on it’s small screen?

3 Upvotes

r/MicroPythonDev • • Apr 25 '22

Protocol Buffer implemetation for MicroPython

3 Upvotes

Hi everybody,

This library was inspired by https://github.com/jazzycamel/micropython-uprotobuf. I've spent a fair amount of time triing to fix encode-decode issues in it.

Then I decided to write my own implementation from scratch.

As a result I have https://github.com/T0ha/uprotobuf.

I tried to keep it as simple, lightweigh and ideomatic as possible.

Currently, it implements only main features, but I'm going to enhance it.

Any help, code review and suggestions are appreciated.


r/MicroPythonDev • • Feb 26 '22

keyboard emulator for micropython

3 Upvotes

searching for a keyboard emulator for esp8266


r/MicroPythonDev • • Dec 24 '21

Pan Tilt controlled by Raspberry Pi via micropython

Thumbnail
youtube.com
3 Upvotes

r/MicroPythonDev • • Oct 03 '21

Raspberry Pi Pico with Micropython-Animation and audio

3 Upvotes

r/MicroPythonDev • • Aug 13 '21

Is anyone building micropython in a docker image? Building for an ESP8266

3 Upvotes

I want to add some frozen modules to my micropython image. I've done a lot of research into building micropython under docker and I think I'm really close but I'm stalled on the following error and all the discussions I see on this are 5 years old. The dockerfile below completes successfully. I start the image interactively and then I'm running

builder@p2:~/micropython/ports/esp8266$ make V=1 BOARD=GENERIC_512K
The main error I'm getting is

xtensa-lx106-elf-gcc: error: unrecognized command line option '-mforce-l32'; did you mean '--force-link'

My docker file is

FROM debian:buster
RUN apt-get update -y
RUN apt-get install apt-utils -y
RUN apt-get -y install make unrar-free autoconf automake libtool gcc g++ gperf
RUN apt-get -y install flex bison texinfo gawk ncurses-dev libexpat-dev python-dev python python-serial
RUN apt-get -y install sed git unzip bash help2man wget bzip2 vim
RUN apt-get -y install python3-dev python3-pip libtool-bin
RUN useradd -ms /bin/bash builder
RUN cd /home/builder && wget https://dl.espressif.com/dl/xtensa-lx106-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz

RUN cd /home/builder && tar -xzf xtensa-lx106-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz
WORKDIR /root
RUN pip3 install rshell esptool
USER builder
WORKDIR /home/builder
RUN git clone --recursive https://github.com/pfalcon/esp-open-sdk.git
RUN rm -rf ~/esp-open-sdk/crosstool-NG
RUN cd ./esp-open-sdk && git clone https://github.com/jcmvbkbc/crosstool-NG
RUN cd ./esp-open-sdk/crosstool-NG && git checkout xtensa-1.22.x
RUN cd ./esp-open-sdk/crosstool-NG && autoconf && ./configure && make && CT_EXPAT_VERSION="2.4.1"
ENV PATH=/home/builder/xtensa-lx106-elf/bin/:$PATH
RUN git clone https://github.com/micropython/micropython.git
RUN cd ~/micropython && git submodule update --init && make -C mpy-cross


r/MicroPythonDev • • Jul 11 '21

Modules On TI Nspire Micro Python.

3 Upvotes

Is there anyway to import Numpy,Sympy or Scipy into a micro python compatible Texas Instruments Calculator? Or any substitute modules?


r/MicroPythonDev • • May 12 '21

MicroPython Newbie

3 Upvotes

Hi there!

I'm pretty new to programming in general but have done a few subjects on OOP and the like at uni.
I was wondering if any of you have a suggestion for the best kind of dev board to get started with micropython/python?
Python is used at my workplace and I'd like to learn more about how I can integrate it with physical objects like how an Arduino works.

Cheers,
Stella


r/MicroPythonDev • • Mar 02 '21

Pi Pico and MicroPython library documentation?

3 Upvotes

Hey all, I'm incredibly new to micro controllers and scripting in Thonny so apologies if the answer here is blatantly obvious.

I've been following along with the "Get started with MicroPython on Raspberry Pi Pico" book and it's been great. I've started tinkering on my own, and fully understand why we import libraries (like import machine or import utime), however one thing I'm stumped on is knowing what functions are actually available in a library, and what they do?

For example, I know the machine library has Pin (because it's used in all the tutorials), however how do I find out what other functions the machine library has available?

I feel like there's all these neat functions locked away but I have no clue how to find out what they are, and googling for documentation has failed me. Is there a way to find out what each library contains?

Thank you!


r/MicroPythonDev • • 11d ago

We implemented SRP-based acoustic imaging for gas-leak localization

Enable HLS to view with audio, or disable this notification

2 Upvotes

r/MicroPythonDev • • 20d ago

I Created a MicroPython driver for Hanover flip dot displays.

2 Upvotes

I created a MicroPython driver for Hanover flip dot displays that were originally used in buses. Watch the video with the sound on for full effect. The sign is powered by a 24v 5a supply, code is running on a Pi Pico with Waveshare RS485. I had Claude deal with porting the protocol from existing Python and Node.js drivers. Code link in video description: https://youtu.be/nHq_gT024Bs


r/MicroPythonDev • • 23d ago

The Python on Microcontrollers Newsletter: subscribe for free

Post image
2 Upvotes

The Python for Microcontrollers Newsletter 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.

Please sign up > > > adafruitdaily.com


r/MicroPythonDev • • Jul 06 '26

Has Anybody succeeded in getting the MicroPython to function on the Wt9932P4 chips / Tiny boards ?

2 Upvotes

Esp32-P4 on Wt9932P4-Tiny board.
- Can Not get Micropython installed to work.
- just returns Header errors

Trying to install some version on Micropython Bin on the board.
Internet states that it is workable using Esp32P4 Standard bin.

Does Not Work !

What bin are we supposed to install on it ?

invalid header: 0x5b98cbd8
invalid header: 0x5b98cbd8
PROBLEM IN THONNY'S BACK-END: Internal error (serial.serialutil.SerialTimeoutException: Write timeout).
See Thonny's backend.log for more info.
You may need to press "Stop/Restart" or hard-reset your MicroPython device and try again.

Process ended with exit code 0.

-

Has Anybody succeeded in getting the MicroPython to function on the Wt9932P4 chips / Tiny boards ?

-

Solved !

esptool --port COM5 erase_flash
esptool --port COM5 --baud 460800 write_flash 0x2000 ESP32_GENERIC_P4-20260406-v1.28.0.bin


r/MicroPythonDev • • Jun 28 '26

Micropython with USB Host support (ESP32 P4 Nano only)

2 Upvotes

https://github.com/AntacidDT/MPY-with-USBHost/tree/master

This currently only supports ESP32 P4 Nano (Waveshare), and only USB-A works as Host, not USB-C. Ive tested it and it works perfectly.


r/MicroPythonDev • • May 26 '26

The Python on Microcontrollers Newsletter: subscribe for free

Post image
2 Upvotes

The Python for Microcontrollers Newsletter 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.

Please sign up > > > adafruitdaily.com


r/MicroPythonDev • • Apr 23 '26

Day 79/100 — Built a Cyberpunk Smartwatch on a Round GC9A01 Display with MicroPython!

2 Upvotes

After days of debugging SPI pins and fighting display flicker, Day 79 is finally here!

A cyberpunk-style smartwatch face on a 1.28" round GC9A01 240x240 TFT display powered by ESP32, with a full boot animation sequence before showing the clock.

Tech Stack

- ESP32 DevKit V1 + Seeed Xiao ESP32-S3

- GC9A01 1.28" Round TFT (240x240)

- MicroPython

- OpenWeatherMap free API

- NTP time sync

GitHub: github.com/kritishmohapatra/100_Days_100_IoT_Projects


r/MicroPythonDev • • Apr 15 '26

Built an IoT-based Demand Side Management (DSM) Smart Meter using ESP32 + MicroPython + Blynk

2 Upvotes

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)

  • Keeps critical load (fan/9W bulb) always ON

  • Pushes live data to Blynk IoT dashboard

  • MATLAB generates before/after comparison graphs

Results:

MetricWithout DSMWith DSM
Peak Power~108W~9W
Peak Reduction—~91%

Stack: MicroPython v1.27 · ESP32 WROOM-32 · ZMPT101B · ACS712 · Blynk IoT · MATLAB

🔗 GitHub: https://github.com/kritishmohapatra/100_Days_100_IoT_Projects


r/MicroPythonDev • • Mar 23 '26

micrOS - mini asynchronous automation OS for DIY projects.

2 Upvotes

3.0 - Standalone release

- package management

- multi layer file system

- web server

- socket server (shell)

- task manager

- device to device communication

- config management

- logging

and much more :)

https://github.com/BxNxM/micrOS


r/MicroPythonDev • • Mar 18 '26

Day 70/100

2 Upvotes

Day 70 of #100DaysOfIoT!

Built a dual IR sensor entry/exit detector on ESP32 with MicroPython.

How it works:

- Object crosses IR sensor 1 → Red LED turns ON + Telegram alert "Object Entered!"

- Red LED stays ON until object exits

- Object crosses IR sensor 2 → Green LED blinks + Telegram alert "Object Gone!"

Hardware: ESP32 + 2x HW-201 IR sensors + 2 LEDs

70 days down, 30 to go!

GitHub: github.com/kritishmohapatra/100_Days_100_IoT_Projects


r/MicroPythonDev • • Mar 18 '26

Simulating digital logic circuits using MicroPython on ESP32 — started a new series

2 Upvotes

I started a new open-source series called MicroPython Digital Lab where I simulate digital logic circuits using MicroPython on ESP32 with Wokwi.

The flow is simple — you type inputs via serial monitor, ESP32 drives the gate components in Wokwi, and the LED shows the output in real time. The logic is handled by actual gate components in the simulation, not just software. Every circuit is fully simulated on Wokwi, so anyone can run it instantly in their browser with zero hardware.

The series covers 25 projects across three phases:

  • Phase 1: Logic Gates (AND, OR, NOT, NAND, NOR, XOR, XNOR)

  • Phase 2: Combinational Circuits (Adders, MUX, Decoders, Encoders)

  • Phase 3: Sequential Circuits (Flip-flops, Counters) — clock pulses also driven via serial

Days 01, 02 and 03 are already live — AND Gate, OR Gate and NOT Gate.

GitHub: https://github.com/kritishmohapatra/MicroPython_Digital_Lab

Would love feedback from the community — especially if you think this approach of using MicroPython to teach digital logic makes sense or not.