Page 1 of 1

ota procedure

Posted: Wed Apr 21, 2021 10:39 am
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?

Re: ota procedure

Posted: Wed May 05, 2021 6:55 pm
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.

Re: ota procedure

Posted: Wed May 05, 2021 7:38 pm
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?

Re: ota procedure

Posted: Thu May 06, 2021 9:03 pm
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.

Re: ota procedure

Posted: Fri May 07, 2021 8:15 am
by cicciocb
I did a synthetic procedure here:
[Local Link Removed for Guests]

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

Posted: Fri May 07, 2021 11:13 pm
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.