There're currently some ways to upload an OTA firmware to a board where espurna is already flahed:
However, all of these are not easily to use while running in an CI/CD toolchain:
This issue requests a rather simple, client-driven, approach for uploading the firmware. It's more or less based on the first way to upload the firmware to the board via the web UI. There's already a REST API, which allows to set different values. It would be nice to have an upgrade endpoint there, too, which takes the firmware.bin as the payload and updates the board accordingly.
The easiest solution here would be, to make the /upgrade endpoint public API and document it so, however, I'm not sure, if this is the best way of doing it. But maybe it's behavior can be taken as an example, as it's working pretty well currently with the following cURL command:
curl -XPOST --digest -uadmin:fibonacci -H "Content-Type: multipart/form-data" \
-F "filename=@build/firmware.bin" -F "name=\"upgrade\"" http://192.168.4.1/upgrade
Good tip. Current API implementation is too focused on sending and receiving simple values and it would require a complete rewrite to support blobs... I'm not doing this atm because I think your approach is good enough.
I have added this info to the wiki OTA page.
Thank you!!
Thanks for all your work xoseperez! If you are interested in using this for automatic deployments check out https://github.com/shaguarger/espurna-pipeline for more informations...
Amazing!! Thanks for sharing
Most helpful comment
Thanks for all your work xoseperez! If you are interested in using this for automatic deployments check out https://github.com/shaguarger/espurna-pipeline for more informations...