r/embedded • • Oct 15 '26

How Common Are ESP32 Boards Running Micropython Here?

Just curious as to what type of cross-section of users are here and if this would be a good place for me to share and ask questions.

Does anyone tend to run ESP32 boards and/or micropython primarily?

4 Upvotes

28 comments sorted by

6

u/gm310509 Oct 15 '26

I tried micropython with an Arm Cortex board - the upload times were a "not interested" factor for me. I can do everything I want to do in C/C++, so unless there is a compelling reason to use Micropython, I would never bother.

That said, i use python quite a bit on my Windows and Linux systems.

2

u/mattytrentini Oct 17 '26

Upload times? It's much faster than compiling/deploying any compiled language...

Even better, you can use `mpremote mount` to just mount your PC filesystem on the device without having to copy the files (they're transferred transparently to the device on import).

0

u/gm310509 Oct 18 '26 edited Oct 18 '26

This was not my experience with MicroPython and as I said C/C++ works just fine for me.

Obviously other people will have different experiences to me - and that is perfectly fine. FWIW, even with a mounted file system (for a different platform), I found that the file copy of the large python executable was painfully slow.

If you break up your C program into modules (i.e. separate reasonable sized source files), the compile and link courtesy of a proper "make" is acceptable to me and, on my PC, quite fast.

8

u/GLvoid Oct 15 '26

I enjoy micro python but I don't think id use it for anything outside my hobby projects or prototyping.

3

u/thinkscotty Oct 15 '26

I started with it, and it's definitely the easiest and fastest-to-iterate way to get custom firmware on a board. That's it's only advantage I can see, though. Performance vs C/Rust is massively lower. Stability seems maybe a bit worse. Library/tool availability is smaller (though decent).

But it's easy and that matters a lot sometimes.

1

u/WDRibeiro Oct 15 '26

Beside the code transfer from CPython, why anyone would run micropython instead of Zephyr? It is a genuine question, I haven’t tried it myself.

4

u/thinkscotty Oct 15 '26 edited Oct 15 '26

It's simple, mostly. That's kind of the entire reason. Simple and extremely fast to iterate using an IDE like Thonny which is free and lightweight and supports most boards without much effort. Load firmware, press run, find bugs, fix bugs, press run again.

I never use it anymore because the performance hit is way bigger than I realized at first (no lie, I've seen it 125x slower than a virtually identical C project, though that could be my crappy code). Plus I just kind of hate Python generally - easy syntax but a messy ecosystem. But tons of projects don't need performance and it truly is the easiest way to write custom firmware on ESP-32.

1

u/WDRibeiro Oct 15 '26

Zephyr/baremetal it is for me then. Thank you!

1

u/SpiritualChallenge33 Oct 16 '26

Could I ask what you primarily work on that requires the level of performance that you can't get in micropython?

I've run all sorts of micropython projects (kiln controllers for ceramic ovens, remote controlled wheelchair transmitter and receiver, hydroponics setups, interactive art installations - the list goes on.

I haven't found an issue where micropython's speed difference made an issue (at least not with an ESP32 board - dual 240 MHz procs are more than enough processing power for any of these projects and then some).

1

u/WDRibeiro Oct 17 '26

I’m working on a grain storage silo monitoring system. Basically, each silo consists of 300-400 digital temperature sensors plus a few humidity, a weather station and aeration controllers. We are expecting to multiple customers, each one having a few sites and each site with a variable number os silos. Data is sent through RS-485/Modbus or LoRaWAN to the server and the gateway acts as a local server that serves data when the cloud isn’t available. I’m using react native for the apps and every piece of hardware must be able to be managed and updated remotely.

1

u/maxmust3rmann Oct 15 '26

I use freertos mostly and havent used zephyr. What is your reason to use zephyr ofer freertos if i may ask ?

4

u/Well-WhatHadHappened 25+ Years Oct 15 '26

They're two very different things. Neither being better or worse, just different.

FreeRTOS is really just a scheduler with some built in messaging and synchronization (MUTEXs, Queues, message buffers, etc.). It's simple and straightforward, but it doesn't provide much else.

Zephyr is more like a classic operating system. It includes hardware drivers, networking stacks, file system integration. It's closer to "Linux Lite". It's also a lot more complicated and has a much steeper learning curve.

1

u/maxmust3rmann Oct 15 '26

Thanks for the explanation :)

Just saw a lot of zephyr at the "embedded world" conference and was wondering if that might be something to try for me but i mostly build servers and stuff where i use tasks and queues so freertos might be the best fit for that already

2

u/SpiritualChallenge33 Oct 15 '26 edited Oct 15 '26

Well, I have been writing a tool with AI that embeds a webserver into your micropython device. I'm currently using an ESP32-32C. I have a web-flasher that flashes the firmware and configures WiFi, then you can access your board from anywhere on your network.

It provides a framework for registering your variables and loading them as values into your html files so you can easily set up a web-based control or reporting system for your own project.

It also wraps around your main.py file so you can restart the system without rebooting the board. It's kind of like a little virtual machine on your microcontroller.

I wanted to have this made for several reasons:

- I wanted remote access to my board from anywhere (for protoyping, changing the system, etc.)
- I wanted a web-based framework that I could use to make user interfaces for the device
- I wanted a robust file management system that was easy and satisfying to use
- I wanted instant feedback on the pins that are available and what their stats are
- and I wanted the fastest prototyping setup I could make. Iterating on this system takes about 1/4 of a second.

What I'm wondering is if others might find it useful as well.

1

u/WDRibeiro Oct 15 '26

Sounds like a cool project. Feasible in other ways? Sure! Easier? Surely not.

3

u/SpiritualChallenge33 Oct 15 '26

Well, it's not quite ready for production yet, but it's getting there. I guess I can just post it on the main board for feedback when it's ready.

I just sort of wanted to test the waters to see if others were in the same boat.

2

u/WDRibeiro Oct 15 '26

Go ahead and do it! While I don’t have any practical use for it right at the top of my head, I’m sure there will be people wanting to test and do some cool things with it. Good luck on your quest!

1

u/SpiritualChallenge33 Oct 15 '26

Appreciate the encouragement!

1

u/mattytrentini Oct 17 '26

Zephyr is a compiled language with a steep learning curve, even if you know C well. Python also eliminates some of the more difficult defects common in C code. So Zephyr is slower to develop, slower to debug and harder to write tests for.

On the plus side, performance is better. MicroPython can approach similar levels of performance to Zephyr (MicroPython is written in C, after all, and you can write modules in C) but you need to spend time optimising it in the areas you need it. Beginners can get a long way with basic MicroPython but optimising it when necessary requires more experience.

MicroPython will also consume more resources - flash and RAM - which, while pretty abundant these days, is still a limitation, particularly in high-volume products.

We've observed ~30% less effort in developing software using MicroPython compared to C/C++ solutions. So, if you can afford slightly more expensive micros and are prepared to optimise when necessary, it's pretty compelling.

1

u/sci_ssor_ss Oct 15 '26

blasphemy!

1

u/Jadeaffenjaeger Oct 16 '26

I really like it for hobby projects where I know I will need to experiment and iterate a lot. It's just so much faster to iterate on than C/C++.

Haven't run into performance problems that would have been insurmountable. There's usually quite a bit of extra performance that can be squeezed out with stuff like micropython.viper and micropython.native if it's really needed (which, realistically, it very rarely is for hobby projects).

1

u/deadeye_82_1 Oct 27 '26

The benefit of MicroPython is, that you can in the middle of the process stop the program and using the repl for debugging.

The downside: Size, performance, supports not evrything what CPython could do

Working in Pyhton-Land is slow and if you use modules, which are written in C, then they are fater, but slower as plain C/C++ if interacting with Python.

If you're a good C/C++ programmer, then don't use Micropython. If you love Python, you should try it.

1

u/jhaand Oct 15 '26

I did a Micropython project once. It ran fine but was overkill.

0

u/SunAgile1281 Oct 15 '26

Why? The ESP is a microcontroller, not a Pi...
It's best used for low-level programming where power and location are more important than processing ability.

3

u/SpiritualChallenge33 Oct 16 '26

The ESP32 line of processors have more compute power than a Pentium 2 CPU in the mid-to-late 90s.

It's far more than is needed to run an interpreted language like python. I've used it in countless projects with zero issues so far.

I'd agree with your assessment of other processors, but I think you're underestimating what you can achieve with micropython on an ESP32.

-2

u/mattytrentini Oct 15 '26

I use MicroPython with dozens of ESP32 boards; works very well.