OTA Firmware Updates ?!?
OTA Firmware Updates ?!?
Is there a common way to make OTA Updates?
A first step would be to update only the script files. I think I could implement it myself. But what about a real firmware update to update micropython itself? Is there such a feature already in any project?
EDIT: I should take a look into: https://github.com/rdehuyss/micropython-ota-updater
A first step would be to update only the script files. I think I could implement it myself. But what about a real firmware update to update micropython itself? Is there such a feature already in any project?
EDIT: I should take a look into: https://github.com/rdehuyss/micropython-ota-updater
Re: OTA Firmware Updates ?!?
Hi jedie,
To update script files there are some alternatives (as far as I know):
- FTP Server (from @Roberthh): https://github.com/robert-hh/FTP-Server ... 2-and-PYBD
- uPyLoader (from @Beta_Ravener): https://github.com/BetaRavener/uPyLoader/
- webrepl_cli.py (from micropython/webrepl repo) : https://github.com/micropython/webrepl/ ... epl_cli.py
- http://micropython.org/webrepl/
I'm also working on upydev based on webrepl_cli.py. It's a CLI tool that allows (among other things) to upload scripts/files (one or multiple files) and more recently to recursively sync entire directories.
And it can be easily integrated with Atom or VSC editors. (see https://github.com/Carglglz/upydev/blob ... .md#how-to)
For the firmware update I know there is a work-in-progress (at least for the esp8266). You can see it at http://micropython.org/download
To update script files there are some alternatives (as far as I know):
- FTP Server (from @Roberthh): https://github.com/robert-hh/FTP-Server ... 2-and-PYBD
- uPyLoader (from @Beta_Ravener): https://github.com/BetaRavener/uPyLoader/
- webrepl_cli.py (from micropython/webrepl repo) : https://github.com/micropython/webrepl/ ... epl_cli.py
- http://micropython.org/webrepl/
I'm also working on upydev based on webrepl_cli.py. It's a CLI tool that allows (among other things) to upload scripts/files (one or multiple files) and more recently to recursively sync entire directories.
And it can be easily integrated with Atom or VSC editors. (see https://github.com/Carglglz/upydev/blob ... .md#how-to)
For the firmware update I know there is a work-in-progress (at least for the esp8266). You can see it at http://micropython.org/download
The following are Over-The-Air (OTA) builds of the ESP8266 firmware, for modules with at least 1MByte of flash. The first time you use this build you need to flash one of the "initial image" images using esptool.py as described above. After that, you can update the firmware over the air using the "OTA update" file in conjunction with the ota-client script from yaota8266. The "OTA update" files are digitally signed and will only work with the provided "initial image" files, and vice versa. (Note: this feature is work-in-progress.)
Re: OTA Firmware Updates ?!?
Oh, cool, thanks.
I didn't find the OTA build. They are a bit hidden on the long page They used https://github.com/pfalcon/yaota8266 but this project seems to be unmaintained: last commit is 3 years old
https://github.com/Carglglz/upydev look interesting, but the target group are probably more developers than end users and WebREPL file transfer has known issues on ESP8266: https://github.com/micropython/webrepl# ... e-transfer
I didn't find the OTA build. They are a bit hidden on the long page They used https://github.com/pfalcon/yaota8266 but this project seems to be unmaintained: last commit is 3 years old
https://github.com/Carglglz/upydev look interesting, but the target group are probably more developers than end users and WebREPL file transfer has known issues on ESP8266: https://github.com/micropython/webrepl# ... e-transfer
Re: OTA Firmware Updates ?!?
Yes I know, but maybe it could be a starting pointThey used https://github.com/pfalcon/yaota8266 but this project seems to be unmaintained: last commit is 3 years old
So far I've been using it and it's reliable enough to work with. The only "issues" I've found are:WebREPL file transfer has known issues on ESP8266: https://github.com/micropython/webrepl# ... e-transfer
- The name of the file + absolute path can't be longer than 64 characters (it won't raise any error if longer but the name will be cut at 64)
- The transfer speed when getting files from the device is quite slow so it should be used for small files only.
For both issues there are workarounds (that are already included in upydev) so they are not a big deal.
Yes the target group are developers (although I try to include all the info/examples I can to make it quite easy to use),look interesting, but the target group are probably more developers than end users
Again this and the other tools I've listed could be a starting point (or just get some ideas) if you plan to implement something yourself.
Re: OTA Firmware Updates ?!?
I started a own implementation of OTA updates of own scripts.
OTA Server for the host: https://github.com/jedie/micropython-so ... _server.py
OTA Client for the device: https://github.com/jedie/micropython-so ... _client.py
It doesn't always work, though. Because there is not enough RAM, but only sometimes.
There is room for improvement:
I have tried https://github.com/rdehuyss/micropython-ota-updater too. That would be good for end users. But I get RAM full all the time. Think the github api json data are just to big.
OTA Server for the host: https://github.com/jedie/micropython-so ... _server.py
OTA Client for the device: https://github.com/jedie/micropython-so ... _client.py
It doesn't always work, though. Because there is not enough RAM, but only sometimes.
There is room for improvement:
- Discovery the server takes time.
- The device should send information about his own files in a single step. That would make it much faster.
I have tried https://github.com/rdehuyss/micropython-ota-updater too. That would be good for end users. But I get RAM full all the time. Think the github api json data are just to big.
Re: OTA Firmware Updates ?!?
I refactor the OTA code (WIP):
host part: https://github.com/jedie/micropython-so ... _server.py
device part: https://github.com/jedie/micropython-so ... _client.py
Any idea how to optimize this?!? Any suggestions?
EDIT: I switched the connection: The Device listen on port 8266 and the host scans the network and connects to the device. So i have less code on the device and the host scan is faster.
Next ideas or TODOs:
host part: https://github.com/jedie/micropython-so ... _server.py
device part: https://github.com/jedie/micropython-so ... _client.py
Any idea how to optimize this?!? Any suggestions?
EDIT: I switched the connection: The Device listen on port 8266 and the host scans the network and connects to the device. So i have less code on the device and the host scan is faster.
Next ideas or TODOs:
- The device listen with timeout (e.g.: 30sec) and boots the real code if no connection came in.
- The OTA device code ends always with a reset: Store OTA success/fail into RTC RAM
- Skip OTA on boot if it was done before (Maybe if last OTA was done in last 1hour or so)
Re: OTA Firmware Updates ?!?
I'm done and it works good:
Host part -> https://github.com/jedie/micropython-so ... _server.py
Device part -> https://github.com/jedie/micropython-so ... _client.py
Currently i implement it as follows:
The device always boots alternating: "make OTA" <-> "Start web server" via main.py
I store in RTC RAM which part is active, they toggle on every start.
The OTA part waits 30sec for a connection and will always call in the end: machine.reset()
This means that Web Server and OTA parts have all the RAM for themselves
This is also not really enduser friendly. But what the hell
Host part -> https://github.com/jedie/micropython-so ... _server.py
Device part -> https://github.com/jedie/micropython-so ... _client.py
Currently i implement it as follows:
The device always boots alternating: "make OTA" <-> "Start web server" via main.py
I store in RTC RAM which part is active, they toggle on every start.
The OTA part waits 30sec for a connection and will always call in the end: machine.reset()
This means that Web Server and OTA parts have all the RAM for themselves
This is also not really enduser friendly. But what the hell
Re: OTA Firmware Updates ?!?
Hi and yes
To make it really enduser friendly the "OTA updater" should have a GUI I guess...
I think starting the OTA from the command line is not "really enduser friendly" as you were asking for.This is also not really enduser friendly. But what the hell
To make it really enduser friendly the "OTA updater" should have a GUI I guess...
Re: OTA Firmware Updates ?!?
A simple TK GUI is quickly made.
But then we come to the bigger problem: How to offer an end-user GUI program written in Python?
Actually, it's just: git clone and pipenv run gui
Well, let's see
- MostlyHarmless
- Posts: 166
- Joined: Thu Nov 21, 2019 6:25 pm
- Location: Pennsylvania, USA
Re: OTA Firmware Updates ?!?
There is pyqt4 and designer-qt4 to write GUI programs in Python. Haven't used those in a while, but it wasn't too difficult to get started with that. Not volunteering here, just saying.
Regards, Jan