-->
Page 1 of 1

How to restart ESP8266 with other binary file after FOTA

PostPosted: Tue Oct 10, 2017 2:01 am
by pjunni
Let's say the ESP8266 runs OLD.bin and uses FOTA to flash and run NEW.bin. If NEW.bin for some reason is unable to get online and for example reflash to NEW2.bin, I would like ESP8266 to notice this issue and simply restart with OLD.bin (which is supposedly still stored in the other binary slot).

I have tried finding documentation about this, without success and even just running the function for checking which binary slot is used, system_upgrade_userbin_check(), always returns a "0", even after a few FOTAs.

Here is some example code using that function: https://github.com/willemwouters/ESP826 ... rade_lib.c

Any suggestions for the following are warmly welcome:
1. why is system_upgrade_userbin_check() always returning a "0"?
2. how to do the actual switching of active code (something like: notice which binary is running, mark the other one, restart with the marked one)
3. other useful or relevant sources

Thank you!