-
Notifications
You must be signed in to change notification settings - Fork 639
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
Settings overwritten after NoFUSS OTA update #1808
Comments
Which Core version was it? Release, git? If git, were there any modifications to libraries / espurna / ldscripts? About the flash dump, these are not really random. Check out the last bytes of the .bin you are using with `xxd'. I do see dhcps strings right at the end. |
@mcspr Thank you for creating this issue. I am sorry for not doing it myself. I was trying to pin point the issue. |
I think I have not read updater code clearly, for some reason I thought it measures from the sketch end address. If it positions itself at the spiffs start and steps back based on OTA size, it will surely overwrite the eeprom sectors that are not defined at build. In platformio builds we offset it specifically for this reason (see #1559 files for arduino) You can check the updater code though! DEBUG_UPDATER (UPDATER in debug menu) will print a bunch of stuff about the process. |
EEPROM_rotate handles such case by disabling rotation. However, there needs to be eeprom commit to record the last known config to the last sector. having newest sector somewhere in the danger zone results in a data loss, since we never copy it to the last one.
|
Instead of Updating nofuss, what do you say if we can update in espurna itself @mcspr this pull request will work ? |
It will do the same thing, yes. And I just noticed that CUSTOM_RESET_NOFUSS is missing from NoFuss reset. defferedReset would've set it via customResetReason(...), but it can also happen right there. Info banner would show "Reboot after successful NoFUSS update" |
Closing via #1809 |
I too faced similar issues and device lost configuration after update via Nofuss.
I enabled debug in eeprom rotate and saw this -
Clearly blocks 1016,1017 and 1018 are overwritten. While 1019 is intact so EEPROM Rotate picked up configuration from 1019, but since the latest data was not present in the sector 1019 . So the device lost some configuration keys.
But once again question is, why are these sectors are being overwritten during OTA. For information - I did a custom build with no SPIFSS enabled(In both previous and new binary).
I also disabled calling of custom_crash_callback as well, via an addition flag
#define SAVE_CRASH_INFO 0.
I think it is not an issue exactly with Espurna, but something with nofuss or esp8266httpUpdater itself(Which is used by Nofuss).
However its note worthy for all espura users as well, that if we build it with latest core, and deliver OTAs to devices, few sectors will be overwritten. Depending on the code size it may overflow all 4 sectors also.
Anyway, i'll create another issue on arduino esp8266 core as well, but the same could also be true for ArduinoOta library which is used for web based OTA.
Sectors from 378000 to 3f9000,3f9000 to 3fa000 , 3fa000 to 3fb000, 3fb000 to 3fc000 were used by eeprom rotate. And were clean. In flash dump also as expected. Then i took the dump of these same sectors right after OTA and saw these sectors were filled with something.
Originally posted by @arihantdaga in #1595 (comment)
The text was updated successfully, but these errors were encountered: