Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup OTA option #37

Open
15 of 27 tasks
Tracked by #9
mitra42 opened this issue Oct 24, 2024 · 2 comments
Open
15 of 27 tasks
Tracked by #9

Setup OTA option #37

mitra42 opened this issue Oct 24, 2024 · 2 comments

Comments

@mitra42
Copy link
Owner

mitra42 commented Oct 24, 2024

See example on https://github.com/Juerd/ESP-WiFiSettings/blob/master/examples/ArduinoOTA/ArduinoOTA.ino
as will be integrated with the WiFi portal etc,

Also some examples at Mischianti

Probably want OTA when connected to WiFi

Need to understand how OTA is intended to work in Arduino - Instructions at https://www.instructables.com/Set-Up-an-ESP8266-Automatic-Update-Server/ look adaptable

  • Build module that can do OTA following pattern, calling /update/
  • Build something on server to display headers and check what look like on ESP32
  • Return .bin
  • Ensure client installs and restarts
  • Think through different variations of node - e.g. which sensors etc, they'll all be different .bins
  • Think about path for projects
  • Rework so picks up by node; then by type;
  • Document process to build the .bin
  • Automate process - command line builds with various _local.h
  • Put on main server, then parameterize server somehow (note node has no other current reason to hit the http server)
  • Need a way for approved Organization users to upload bins
  • Way to notify devices to update now (rather than once an hour) - probably in the UX
  • Dropdown or similar to select which device to download.
  • Add the OTA version to the description uploaded at power up
  • Have server look at OTA version and refuse to update if newer (which will help with the developer problem)
    • - note same version, different MD5 means update so developer can either put on server in which case board self-updates (new MD5) or bump the version number and program via cord

** ESP32 **
See notes in ota.cpp on branch 37-OTA Appears cant use http

** SPIFFS **
See instructable and notice Spiffs at
./Library/Arduino15/packages/{esp8266,esp32}/tools/mkspiffs I remember reading won't work as plugin with Arduino 2.x

  • Figure out how to use mkspiffs
  • Add to Server - probably in same directory as binary
  • Add to node - probably immediately after updates sketch
  • Document how to build the .spiffs

Further

@mitra42
Copy link
Owner Author

mitra42 commented Jan 12, 2025

Refactor for two reasons
a: use a project defined board name, so can change sensors etc on it and still get new code
b: Look for org/project/node org/node org/project/board org/board
c: this gets rid of the "+"

  • get board name from _local.h not built from "*_WANT"
  • check that server doesn't care - it shouldnt
  • new findMostSpecificFile set of rules
  • update docs to match
  • Update _local-template.h to match _local.h

@mitra42
Copy link
Owner Author

mitra42 commented Jan 26, 2025

Thanks to help from Jonathan Semple - this is now working on both ESP8266 and ESP32's - the code for both is in system_ota.cpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant