GitHub ESP32 OTA Updates, Now In MicroPython Flavor

Wouldn’t it be great if you could keep all of your small Internet-connected hacks up to date with a single codebase? A couple of weeks ago, we wrote up a project that automagically pulls down OTA updates to an ESP32 from GitHub, using the ESP32 C SDK. [Pascal] asked in the comments, “but what about MicroPython?” Gauntlet thrown, [TURFPTAx] wrote ugit.pya simple library that mirrors all of the code from a public GitHub Python repo straight to your gizmo running Micropython.

[Damped] wrote in about Senko, another library that does something very similar, but by then [TURFPTAx] was already done. Bam! Part of the speed is that MicroPython includes everything you need to get the job done – parsing streamed JSON was the hard part with the original hack. MicroPython makes those sorts of things easy.

This is one of those ideas that’s just brilliant for a hacker with a small flock of independent devices to herd. And because ugit.py itself is fairly simple and readable, if you need to customize it to do your own bidding, that’s no problem either. Just be sure that when you’re storing your WiFi authentication info, it’s not publicly displayed. ([TURFPTAx], could I log into your home WiFi?)

What’s [TURFPTAx] going to be using this for? We’re guessing it’s going to be deploying code to his awesome Open Muscle sensing rigs. What will we be using it for? Blinky Christmas decorations for the in-laws, now remotely updatable without them having to even learn what a “repo” is.

5 thoughts on “GitHub ESP32 OTA Updates, Now In MicroPython Flavor

  1. Are OTA Updates useful unless you have a gigantic network or sell a commercial product? I find my ESP8266 and ESP32 run on the same code since years. WPA2 enabled of course. They are mostly sensors and displays going on with their lives sending UDP packets. No smart features needed, I find that in a LAN UDP is generally reliable for non mission-critical tasks.

    KISS prinicple applied and an ounce of lazyness. MQTT? Never saw the need, it might be ignorance on my end too.

    1. Yes, esp. if they’re on a remote property. I have it in my to-do list to do exactly this project, to replace my janky file management over mqtt setup. 😅 Thanks TURFPTAx!

    2. But how many weeks of non-stop changes did you have while you were first fiddling with it? Part of the appeal of OTA is that it makes changes easier, which is especially helpful early in the process. Plus, if you’ve got 10 identical sensor packs around your house, one push to GitHub will trigger the update for all of them at once.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.