Over-the-Air Updates on an ESP32, Courtesy of Bluetooth Low Energy Connectivity and a React Web App

Eschewing Wi-Fi, SparkFun's Englandsaurus writes a guide on programming an ESP32 to accept over-the-air updates over Bluetooth instead.

SparkFun's Englandsaurus has published a new guide to over-the-air (OTA) updating an Espressif ESP32 microcontroller, but with a twist: Rather than the more common Wi-Fi connectivity, it uses Bluetooth Low Energy (BLE).

"There are tons of examples out there that show you how to update your ESP32 Over-the-Air (OTA) using Wi-Fi and transferring a binary file through your router, but what if you aren't near a Wi-Fi router, or simply just don't want to use WiFi on the ESP32 and still want to update your software wirelessly," Englandsaurus asks. "This is where this webapp comes in handy."

"Not only is the app able to flash a binary to your ESP32, but it's also able to tell if you have the most current software, and also what the most current software is that's available for your device based on its hardware version. This app takes much of the guesswork away from an end-user who may be utilizing the easy to use, OTA update."

Englandsaurus' approach is different to most, in that it doesn't require Wi-Fi connectivity β€” meaning there's no need to hard-code Wi-Fi details into the program being flashed. Instead, the ESP32 is flashed over BLE β€” which, Englandsaurus admits, "isn't the best way to do it, [but] is already in use elsewhere" β€” via a React web app.

"Now, you can feel free to add all sorts of things to your ESP32 sketch or your WebApp! Be sure to always verify that you can not only flash a compiled binary, but also flash to an ESP32 running that compiled binary," Englandsaurus advises. "Also, make sure to keep good track of binaries and be doubly sure that a compiled binary has the proper hardware and software version number coded in or you may end up with issues down the road. With some careful housekeeping, a relatively easy end user experience is possible!"

The full guide is available now on SparkFun's learning platform.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles