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

[Request] OTA Update via URL #319

Open
D3R-ST3FAN opened this issue Nov 8, 2022 · 4 comments
Open

[Request] OTA Update via URL #319

D3R-ST3FAN opened this issue Nov 8, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@D3R-ST3FAN
Copy link

D3R-ST3FAN commented Nov 8, 2022

Is your feature request related to a problem? Please describe.

I have a couple of neighbors that now also run OpenDTU.
They are not into self compiling (they are using the Olimex POE Variant).
I do compile binaries for them and make it available via a URL.
But they still have do the OTA Upload via WebIF.

What about OTA Update via URL? Like e.g. tasmota does.

Describe the solution you'd like

introduce a field to provide an OTA URL and an Update button.

Describe alternatives you've considered

No response

Additional context

No response

@D3R-ST3FAN D3R-ST3FAN added the enhancement New feature or request label Nov 8, 2022
@stefan123t
Copy link
Contributor

Tasmota uses safeboot to ensure OTA update via OTA URL does not break things.

See OTA_URL and OtaUrl in

I do not know if we have enough space for app0 and app1 partitions to store two firmware images side-by-side ?

@CommanderRedYT
Copy link
Contributor

@stefan123t It is a/b partitions, right? I know that the esp-idf has some flag for marking a partition as good.

When you use this, it is initially marked as bad, so in case something crashes, the bootloader goes back to the old image.

The code can do checks and when it thinks its valid (and maybe after 1 minute) and then mark the partition.

https://docs.espressif.com/projects/esp-idf/en/v5.3.1/esp32/api-reference/system/ota.html#app-rollback

@stefan123t
Copy link
Contributor

stefan123t commented Oct 5, 2024

@CommanderRedYT thanks for adding the ESP-IDF context. I thought that there is two boot environments provided by so called safeboot in Tasmota. But this explains the underlying working principle, Thanks!
For me the question is more how big can we make such an app image. If we consider 4MB of the average ESP32 flash mem, it can be max 2x~1.8MB to leave some slack for the safeboot loader and the basic pin_mapping.json and config.json on the SPIFFS.
At the moment we start to require 8MB ESP32S3 for eg OpenDTU-OnBattery in order to fit all the extra functionality, ie this might work then but nly on a newer ESP32S3 with 16MB for such large app images.
Maybe this ratio gets a bit better if we can source out the NLS strings into some shared dictionary / JSON archive that we can import into the Vue app. See PR #1679 / #1830 for @tbnobody|s forthcoming ideas into that direction.

@CommanderRedYT
Copy link
Contributor

https://github.com/tbnobody/OpenDTU/blob/master/partitions_custom_4mb.csv

I believe this is the partition table. I would propose the following.

We have two options:

a)

Our chip is 4MB. We can easily allow for two app partitions, however things like more languages can be disabled and added via language packs at runtime. (Maybe be able to swap one language with another? Also maybe client side only?)

b)

Our chip is 8MB or larger. We can store all the information in a app partition so we do not need language packs.

Both variants do not need this safeboot as the functionality is part of esp-idf.

Safeboot is different to a/b partitions as it only uses one app partition (which therefore can be larger).

With safeboot I see two problems:

  1. It cannot perform a rollback. Right now, if implemented, we can add a button to switch app partitions and therefore allow the user to rollback to the previously installed firmware.

  2. It would require to update the partition table. In theory, you can even do this via OTA but I would recommend to not do that.

FYI @tbnobody maybe this helps with deciding how to proceed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants