ota procedure
ota procedure
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
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.
- cicciocb
- Site Admin
- Posts: 2101
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 450 times
- Been thanked: 1389 times
- Contact:
Re: ota procedure
Stuart,[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?
are you using the toolkit for windows or the last one that is multi platform?
Re: ota procedure
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.
- cicciocb
- Site Admin
- Posts: 2101
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 450 times
- Been thanked: 1389 times
- Contact:
- Electroguard
- Posts: 890
- Joined: Mon Feb 08, 2021 6:22 pm
- Has thanked: 287 times
- Been thanked: 329 times
Re: ota procedure - 1Mb devices will lose their SPIFFS
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.
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.