Skip to content
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

[FR] Revert to 'other sketch' when in crash bootloop #4866

Open
TD-er opened this issue Nov 2, 2023 · 2 comments
Open

[FR] Revert to 'other sketch' when in crash bootloop #4866

TD-er opened this issue Nov 2, 2023 · 2 comments
Labels
Category: UX Related to operating ESP-easy Type: Enhancement Improve something already present

Comments

@TD-er
Copy link
Member

TD-er commented Nov 2, 2023

ESPEasy currently can start disabling tasks and controllers when the system keeps crashing and rebooting.
As a last resort, ESPEasy should be able to toggle the active boot partition flag to use a previous build.

          const esp_partition_t* partition = esp_ota_get_next_update_partition(nullptr);
          esp_ota_set_boot_partition(partition);

Potential issues:

  • What if there was no previous OTA update, then reverting to the other partition will cause even more issues.
  • What if a boot loop was temporary, caused by a faulty sensor?
  • What if both sketches are causing issues, will we eventually wear out the flash?
  • What if a previous build used a different file system (e.g. SPIFFS/LittleFS), will we wipe user data?

Maybe only add this as a command, so someone can revert to the previous build?

@TD-er TD-er added Type: Enhancement Improve something already present Category: UX Related to operating ESP-easy labels Nov 2, 2023
@tonhuisman
Copy link
Contributor

Maybe only add this as a command, so someone can revert to the previous build?

How to enter a command when in a boot-loop? Is the unit listening to serial input at that time? Can you type the command quick enough before it reboots again?

We could add a setting like 'Last resort: On boot-loop revert to previous release after disabling all tasks, controllers and rules' ? (though probably using a shorter description 😺)

Or maybe prevent it from switching twice, by setting a flag somewhere, that's cleared on a normal boot?

@TD-er
Copy link
Member Author

TD-er commented Nov 2, 2023

More like when someone is testing a new build and it wasn't what they were looking for, then allow to switch back to another build.

In future setups, I would like to add some "safeboot" feature, allowing for 1 small "safeboot" image and thus more space for "MAX" like builds on 4M units.

For nodes with larger flash, one could have like a test image with lots of debug code and a release build and without flashing you might want to toggle between builds?

Or a setup/maintainance build and a "consumer" build?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: UX Related to operating ESP-easy Type: Enhancement Improve something already present
Projects
None yet
Development

No branches or pull requests

2 participants