The ESP32 has been a go-to microcontroller platform for a while now, thanks to its versatile capabilities, integrated Wi-Fi and Bluetooth connectivity, and low power consumption. It’s ideal for a wide range of projects especially those revolving around IoT, partially because of all of the libraries and tools available for it now. The latest tool from [The Last Outpost Workshop] adds a feature we didn’t know we wanted until now: a webserver showing real-time updates of what all of the GPIO pins are doing.
The live GPIO pin monitoring library sets up the ESP32 to stream information about what all of the pins are doing in real time to a webserver, which displays the information as a helpful graphic. The demonstration in the video below shows and example troubleshooting a situation where the code is correct but there’s a mistake in the wiring, helping to quickly identify the problem and hopefully eliminating a wild goose chase for a bug in the software. The library can be quickly installed using the Arduino IDE and only requires the use of one other library and a few lines of code to get everything up and running.
As far as a debugging tool goes, something like this could save a lot of us a significant amount of time, especially with how easy it is to set up. A real-time look into the pins and their behavior, including those set up for PWM, is invaluable for plenty of situations. Of course if you’re building something like a real-time operating system that needs responses within a very specific interval you may want to look at more in-depth strategies for probing the GPIO.
Thanks to [Bob] for the tip!
I can get a pre-certified esp32 module via distributors for ~2-3$ with BT classic/BLE/Wifi.. are there any competitive alrernative parts out there with BT classic? Seems like Infineon parts are more expensive & tough for non-tier-1 to get access to QCOM.. though these parts should be lower power vs esp32?
WCH ch583 is a riscv bluetooth alternative, around 1EUR on LCSC:
https://github.com/openwch/ch583
https://www.lcsc.com/product-detail/Microcontroller-Units-MCUs-MPUs-SOCs_WCH-Jiangsu-Qin-Heng-CH583M_C5199261.html
I saw one at 37C3 last week in the badges of FossAsia:
https://badgemagic.fossasia.org/
https://github.com/fossasia/led-name-badge-ls32
You can them on Ali for around 10EUR, depending on the color.
I picked up a couple of $3 wifi outlets, they have esp32s for controlling them, and I found hacking info. One has a built in power meter, looking forward to seeing if this will allow me to read it without the buggy app that these use.
Esimatt, you have a link to that outlet? I’m using the Sonoff Basic R2 for inline switching with Home Assistant.
Just flash tasmota or esphome and call it a day, you don’t need this library (or any app) for that outlet to report.
When I’m toggling pins at hundreds of KHz, how precisely will a <50Hz refreshed display of them help me?
Have you considered the possibility that this may not be intended for you specifically?
In terms of actual debugging this seems pretty useless. I don’t think I have ever had a situation where this would be useful. Most of the time it it isn’t a wiring issue then I need to use a logic analyser, multimeter or oscilloscope.
Also the web server will use up computing resources and will need to create it’s own WiFi network or connect to an existing one. Then there is the downside that it is only for ESP32, it’s better to learn how to debug using tools that you can use for most microcontrollers. Then because it is hosted by the ESP32, if anything happens that causes the ESP32 to halt or glitch or get stuck in a boot loop then the web server won’t work.