OTA

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
hansamann
Posts: 7
Joined: Thu Jun 09, 2016 1:37 pm

OTA

Post by hansamann » Thu Jun 09, 2016 1:44 pm

I am wondering how OTA would be realized using MicroPython.

In my mind:
- if connected, the board keeps polling a http endpoint from time to time. Or: receives a trigger via MQTT for example
- downloads a new py script and saves it in the file system
- reconfigures the boot.by to load the new py script instead of the old one. Delete the old one (or save as fallback?)
- restart esp

Again, is there some work ongoing somewhere that I could take a look at?

Cheers
Sven

markxr
Posts: 62
Joined: Wed Jun 01, 2016 3:41 pm

Re: OTA

Post by markxr » Thu Jun 09, 2016 7:14 pm

Probably some kind of downloader which downloads new files into a subdirectory in the fs, e.g. "new.d" or something.

Then after all downloads are complete and confirmed, then rename the files.

Otherwise, you'd risk "bricking" the device on an OTA update if it fails half way (or, say, the power fails).

Unfortunately the TLS library doesn't verify certificates, which makes downloading content over http distinctly risky unless you're going to do your own validation of the images somehow in a secure manner.

jms
Posts: 108
Joined: Thu May 05, 2016 8:29 pm
Contact:

Re: OTA

Post by jms » Sat Jun 18, 2016 11:19 am

Best thing is to not bother with TLS at all, as it's slow and ineffective and as has been said and validate it yourself possibly using a secret key and a bit of hashing.

Post Reply