ESP32 Buyer’s Guide: Different Chips, Firmware, Sensors
eitherway.io
eitherway.io
Especially coming from some other board types, it was like "oh i guess that just worked the first time" for a lot of things.
I have a bunch of ESP32-S3's locked in some woodworking machine cabinets (they are used to monitor the machines for dust collection control/failure/etc.). It's trivial to make them do firmware reprogramming over bluetooth. You could do over wifi too, but in my case, the machines are too RF noisy (VFD's, etc) and enclosed to make it work. bluetooth only works because i'm like 2 feet away, but it works and i don't have to open the cabinet to update the programming.
I also use one to broadcast a stupid bluetooth beacon that my garage door opener uses for "UL compliance" - It has bluetooth lights, and it won't let you open/close the door remotely unless it detects them, because UL requires they visually signal the open/close when done over wifi. Which again, just works. I never had that experience outside of the nRF52/nRF53 series
There are some good low-power boards with the S3's, though it can be hit or miss (IE assuming you really want the 20ua deep sleep to be ~20ua).
If you want something like a remote running off a small battery for 10 years, you may be better off with the heltec cubecell's or something. (They really easily get 3.5ua in sleep)
Once up and running they really are quite pleasant to use, and pretty damn cheap.
The issues that hurt me the most were:
1/ It doesn't come preloaded with 'AT' firmware, it took me a while to figure this out as well as a PCB respin.
2/ The clearly labelled TX and RX pins are for flashing and debug output only, not for communication with an an external microcontroller. Two to four GPIO pins (decided by the AT firmware) are used for communication in 'AT' mode
3/ Two GPIO pins need to be asserted high and low on startup to enter flash mode. This fine when you figure it out, however the flash tool still tries to upload the firmware and 'fails successfully' with the correct upload delay.
The MVP they use does not always include "as good as our other parts are now".
When I read this, at first I thought "well DUH it doesn't have a desktop OS or various desktop utilities built in, its a microcontroller!"
Then I realized for a lot of people now, their first led blink "hello world" was possibly not on a microcontroller at all. To me, the idea of wanting a mouse and keyboard for a microcontroller to set up wifi seems silly, but to others, they just haven't experienced the alternative.
There is great support for various wifi security standards for the ESP though, you just need to create something equivalent to how a chromecast connects to the internet for the first time. bootstrap an AP, connect to a portal, configure on the portal, reboot and connect to the actual AP.
The big benefit to ESPHome is it handles all the 'boring' stuff like Wifi updates, timers, and API/MQTT glue code. I still write one-off stuff in PlatformIO, but most of my devices are running ESPHome with some custom code added on, because I don't feel like reinventing the wheel.
It's not a general purpose PC with I/O tacked on, like a Pi is, but more like the reverse: I/O and a wifi/bluetooth chip that also has a small (but powerful) processor.
OTA upgrades are quite useful.
Single program and a couple of MB of ram and flash.
When you have an overhead opener the light is built in, and hard wired. It blinks when the door is triggered remotely.
When you have a side mount (jack mount) opener, there is no light built in. They give you a Bluetooth light, meant to be mounted on the ceiling like you would have in an overhead opener.
The light is only required when the door is opened over wifi. All keypads (which are RF as well) and remotes work regardless. It is only wifi opening.
This is not a useful safety device. Either it should be required and trigger regardless of how the door is opened (so that I know that it means door is about to move) or not be required at all. Having it required and triggering only some of the time the door opens is not something dependable or useful.
But if you close the garage door over wifi, the user closing the door could be anywhere. This user may not be able to see the door or warn people nearby that it is closing.
I own a Tailwind device which implements this safety feature.
Not sure why everyone keeps making assertions about the setup instead of asking questions. First claims that it's a line of sight safety device (which is wrong), now weird claims about physical proximity (which are also wrong).
Zero of the manufacturer shipped mechanisms to open or close these require physical proximity. Someone can open the door while i am in there using the remote, etc. It works fine from 300 feet away, and in fact, it's quite common for it to be opened or closed while someone is 150ft away at the bottom of the driveway.
We also had a wall pad in the house that triggers the garage, also (it's no longer needed but we started with one).
Wifi is no better or worse here - So i still maintain having a device that does not trigger all the time, despite lack of physical proximity, but instead based on whether it's FSK or wifi, is confusing and pointless
It's also more unsafe.
It seems strange to not at least have the option to choose if you want the light to operate in such cases. The manufacturers have gone out of their way to reduce safety.
I really enjoy using ESP32 devices in Home Assistant with ESPHome.
From the add-on:
> [ESPHome] add-on allows you to manage and program your ESP8266 and ESP32 based microcontrollers directly through Home Assistant with no programming experience required. All you need to do is write YAML configuration files; the rest (over-the-air updates, compiling) is all handled by ESPHome.
You can also add that a lot of commercial home automation devices use ESP chips. This often allows the open source [Tasmota][0] firmware to be flashed on them and make the devices compatible with Home Assistant or alike.
Some points that could be improved:
The article reads like someone is talking. For me that style of writing is bit off-putting, i.e. too much fluff.
I am surprised the manufacturer of the chip Expressif is not mentioned, as both ESP8266 and and ESP32 are by them.
> The ESP has no integrated firmware.
then near after this, you write
> This firmware is then flashed to the ESP Chip with the help of a “burned into the chip” ROM bootloader (more info).
That means there is a firmware, the bootloader. Expressif gives a really good [explanation][1] how this bootloader firmware works.
[0]: https://tasmota.github.io/docs/
[1]: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/...
* Wifi reconnect
* Mqtt (and HomeAssistant) integration, with reconnect
* Hotspot (initial configuration) support
* Tons of hardware devices supported
* Even for basic digital io, there's nice quality of life things a line of yaml away: debounce, internal pullup, invert..
Basically by my second or third experiment I found myself starting to build more reusable libraries to do stuff like wifi+mqtt reconnect. Thought "someone must have done this before" and found "Yes, plus went 1000 miles further and built EspHome"
The Ali prices aren't significantly cheaper than many of the sellers on Amazon (at least in small quantities), you don't have to wait a month, and if you get a dud, replacements are easy.
Even though I started with the 8266, as the article mentions, there's little reason to choose that outdated board at this point. It's worth the extra $1 to get the 32 in a DEV board configuration. Having the CP210x and USB onboard is also worth it for the hobbyist.
The ESP32-C3 dev board is around $8 too, and the ESP32-S3 around $15 if you need tons of IO and an RGB interface.
No point in ordering random ones from Amazon IMO.
Unlike the ESP32-S ones though, that's all it does on the C, so you can use it to program and debug the thing, but you cannot make your own USB device with it.
On the chip or the modules, this is pins GPIO18 and GPIO19 that just need to be directly connected to USB D- and D+. Of course the chip still needs between 3.0V and 3.6V for power, so you can't power it from USB directly. If the firmware is just rebooting all the time (sometimes the case on a fresh module), you may need to pull GPIO9 low to enter bootloader instead (https://docs.espressif.com/projects/esptool/en/latest/esp32c..., there is a button for this on some boards), but otherwise you can just flash it in normal mode too.
Edit: Never mind, it does appear to allow full in circuit debugging. I’ll have to do some more research.
There is more info here https://docs.espressif.com/projects/esp-idf/en/v5.0/esp32c3/..., the ESP-IDF VS Code extension should have this doable with one button click.
There's no need for a usb-serial converter, JTAG connector (you can debug over USB), or a serial header with yet another random pinout that you have to figure out every time you want to program the thing...
You restart the board to programming mode by holding down the BOOT button down while pressing RESET. Wait a few seconds, then COM7 is available. You program the board, and then manually RESET the board with the button. COM7 disappears. Then you wait a few seconds, then COM6 appears. Oh, did you print some debug info on boot? Too bad, it takes a few seconds for the virtual serial port to appear in Windows so you just can't get input during that time because the reset resets the USB controller as well (the entire chip).
This is the benefit of on-board USB-UART chips: if you need to reset the chip, your USB controller doesn't need to be reset so your serial port stays open. Additionally, most ESP32 dev boards offer automatic reset by utilizing the DTR or RTS pins of the UART chip and a couple of transistors.
No button presses necessary (there are no buttons even, I have a slide switch on my PCB but almost never need to use it), everything resets automatically (except when it's in deep sleep, then I need to unplug it and plug it in again), I see log lines from the very first line in `app_main()`, etc.
I'm using a recent version of the ESP-IDF framework including all its tools (there is a VS Code extension that has a `Build, Flash and Monitor` button, I think all the operations are just run using the `idf.py` script, but not sure).
I added a note to the Article.
I have been working on the Toit language for the ESP32 for a number of years now -- and it has been an enjoyable challenge to build an open source stack capable of supporting live reloading on a micro-controller that can run for years on batteries.
I've only been building things with Arduino Uno/Nano/Mega (clones) so far and they are kind of limited. Those ESP32 I've now got seem to have _everything_ onboard: lots of IO pins, hardware PWM (although I do not understand that fully yet), WiFi, Bluetooth, hall and temperature sensor onboard.
All of that for 8 Euro/piece. It's sick for IoT projects, really looking forward to doing more of that.
I've got these: https://www.amazon.de/dp/B074RGW2VQ
edit: I'd love if Arduino et. al. would start using USB-C plugs though. I've got everything from USB-A to micro USB around here and I'm constantly looking for the right cable to use a board. Does anybody know why they haven't switched to USB-C yet?
I thought that fading a LED would then stick to the frequency of the PWM controllers, but it seems I still have to take care of the speed?
I thought setting the PWM frequency to 100 Hz and cycling my LED brightness from 1 to 100 would take 1 second. It doesn't work that way it seems?!?
I cannot recommend the M5 stack highly enough. I did a lot of ESP32 programming for my LED art hobby projects from 2016-2020 and these are amazing.
https://www.amazon.com/dp/B08VGRZYJR
M5Stack makes a huge ecosystem of >100 add-on modules that snap onto the bottom of the Core2's form factor, including a wide range of sensors, LoRa & cellular radios, I/Os, interfaces, servo drivers, GPS, cameras, HMDI, RJ45, UWB, RFID, etc. It's quite a clever modular expansion system that makes prototyping (or just playing around) super easy.
https://shop.m5stack.com/collections/all-products/m5stack-co...
Note: I linked (and have) the AWS IoT Devkit version of the Core2 which comes with an upgraded battery module on the bottom vs the standard Core2 (a bit more Mah plus ten RGB LEDs built-in). It's also $10 cheaper than the base Core2 on Amazon thanks to AWS subsidy. The only difference is it comes with AWS Fire IoT Devkit firmware pre-flashed but it only takes a minute to flash it back to stock Core2 firmware.
Using just your browser you can transform these into Bluetooth proxies for Home Assistant with https://esphome.github.io/bluetooth-proxies/
The whole M5Stick ecosystem of addons it awesome too.
I've been thinking about getting one but the I/O looks so anemic... Does it have extra pins on the inside or 3 GPIO's is all you get no matter what?
Larger units have 2, 3, or 6 grove connectors, plus a big library of pluggable peripherals.
Corrected it.
All current variants: https://www.espressif.com/en/products/socs
Wouldn't it be better to just recommend the S3, where there is currently only one version available?
There are like a dozen different versions for the ESP32.
"Two or one CPU core(s) with adjustable clock frequency, ranging from 80 MHz to 240 MHz"
In this case it seems to be the better choice to just use the ESP-S3 with better encryption support and support for Cameras.
Partly this is because the Esp sdks aren't as mature for the newer boards. This is very true for the brand new C6 series, but somewhat true for th S3 and C3 lines as well
This is the closest I could find, but it uses a physical relay, so it would be loud and probably incapable of any reasonable PWM rate: https://www.amazon.com/gp/aw/d/B00WV7GMA2
I'm interested in playing around with sous vide. I realized I have all the parts (anything Arduino-like, basic AC immersion heater, water pump, thermocouple with MAX6675 interface) except the SSR. I could buy a $15 SSR, but if I'm adding one to my collection of tools for this and future projects, I'd prefer it look more like a smart plug than a mess of wires and terminals that could be a hazard in the kitchen.
(Sorry to hijack, but can't resist this gathering of IoT enthusiasts.)
If the purpose is to make a temperature-controlled water heater, you would probably be alright with just using that regular relay and switching power on/off to the element every few seconds. It takes a while for electricity to heat up water, and with some hysteresis / a PID loop you will get very accurate results, even switching once every five seconds.
I assume it's hard to do proper AC PWM if you don't know when the AC sine wave's phase starts, preventing you from maintaining a consistent pulse amplitude over time. But I was hoping that something simple like a resistive heater wouldn't be too fussy about it.
And then there's the small matter of my home being constructed from flammable materials....
If you actually want to do AC "PWM" (it's not really PWM), use a triac as suggested by another poster, and make sure it does zero crossing detection.
For the water heater he doesn't need PWM, Tasmota has a thermostat mode with hybrid PID control. There's Sonoff TH2 device that can do that. Dunno what temperatures does sous vide use but it can be definitely done with a Pt1000 or a thermocouple if not the regular digital sensors.
From what I remember, you probably want something that'll provide zero crossing detection. My vague understanding is you get the equivalent of PWM control, by cutting the AC sine wave relative to when it crosses zero voltage.
The IPS version of this is my current favorite: https://www.aliexpress.us/item/3256804766379290.html
But those methods are slower and if you're doing a higher resolution user interface, the RGB interface lets you drive stuff like an 800x480 display at well over 60 fps.
For example: what does it mean "Built-in battery support."?
- will it allow you to monitor the battery charge? - can I charge it using the micro-USB - does it have undervoltage protection? - what is its quiescent voltage? - what is its consumption in deep sleep mode?
As for the Esp32-Cam, those little camera modules are flawed, one of the pins act as a 20Mhz antenna and causes interference everywhere including itself, and your board might or might not work.
https://www.wemos.cc/en/latest/_static/files/sch_c3_pico_v1....
Battery charging is handled by an external chip, so I've looked up its datasheet when I needed (for instance) to reduce the charging current. The schematic shows a voltage divider feeding one of the ADC inputs for battery monitoring.
Also, no schematic, no buy. I've had good results with stuff from Wemos. I've also gotten boards that were definitely copies, worked fine, but caveat emptor.
For most IoT devices the ESP32-S3 is overkill unless running a large display, and you could use the cheaper ESP32-C3, which has 1 core instead of 2, no RGB interface, and less GPIO. These run about $2 each for a solder-able module with built in antenna: https://www.digikey.com/short/cttthh0h
Or $6 for a dev board with USB built in: https://www.digikey.com/short/9rp1zbb3
I'd compare the RP2040 more to your classic STM32 arduino dev board, with the ESP series in another class above those.
https://www.adafruit.com/product/5526
Bluetooth support is supposed to be added in the next version of the SDK.
I think the main advantage (to some, in the current geopolitical climate) is that it's not Chinese.
The ESP series can disable wifi/bt entirely if needed, their low power sleep is pretty good. IIRC someone got a year or more out of a single 18650 cell doing very slow updates.
ESP32 doesn't have RP2040's PIO. It's just amazing, and can easily emulate RGB display controller or whatever you want it to. Even software HDMI with most CPU power still available. Thus bitbanging possibilities are endless, and this chip can sometimes replace an FPGA.
Pi Pico W boards also indeed have Wifi and recently bluetooth was enabled.
RP2040 also overclocks pretty easily, and people have pushed it even past 400 MHz. Wouldn't overclock in anything important, but for hobby projects — why not! It's about as fast per clock as dual core ESP32 (except for DIV & FPU math).
Both chips have their uses. For example ESP32 got HW FPU and integer division division, those can really help in some cases.
I quite like the separation between the two functions.
However... it just occurred to me I could connect 2 together for cross signaling over the other pins and have 2 in and 2 out that way.
A project using it: https://github.com/satoshinm/pill_serial
Specs for one with 3 usbs: https://www.st.com/en/microcontrollers-microprocessors/stm32...
I've never heard of a microcontroller that provided the feature you're looking for, unfortunately.
https://www.lilygo.cc/products/t5-4-7-inch-e-paper-v2-3
I’m working on a rust-based information display browser for it.
https://github.com/espressif/esp-idf/tree/master/examples/op...
They have some nice improvements over the generic boards you'll find on Amazon, etc., like extra flash, extra GPIO pins, USB Serial JTAG pins, multiple LDO regulators, and multiple Qwiic/Stemma QT connectors (4-pin JST PH-compatible connectors used by I2C devices made by Sparkfun and Adafruit).
Is there a generic library, config file format, host application, or other tool you use for configuring keypresses and macros? I'm currently doing that manually with hardcoded mappings, but it seems like there must be a better way. I'd really like to use something like QMK, but that's fairly specific to keyboards and doesn't support ESP32.
That’s weird phrasing to say that the S2 is the older version, rather than the S3 is newer.
Also, the AI links to a GitHub for doing ML on all versions - exactly what is this “AI support”?
IMO the most interesting thing between the ESP32-Cx and ESP32-Sx is that the C is a RISC-V architecture
https://gist.github.com/sekcompsci/2bf39e715d5fe47579fa184fa...
I'm also working on my writing skills. So forgive me for styling errors.
I know the ESP32-Cx is based on the RISC-V architecture. Could you elaborate why this is a feature or in what way this is an advantage?
(I think the .io and me misreading as “etherway” made me think it was company-published and for right or wrong I assume companies only ever blog for brand recognition, so am probably over critical of them)
That’s partly a big compliment - your blog is really well styled and easy to read.
RISC-V is a fairly popular topic on HN, and for me at least it’s really interesting as both a low-level nerd, as well as curiosity about what impact it may have given we lived in an x86 world for a long time, before ARM really took hold, and now that there’s a new player and it’s an open standard is really interesting.
Could it be the “Linux kernel” of the hardware world? I have probably 20x ESP8266s doing various things in my life, maybe 5x ESP32-Sx, and will probably pick up a few -Cx, and they’ll be the first RISC-V device I own.
The main feature seems to be that it's an open architecture, so you don't have to rely on the things that a manufacturer provides you.
I also added your comparison table to the article.
And thank you for the compliment!
A drawback is that ESP32 RISCV cores don't feature FPU, if I am remembering correctly.
Long term support. As Espressif has publicly declared their intent to fully move to RISC-V, it is not in your interest long-term to base your designs on the ISA that's been deprecated.
It would seem that it would be up to me to figure out which CPU something should run on, right?
So if you aren’t doing a workload that requires it, is there a point? Or does it use one of the cores to offload managing networks, Bluetooth’s and whatnot?
As long as you don't create too many long-running tasks and be mindful of which core is running what, it's been incredibly reliable in my experience.
My biggest use case for this is keeping an active display, like those 64x64 RGB LED Panels, fed with pixel data from a display buffer using one core fully pegged to the task, then using the second core for wifi and display buffer updates. In Arduino land, since loop runs on a specific core, you can basically put your 'constantly running code' in the loop, and schedule the tasks to run on the other core in setup().
I’ve also found Espressif’s documentation to be exceptionally good which has been a big help.
If you’re doing any ESP32 dev work I strongly recommend getting a FT232H which can be used as a JTAG debugger if you don’t have a board with native capabilities otherwise debugging is really, really painful.
I don't think that you can buy this one yet..
https://www.adafruit.com/product/5670
edit: I'd wait to buy it regardless, software and sdk is still under active development.
https://github.com/espressif/esp-idf/issues/10423 https://www.reddit.com/r/esp32/comments/10pkuin/esp32c6_real...
I'm surprised that they don't talk about OTG in this article... Maybe only the S-series supports it
https://www.aliexpress.us/item/3256804900845431.html
(in stock as of 9:56AM PST Feb 4 2023)
But it has worked fairly well. The stack was: -Platform.io -ESP-IDF framework -LVGL an embedded ui framework that is pretty simple to use. -FreeRTOS
Works great, its been reliable and it will probably remain my choice for the next couple years.
One thing I would like is better Rust support. I have taken a look around and everything is just out of date bindings to C/C++ projects. Not a whole lot of native Rust, so I don't really feel the need to switch until that changes.
There are currently 2 approaches for Rust in ESPs:
- std: Its built on top of ESP-IDF, so it ends up calling C functions. I guess this is what you've seen in the past.
- no_std (bare-metal): Pure Rust implementation.
See https://esp-rs.github.io/book/overview/index.html for more details
And a controller to change multiple of the wireless LED lights based on different cameras...
Is ESP32 suitable?
--------------
| SDCARD |
5V -|1 16|- 3V3
GND -|2 CAMERA 15|- GPIO_16 (useless, can't be used for anything)
A GPIO_12 -|3 14|- GPIO_0, connect to GND during programming, used by camera, don't use!
A GPIO_13 -|4 13|- GND
A GPIO_15 -|5 12|- 3V3/5V
A GPIO_14 -|6 11|- UART RX, GPIO_3
A GPIO_2** -|7 10|- UART TX, GPIO_1
A GPIO_4* -|8 9|- GND (weird, don't use)
| LED |
--------------
- A=analog input 0..4096- GPIO_4 is connected to FLASH LED, if you want to use as input you need to desolder resistor R13 that goes to base of npn transistor
- GPIO_2 is HS2_DATA0 for SD card, it has 47k pullup
https://www.espressif.com/en/products/devkits/esp-eye/overvi...
The ESP32 can read the camera, recognize objects/colors, and control the LEDs without any external systems.
Light up one tube out of 10.
Ball needs to pass through tube.
Once the ball has gone through another tube lights up. Goto step 1...
More can be added to the game, but that's the starting basis.
How would I coordinate the various ESP32? I'd need a raspberry pi, no?
Using ESP32s connected via Wifi and MQTT to a host (Pi or something) would be the easiest way I can think of to coordinate that.
You could also go without a host, by having the ESP with the ball randomly choose another and send the command to it, and connect them all together with ESP-NOW which is direct P2P communication.
For example:
https://www.freenove.com/store.html
https://www.ebay.com/itm/304704446185
(no affiliation and never bought from them, just an example of what to look for)
If you never worked before with electronics, however, you'll probably also need some basic equipment to test things and/or add functions (say you want one more LED, or need to add/replace a capacitor, drive more current with an i/o line etc.).
Take also a look at the beginners section at the EeevBlog forums. It contains some good advice on how to set up a basic workbench: https://www.eevblog.com/forum/beginners/
As far as makers/peripherals go, I'm also a big fan of M5stack, which have a big range of controllers and peripherals and are very accessible & responsive on Twitter. Their stuff is very competitively priced, available stripped down or in enclosures suitable for pocket, industrial or even outdoor deployment, and it's super-easy to get started with.
Hunting around for answers about how the c3 works can be rough. There’s still not a lot of info about its quirks written up yet. But once you get into it, it’s great. And quite affordable.
Would you mind explaining what the advantage is over the ESP-IDF or the Arduino-SDK?
e.g. the Bluetooth examples will run without modification on an nRF52 or ESP32 board.
Also interesting is the Picoclick C3: https://github.com/makermoekoe/Picoclick-C3
- buy 2 ESP32s with an Ethernet port on each and communicate between them over serial
- buy an ESP32 with Ethernet and USB and use an Ethernet to USB adapter
- or is there a better option?
I believe pihole works with just 1 eth port as you are just using it for dns queries and not actually NAT’ing traffic through it.
I am by no means a networking expert and was able to use technique to work around a similar issue in the past. It was easier than I expected!
See https://docs.espressif.com/projects/esp-idf/en/latest/esp32c...
If you need to make requests to other people's servers, there is a tool to generate and include a bundle from Mozilla, that you can update in the future as part of an OTA update (https://docs.espressif.com/projects/esp-idf/en/latest/esp32c...).
I haven't used it, but there now seems to be some good support in the ESP-IDF Framework: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/...
It's good for proof-of-concept hobby projects. But on the job we've had to repair the BSP each time.
I am only starting in the IOT Hardware World.
They vary massively. Usually written in a sweatshop in the far east by students, pushed out and forgotten because they are table stakes but not a profit center.
They usually include support for board boot, threads, timers, and something that looks like networking.
I say 'looks like' because they are often paper-thin implementations of a familiar API, with little or nothing inside. No proper flow control; no dynamic anything. Not even thread-safe as a rule.
Various modules do carry FCC modular approval. The whole product needs to be certified of course.
I wouldn't use them for my first foray into ESP32, but if you're fairly decent at debugging C, you'll probably be fine.
Currently I have one device at home, and a second in the field, which a friend is planning to use once I make some timezone adjustments (Google stopped providing vtimezone data for new calendars, apparently, so I need to get it somewhere else).
The only issue I've had is the battery charger circuit on some boards has a fuse instead of a diode making it a hazard (realized pretty quickly while testing). This is supposedly fixed on newer revisions but there's always a chance of getting an old one through some sources....
- There are no good tutorials on how to have the cam save to SD.
- streaming it is easy with esphome, but there is no easy way to save it since it doesn't use a normal streaming protocol
- the camera image quality sucks. I got some 5mp cameras to use instead of stock camera, but the chip can't stream that resolution at anything above 2-3fps
A proper SoC with a dedicated camera interface and an external WiFi chip is going to do a far better job than pretty much any of these microcontrollers; even the low-end Allwinner V3 often used in cheap Chinese IP cameras can run circles around the ESP32, even with the overhead of a full Linux kernel. Microcontrollers with hardware camera acceleration (including a soon-to-be-released ESP32 variant) are slowly becoming more common, but the original ESP32 isn't one of them.
Using an ESP32, i2c joystick controller, and i2c 128x64 OLED display I was able to cobble together a device that could control the robot and perform all its functions, as well as get telemetry from Bluetooth LE and show it on the display along with displaying controller inputs.
It wasn’t simple - it took months of work to get to a point where I had a mostly working prototype. That work including reverse engineering the device software and firmware, POCs running on my computer and then my phone before even starting on the standalone ESP32 version.
Pretty much from the start I was impressed with the capability of the ESP32. I had quite a bit of past experience doing hobby projects with Arduino and its ATmega 328 but the ESP32 was a whole new world. It was quite a learning curve at times. While I could use Arduino libraries which helped accelerate a lot of my progress, the multi-core nature of the ESP32 also meant that I ran into many interesting issues and incompatibilities with things I would do on the Arduino. Interrupt handling was completely different, for instance. i2c in particular was very challenging with lots of new and exciting issues to contend with.
Any sort of concurrent operations against the i2c bus would cause a crash, so I had to ensure I had careful synchronization of reads/writes. The speed of the ESP32 also meant I could easily saturate the i2c bus. This became a problem as I was trying to read inputs from the joystick, and output data to the display from both Bluetooth LE messages and the controller state. The ESP had the speed handle this no problem of course, but not the i2c bus. I had to write a rudimentary frame queue to control display output without saturating the bus since dropped frames weren’t as big a deal as not quickly processing joystick inputs. I also found many bugs in various Arduino libraries where they made bad assumptions on ESP32 hardware. I’d contribute fixes wherever I could. Most of my HW and libraries were from Adafruit, and they in particular were great about accepting my fixes into their repositories for the various issues I found.
One saving grace throughout any challenges I had was I found much of Espressif’s documentation to be very good - far better than I’m accustomed to from embedded hardware vendors. The community was also really vibrant which meant answers were often easy to find.
There was no serial debugging so I had to get a JTAG-capable device to save my sanity. Thankfully a cheap FT232H board in JTAG mode made a good enough debugger.
After lots of trial and error, I ultimately settled on Platform IO with Visual Studio Code for my development environment. It worked pretty well, although I ran into some really nasty bugs in Platform IO when debugging that would cause it to quickly drain my laptop battery (which they still haven’t fixed as far as I can tell).
Eventually the delisted software that inspired this whole project came back for download and I was able to get it back on all my devices and I kind of lost interest after that. However, the time I spent working on it was definitely a rewarding learning experience and made me a big fan of the ESP32.