clockwise icon indicating copy to clipboard operation
clockwise copied to clipboard

[Feature Request] Web firmware updates

Open JeffWDH opened this issue 1 year ago • 6 comments

I think most people use this project for a clock that sits on a shelf, wall, or other location that may not be near a computer. It would be handy to have the ability to upload new firmware to the device without physically connecting to it.

Fortunately, this is pretty easy on an ESP32 using Arduino: https://github.com/espressif/arduino-esp32/blob/master/libraries/ArduinoOTA/examples/OTAWebUpdater/OTAWebUpdater.ino

A prerequisite for this IMO would be to implement some sort of authentication on the web interface. We wouldn't want any unauthenticated user to have access to change settings / potentially upload malicious code.

@jnthas what are your thoughts on this?

JeffWDH avatar Jul 23 '23 12:07 JeffWDH

I agree. Update it remotely was one of the things I thought but in that time I used the PxMatrix to drive the display and it frozen when I updated via OTA, then I gave a break for this feature. Nowadays, my plan is to use the same Improv protocol I use today for Serial but for BLE. The problem is, I have to implement it from scratch because there is no library for that. I did it for Serial and I would like to do the same for BLE.

jnthas avatar Jul 24 '23 02:07 jnthas

Yes, having the ability to update the firmware without having it connected to your computer would be awesome. how would you integrate https://github.com/espressif/arduino-esp32/blob/master/libraries/ArduinoOTA/examples/OTAWebUpdater/OTAWebUpdater.ino to the project? thanks

robegamesios avatar Sep 19 '23 17:09 robegamesios

The project already have a webserver, I believe it's not that hard to implement this feature, add a couple more endpoints and process like you guys sent as example. I'm creating a tag for this.

jnthas avatar Sep 22 '23 01:09 jnthas

@jnthas I was able to do a sample of Mario clock and I was able to upload a bin file to upload it. not clean but worked for me. see attached.

  1. upload the otaDefaultUpdate to esp32.
  2. then access the ip address and upload the Mario clock bin file
  3. I added a reset wifi button.
  4. Setting wifi is the same in wifi manager. then include the timezone

Like you said, if it can get implemented as an endpoint to upload the bin file that would be super awesome. thanks I dont know how to create the bin file for the other clock faces e.g. canvas, pacman, time in words, world clock, or do you have a ino file for them? basically the OTA code needs to get included every time.

mariobros-clock.zip [otaDefault mariobros-clock.ino.bin.zip Update.ino.bin.zip](https://github.com/jnthas/clockwise/files/12840011/otaDefaultUpdate.ino.bin.zip) otaDefaultUpdate.ino.zip

robegamesios avatar Oct 08 '23 07:10 robegamesios

Hi Rob. Thank you! Could you open a PR so we can merge it or work on a final version together.

jnthas avatar Oct 08 '23 15:10 jnthas

@jnthas @JeffWDH check this out.

  1. Ive included all the current clockwise themes and Audio Visualizer which can be selected and the led matrix panel will update to it and restart itself.
  2. i also added OTA.
  3. I'm having issues with the Canvas clockface though, if the audio visualizer is included i get a No memory error when deserializing the json. maybe you can figure it out? I also tried to make the Audio visualizer a clockface but i still get the no memory error.
  4. right now the only way the only for me to use the canvas theme is to upload firmware via OTA. would be great to not have to upload it as a firmware.

Still prototyping, can use more improvement.

https://github.com/robegamesios/clockwise/tree/feature/add_audio_visualizer

Screenshot 2023-11-11 at 7 43 11 PM Screenshot 2023-11-11 at 7 54 03 PM

robegamesios avatar Nov 12 '23 03:11 robegamesios