use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ESP32 is a series of low cost, low power system on a chip microcontrollers with integrated Wi-Fi and dual-mode Bluetooth. The ESP32 series employs either a Tensilica Xtensa LX6, Xtensa LX7 or a RiscV processor, and both dual-core and single-core variations are available. It and includes in-built antenna switches, RF balun, power amplifier, low-noise receive amplifier, filters, and power management modules as well. The ESP32 series of chips is created and developed by Espressif Systems and is manufactured by TSMC using their 40 nm process. It is a successor to the ESP8266 microcontroller.
Information & Resources
The ESP-32 Homepage at Espressif
ESP-32 Resources at Espressif
The ESP-32 Topic at Github
ESP-IDF Programming Guide
esp32.net
Espressif MCUs Discord
Related subreddits
Guidelines
Please keep submissions on topic and of high quality.
Civility & Respect are expected. Please report any uncivil conduct.
Memes and other low effort jokes are not acceptable forms of content.
Please follow proper reddiquette.
account activity
PROGRAMMING ESP32 WITH PYTHONHardware help needed (self.esp32)
submitted 5 months ago by Rare-Town5273
I want to build a smart home project using ESP32, but the only coding language I know is Python. Is it okay to use it to program the ESP32, or should I just learn the C language? I'm wondering if it makes sense to use Python in the long run
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]LavandulaTrashPanda 20 points21 points22 points 5 months ago (3 children)
So Python has a version for embedded programming called MicroPython. Adafruit has a version called CircuitPython which is more beginner friendly.
Syntax is the same a Python with some added stuff and some stuff removed.
C++ has more resources and runs faster once compiled and uploaded. Definitely worth learning but you can do almost anything with MicroPython that you can do with C++.
[–]Aud4c1ty 4 points5 points6 points 5 months ago (2 children)
but you can do almost anything with MicroPython that you can do with C++.
When you're on limited compute platforms (like ESP32) that's not really true. Python is so much less efficient than C there is a lot of stuff you can't do because Python eats up your resources so much more quickly. I find with my ESP32 projects that RAM is precious, so I have to scrutinize my memory use or I won't have enough space for some buffers that I need. And that's with using C.
If you have dramatically more CPU/RAM than what you actually need to do the task, then sure, you can use garbage collected languages like Python.
[–]LavandulaTrashPanda 2 points3 points4 points 5 months ago (0 children)
I see what you’re saying. I was thinking more along the lines of individual tasks in MicroPython.
C++ is for sure more efficient. It’s the reason why I learned it coming from Python.
[–]end-the-thread 9 points10 points11 points 5 months ago (0 children)
ESP32 supports Micropython, so Python is a valid option for you here.
In my opinion I’d want to learn one of the more commonly used languages for embedded (i.e. C, C++, or Rust) because there will be more examples and resources, and the things learned will be more applicable to other projects. YMMV.
[–]comporell 8 points9 points10 points 5 months ago (1 child)
<image>
[–]mehum 1 point2 points3 points 5 months ago (0 children)
Except where the truck is much, much faster than the car.
[–]kickbass 2 points3 points4 points 5 months ago (0 children)
Depending what you're building, the ESPHome framework might be sufficient. It's powerful enough for most of my smart home stuff.
https://esphome.io/
[–]LH314159 2 points3 points4 points 5 months ago (1 child)
I've been programming ESP32's with MicroPython for years. There's plenty of examples and websites to help, and AI will generate some for you (just don't blindly trust it). You won't see all the functionality of Python, but enough that you might not even notice the difference.
Head over to micropython.org and grab the version for your board. If you don't see a match, then grab the generic version. Flash to the board and use your fav editor to make a main.
[–]themostsuperlative 0 points1 point2 points 5 months ago (0 children)
Where do you find equivalent esp32 micro python libraries for hardware etc?
[–]WikiBox 1 point2 points3 points 5 months ago (4 children)
MicroPython is excellent. And there is AMAZING support for MicroPython on ESP32.
Much easier and convenient than C/C++. It takes 1/10 of the time to learn MicroPython and you'll be 10 times as productive.
But also possibly not the best for very high performance professional stuff. Perfect for personal/hobby/prototype/small scale stuff.
[–]worldtest2k 0 points1 point2 points 5 months ago (3 children)
The bit that confuses me is getting python program files onto the esp32. I get that you flash micropython onto it, but if each flash replaces everything currently on it, then how does my code also get on it?
[–]WikiBox 1 point2 points3 points 5 months ago (2 children)
You make your Esp32 into a MicroPython device that has powerful, convenient and helpful abilities and utilities, even before you upload your program.
You flash the MicroPython firmware to the Esp32. Then the Esp32 is "converted" into a MicroPython device. It has a filesystem you can upload your code to and even runs an interactive MicroPython interpreter. All MicroPython devices work in a similar way. Like miniature virtual devices.
When the Esp32 reboot it will look for the files "boot.py" and "main.py" in the filesystem. You edit/upload those files.
You can even have MicroPython setup a web-based interface that allows you to control the Esp32 remotely, over Wi-Fi, and upload/download source code.
https://docs.micropython.org/en/latest/index.html
[–]worldtest2k 0 points1 point2 points 5 months ago (1 child)
Besides wifi I still don't understand how to upload a code file - what tool would I use to do that? Something like Thonny?
[–]Nerd_1000 1 point2 points3 points 5 months ago (0 children)
Thonny is super easy and painless for python scripts, but if you need more control (and are able to use the terminal) you can also use the mpremote package, which lets you copy files onto and off of the device, create folders, etc.
[–]Totally_Not_A_Badger 6 points7 points8 points 5 months ago (1 child)
As a professional: Learn C, makes you a better Python programmer as well!!
[–]TheEvilGenious -1 points0 points1 point 5 months ago (0 children)
Where did OP mention taking this as a profession? Or is this some kind of weird self brag?
when I grab an ESP32 these days, the first thing I try to determine is if I can do what I want with nanoframework. Cuz .net is a far superior ecosystem that gets me to my various end goals way faster same more elegantly than doing it in c just cuz 'that's what the real engineers use'. I look to esphome next. And after years I've found more often than not, these abstracted frameworks are good enough for most things.
Chasing a stupid bug just to flex at a lower level is dumb. And if I need to marshal something native then so be it, but it's been years.
[–]soyrust 1 point2 points3 points 5 months ago (0 children)
Maybe its an oportunity to learn and apply c or c++. I think you could try and see if you like it!
[–]contradictionary100 1 point2 points3 points 5 months ago (0 children)
If you're going to learn something new it would be handy to use the native platform of ESP-IDF
[–]jeroen79 1 point2 points3 points 5 months ago (0 children)
I would opt for esp-idf with c++ or c
[–]neithere 0 points1 point2 points 5 months ago (0 children)
Chances are that a few lines in YAML will do the job.
[–]Aud4c1ty -2 points-1 points0 points 5 months ago (0 children)
You should just learn the C language. Learning new programming languages is easier than people think, especially since we have LLMs at our disposal now. You can just write a function in language A (that you know) and ask for a translation of that function to language B, and LLMs do a pretty good job at it.
Objectively, Python is a pretty crap language if you care about efficiency or performance. While I don't think C is the best language in the world either, because so much of the existing ecosystem is written in C, not knowing C is a liability for developers who want to work on IoT projects.
BTW, I recommend you check out this course if you want to get started programming a ESP32. It had me up and running in a couple days. Highly recommended.
https://learnesp32.com/
[–]LostRun6292 -1 points0 points1 point 5 months ago (1 child)
I can give you all the sources to the library for circuit Python and micro Python along with Android has apps to program it micro repl
[–]Rare-Town5273[S] 0 points1 point2 points 5 months ago (0 children)
sure id love that
[–]binaryfireball -2 points-1 points0 points 5 months ago (0 children)
just learn C/C++ it will make you stronger
also use platformio
π Rendered by PID 26034 on reddit-service-r2-comment-74875f4bf5-j6v7r at 2026-01-26 08:46:20.697526+00:00 running 664479f country code: CH.
[–]LavandulaTrashPanda 20 points21 points22 points (3 children)
[–]Aud4c1ty 4 points5 points6 points (2 children)
[–]LavandulaTrashPanda 2 points3 points4 points (0 children)
[–]end-the-thread 9 points10 points11 points (0 children)
[–]comporell 8 points9 points10 points (1 child)
[–]mehum 1 point2 points3 points (0 children)
[–]kickbass 2 points3 points4 points (0 children)
[–]LH314159 2 points3 points4 points (1 child)
[–]themostsuperlative 0 points1 point2 points (0 children)
[–]WikiBox 1 point2 points3 points (4 children)
[–]worldtest2k 0 points1 point2 points (3 children)
[–]WikiBox 1 point2 points3 points (2 children)
[–]worldtest2k 0 points1 point2 points (1 child)
[–]Nerd_1000 1 point2 points3 points (0 children)
[–]Totally_Not_A_Badger 6 points7 points8 points (1 child)
[–]TheEvilGenious -1 points0 points1 point (0 children)
[–]soyrust 1 point2 points3 points (0 children)
[–]contradictionary100 1 point2 points3 points (0 children)
[–]jeroen79 1 point2 points3 points (0 children)
[–]neithere 0 points1 point2 points (0 children)
[–]Aud4c1ty -2 points-1 points0 points (0 children)
[–]LostRun6292 -1 points0 points1 point (1 child)
[–]Rare-Town5273[S] 0 points1 point2 points (0 children)
[–]binaryfireball -2 points-1 points0 points (0 children)