ota procedure

Here you'll find the updated available
Post Reply
Stuart
Posts: 126
Joined: Fri Feb 19, 2021 7:46 pm
Has thanked: 5 times
Been thanked: 20 times

ota procedure

Post by Stuart »

It's probably me, but I can't get the ota procedure to work. In fact I'm not really clear what the procedure is. Would it be possible to have a simple step-by-step summary of a) what the steps are and b) how to do them?
Stuart
Posts: 126
Joined: Fri Feb 19, 2021 7:46 pm
Has thanked: 5 times
Been thanked: 20 times

Re: ota procedure

Post by Stuart »

Any chance of some help on this? I'm sure OTA is simple, and as I build more and more stuff it becomes harder to update otherwise. But I haven't found a simple step by step explanation, which would be very useful.
User avatar
cicciocb
Site Admin
Posts: 1899
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 407 times
Been thanked: 1269 times
Contact:

Re: ota procedure

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Wed Apr 21, 2021 10:39 am It's probably me, but I can't get the ota procedure to work. In fact I'm not really clear what the procedure is. Would it be possible to have a simple step-by-step summary of a) what the steps are and b) how to do them?
Stuart,
are you using the toolkit for windows or the last one that is multi platform?
Stuart
Posts: 126
Joined: Fri Feb 19, 2021 7:46 pm
Has thanked: 5 times
Been thanked: 20 times

Re: ota procedure

Post by Stuart »

In principal, either, as I don't know how it is supposed to work. If you know, it will be obvious. If you don't, it isn't.
User avatar
cicciocb
Site Admin
Posts: 1899
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 407 times
Been thanked: 1269 times
Contact:

Re: ota procedure

Post by cicciocb »

I did a synthetic procedure here:
[Local Link Removed for Guests]
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

Re: ota procedure - 1Mb devices will lose their SPIFFS

Post by Electroguard »

Seeing as mention was made of flashing a Sonoff S20 in another thread, be aware OTA updates on 1Mb devices will lose all existing file contents from SPIFFS, so make sure your files are safe first.

The esp implementation of Arduino is limited to 1Mb memory space for the firmware and system memory.
The Arduino OTA works by halving available memory into two pages (either/or) of 1Mb memory spaces.
The existing current arduino firmware loads the OTA update firmware into the other page and switches over control to it, then the original 1Mb memory space remains unused until the next OTA update… resulting in only half of the available memory ever being used.

Annex mitigates that wastage by dividing available memory un-equally to provide just a small OTA loader 'partition', leaving all the remainder available for Annex to use. This necessitates a 2-step OTA process of first switching to the OTA loader, which then downloads the actual OTA firmware update which overwrites the existing.

Another way that CiccioCB was able to squeeze maximum from available memory was to control the memory boundary between the system memory space and file system memory (SPIFFS). So Annex OTA loads the maximum size of OTA update into the maximum available system memory up to the file system memory, thereby leaving existing files intact during the OTA firmware update.

The important exception to this is for 1Mb devices (such as Sonoffs) because there is insufficient memory available to retain existing files + OTA loader + firmware during the OTA procedure, so the files need to be backed-up prior to the OTA update then restored after the update. The slight inconvenience of needing to ensure files are saved is more than made up for by the fact that even 1Mb devices have the same full firmware capabilities as 4Mb (or even 16Mb) devices.
Post Reply