An example on getting firmware updates to your ESP32 projects directly from GitHub releases (i.e. OTA updates, all for free!).
This repo serves as an example for GitHub
and for GitLab!
OTA-Hub is designed to do one thing, and one thing only:
Deliver Over-the-Air updates onto your ESP32/embedded devices directly from your code releases in an obvious, clean, light-weight way.
OTA-Hub is the open-source solution to enable building and hosting your firmware updates on Git (Hub or Lab) and accessing them simply on your ESP devices. This repo is the setup guide, and the device client is available on the PlatformIO Registry - there is also a more involved project example showing off even cooler features here.
OTA-Hub Cloud (coming soon) is a cloud software that builds on that by enabling per-device provisioning, and data endpoints to plug into your stack. Think AWS IoT Core but massively simplified - great for hobbyists, prototyping, and startups. OTA-Hub Cloud comes in both free and paid tiers.
Find out more about this and our other open source projects and products at ota-hub.com.
- OTA has long been a sore point in hobbyist and early-stage prototyping because while AWS and Blynk etc. offer OTA solutions they all require so much set up, and crucially so much commitment that it hardly seems worth it.
- Combine that with the weird insistence on drag and dropping
.binfiles into file upload ports, or constantly replacing the file in a dedicated S3 bucket - it becomes a mess bound to go wrong (and impossible to actually trace to your code!). - Oh, and for all that inconvenience you often have to pay, or are limited to only a handful of devices and throttled performance.
- No-longer worry about drag-and-dropping
.binfiles into some fiddly UI. - Easily trace your code to your releases to your deployed firmware.
- Not locked into any eco-systems you probably aren't using already (you're probably already using GitHub / GitLab).
- Client-agnostic! Implement OTA H-b on-top of secure or insecure* connections, on 4G, NB-IoT, or WiFi modules.
- The DIY version is open-source, completely free, and GitHub/Lab hosting is also completely free!
- i.e. free, clear, no-fuss, simple OTA - perfect for "just getting started".
* Note that our default examples are for SSL-enabled connections, as GitHub requires a secure connection. As this is open-source, you can of course use your own storage buckets APIs for insecure connections etc.
There are only two steps you need to consider for OTA updates from GitHub:
-
Set up the CI/CD (see the CI CD guide) on your GitHub/Gitlab repo to automatically build the firmware on new releases.
For GitHub
This is as easy as copying the .github/workflows/ folder into your PlatformIO base directory (like in this example), or even just fork this repo! Then, build new releases as normal.

and for GitLab
This is as easy as copying the .gitlab-ci.yml file into your PlatformIO base directory (like in this example), or even just fork this repo! Then, build new releases as normal. -
Include the OTA-Hub esp client library and example code you'll find in src/main.cpp. Note the
#defines, and the inclusion ofOTA::isUpdateAvailable(),OTA::performUpdate(..), andOTA::followRedirect(..).

That's it!
- To avoid duplication, there is more content on how to set up GitHub, GitLab, custom providers, and further examples github.com/Hard-Stuff/OTA-Hub-device_client.
This library has been tested on the ESP32S3 with both the internal WiFi functionality and a SIMCOM SIM7600G, both with HTTP and HTTPS connections, both with GitHub and GitLab, and both on public and private repositories.
We're looking for people to work with us further on this - you can get started with issue reports or merge rquests, or you can contact us at ota-hub@hard-stuff.com.
Hard Stuff is a hardware prototyping agency and venture studio focussing on sustainability tech, based in London, UK. Find out more at hard-stuff.com.
This library is written and provided open-source in the hope that you go on to build great things.