Recovery from Safemode
This example demonstrates how to recover the module if it enters Safe Mode.
It is extremely important for a host application to handle safe mode operation. In safe mode, the commands available to the host are purposely restricted to simplify the recovery process. See Update and Recovery.
In this example, the force_safemode command is used to enter safe mode. This command exists only to allow demonstration of safe mode recovery procedures. In a real-world situation, the module enters safe mode due to repeated faults.
The example works through each of the following steps:
- Force the module into safe mode
- List and clear faults
- Return the module to normal operation
Force Safe Mode
Connect to the module using a ZentriOS terminal - see Getting Started. Once you have a terminal connected, issue the following ZentriOS commands to force the module into safe mode. The first command returns the MAC address of the module. The MAC address is required by the force_safemode command.
> get wlan.mac <module MAC address> > force_safemode <module MAC address>
In safe mode, the prompt (if enabled) changes to
SAFEMODE> in human friendly command mode and is prefixed with
S in machine friendly command mode.
Here's an example demonstrating how to force safe mode:
> get wlan.mac 4C:55:CC:10:10:98 > force_safemode 4C:55:CC:10:10:98 Forcing safemode... Rebooting [Disassociated] ZentriOS-188.8.131.52, Built:2015-11-11 11:11:11 for AMW004.3, Board:AMW004-E03.3 *** Max faults exceeded. Entering Safe Mode. SAFEMODE>
The module only enters safe mode if a combined total of 8 watchdog faults or hardfaults occur. Each time a fault occurs, key information is logged to non-volatile memory to help Zentri isolate the fault. To obtain a list of faults, use the faults_print command shown in the example below. Note that this particular example does not show any real faults, since safe mode was forced.
SAFEMODE> faults_print 0: NMI Exception, uhandle:00 bhandle:00 1: NMI Exception, uhandle:00 bhandle:00 2: NMI Exception, uhandle:00 bhandle:00 3: NMI Exception, uhandle:00 bhandle:00 4: NMI Exception, uhandle:00 bhandle:00 5: NMI Exception, uhandle:00 bhandle:00 6: NMI Exception, uhandle:00 bhandle:00 7: NMI Exception, uhandle:00 bhandle:00 Success
If you have a module that has entered safe mode unintentionally, please open an Zentri Support ticket and post the output of the faults_print command.
Return to Normal Operation
To reset all faults in preparation for returning the module to normal operation, use the faults_reset command.
SAFEMODE> faults_reset Success SAFEMODE> reboot Rebooting ZentriOS-184.108.40.206, Built:2015-11-11 11:11:11 for AMW004.3, Board:AMW004-E03.3 [Ready] >
After resetting faults, the module must be either factory reset or rebooted before normal operation is returned.
The prompt (if enabled) automatically returns to