Recovery Using the Safemode App
When a problem occurs with a ZAP, the Safemode App attempts an automatic recovery.
The Safemode App resides on extended flash. It attempts to recover from faults using the limited set of functions available in safemode.
The Safemode App is invoked in a number of error conditions:
- OTA firmware update failed
- maximum system faults exceeded
- zap.auto_run ZAP not found or could not be loaded
- Forced safemode - safemode entered deliberately for testing purposes. See force_safemode.
If the Safemode App is successfully loaded, it attempts to recover with fault reset, OTA firmware update, and factory reset.
Safemode App Counters
For each of its recovery strategies ZentriOS counts the attempts. Safemode App counters are stored in a battery backed up register and persist through reboot. ZentriOS specifies the maximum allowed attempts.
Counter Name | Description | Default Max Value | Reset Condition |
---|---|---|---|
Safemode App Load | Counts the number of times the Safemode App is loaded | 10 non-configurable | Zap successfully loaded, reset faults, power cycle |
Faults Reset | Counts the number of times the Safemode App invokes a faults reset | 3 | Zap updated, factory reset, power cycle |
OTA | Counts the number of times the Safemode App invokes an OTA | 3 | Zap updated, factory reset, power cycle |
Factory Reset | Counts the number of times the SafemodeApp invokes a factory reset | 3 | Zap updated, power cycle |
Safemode App Procedure
The Safemode App receives, as a parameter, the error condition that caused ZentriOS to enter safemode.
The default Safemode App procedure is as follows:
- If the cause is maximum system faults exceeded:
- If the faults reset count is less than maximum allowed resets:
- increment faults reset counter, reset system faults and reboot
- If the faults reset count is less than maximum allowed resets:
- else if the OTA count is less than maximum allowed OTAs:
- if the network can be brought up successfully:
- increment the OTA counter and force an OTA
- if the network can be brought up successfully:
- else if the factory reset count is less than maximum allowed factory resets:
- increment the factory reset count, factory reset, reboot
- else:
- open the safemode command console, and start the Soft AP and the remote terminal.
Custom Safemode App
Under special circumstances a customer may require a custom Safemode App that follows a different procedure. Contact Zentri support to discuss this.
SoftAP and Remote Terminal Recovery
ZentriOS tracks the number of attempts to load the safemode app. If this count exceeds the specified maximum attempts, ZentriOS enters Kernel Safemode Serial command mode and runs the Soft AP and remote terminal.
In this case a manual recovery may still be possible using the remote terminal via Soft AP. Contact Zentri support for details.