Testing the Feature#
For this test, both the source NCP device and the NCP device to be restored must have the same firmware version installed.
Flash the NCP application to a radio board, start the host and connect to the NCP on the serial port. The following example is for a Linux system with a WSTK mainboard on the USB port enumerated as /dev/ttyACM0.
./Z3GatewayGPCombo -n 0 -p /dev/ttyACM0 -b 115200Form a network using the Network Creator component CLI.
plugin network-creator start 1You should see something like this on the host terminal.
Z3GatewayGPCombo>plugin network-creator start 1 plugin network-creator start 1 NWK Creator: Form: 0x00 NWK Creator Security: Start: 0x00 NWK Creator: Form. Channel: 20. Status: 0x00 NWK Creator: Stop. Status: 0x00. State: 0x00 EMBER_NETWORK_UP 0x0000 Green Power Server Stack Status Callback status = 90 Green Power Translation Table Stack Status Callback status = 90 NWK Steering stack status 0x90Once the host has formed a network, the info command displays essential network information.
Z3GatewayGPCombo>MFG String: AppBuilder MFG Code: 0x1049 node [(>)0807060504030201] chan [20] pwr [3] panID [0xDFEA] nodeID [0x0000] xpan [0x(>)7C3E9F7B090105B6] ezsp ver 0x08 stack type 0x02 stack ver. [7.0.0 GA build 0] nodeType [0x01] Security level [5] network state [02] Buffs: 250 / 255 Ep cnt: 2Join a Z3 Switch or a GPD switch to the above host. This will be used to demonstrate that other network devices are still part of the network after the NCP restore operation.
Print and record the child table, key table, proxy table, and sink table, to verify that the values are unchanged after the restore operation.
(optional) You might also do some operations to see the RX message confirming the network messages. Observe the network traffic on a sniffer.
Use the following CLI to back up the token data to a file
saved_token_data.nvm.plugin trust-center-backup backup-tokens saved_token_data.nvmThe following success message should be displayed. You can also see the file
saved_token_data.nvmin the folder from where the Z3GatewayGPCombo host is running.plugin trust-center-backup backup-tokens saved_token_data.nvm Z3GatewayGPCombo>Opening file 'saved_token_data.nvm' SUCCESS Staus = 0Reset the host using the command reset, which closes the connection to the NCP and exits the host application.
Restart the host and connect another NCP node that is mass-erased and flashed with the same NCP firmware version as the source NCP using the command above. The new NCP may be on another serial port.
Use the info command to show the new NCP's EUI64, which will be different to the one you recorded in the first NCP.
Restore the tokens from the saved file.
plugin trust-center-backup restore-tokens saved_token_data.nvmA message like the following means the new NCP tokens are updated with the saved tokens from the saved_token_data.nvm file.
Z3GatewayGPCombo>Opening file 'saved_token_data.nvm' SUCCESS Staus = 0Reset the NCP with the following command, which initializes it with the restored token data that will restore the network operations.
plugin trust-center-backup reset-nodeThe result of the reset looks like this, ending with a network event of EMBER_NETWORK_UP.
Z3GatewayGPCombo>plugin trust-center-backup reset-node plugin trust-center-backup reset-node Z3GatewayGPCombo>ERROR: ezspErrorHandler 0x21 ERROR: ezspErrorHandler 0x28 ezsp ver 0x08 stack type 0x02 stack ver. [7.0.0 GA build 0] Ezsp Config: set address table size to 0x0002:Success: set Ezsp Config: set TC addr cache to 0x0002:Success: set Ezsp Config: set MAC indirect TX timeout to 0x1E00:Success: set Ezsp Config: set max hops to 0x001E:Success: set Ezsp Config: set tx power mode to 0x8000:Success: set Ezsp Config: set supported networks to 0x0001:Success: set Ezsp Config: set stack profile to 0x0002:Success: set Ezsp Config: set security level to 0x0005:Success: set Ezsp Value : set end device keep alive support mode to 0x00000003:Success: set Ezsp Policy: set binding modify to "allow for valid endpoints & clusters only":Success: set Ezsp Policy: set message content in msgSent to "return":Success: set Ezsp Value : set maximum incoming transfer size to 0x00000052:Success: set Ezsp Value : set maximum outgoing transfer size to 0x00000052:Success: set Ezsp Config: set binding table size to 0x0002:Success: set Ezsp Config: set key table size to 0x0004:Success: set Ezsp Config: set max end device children to 0x0006:Success: set Ezsp Config: set aps unicast message count to 0x000A:Success: set Ezsp Config: set broadcast table size to 0x0023:Error: set: 0x35 Ezsp Config: set neighbor table size to 0x0010:Success: set NCP supports maxing out packet buffers Ezsp Config: set packet buffers to 255 Ezsp Config: set end device poll timeout to 0x0008:Success: set Ezsp Config: set zll group addresses to 0x0000:Success: set Ezsp Config: set zll rssi threshold to 0xFFD8:Success: set Ezsp Config: set transient key timeout to 0x012C:Success: set Ezsp Endpoint 1 added, profile 0x0104, in clusters: 8, out clusters 17 Ezsp Endpoint 242 added, profile 0xA1E0, in clusters: 1, out clusters 1 SinkTable Init.. EMBER_NETWORK_UP 0x0000 Green Power Server Stack Status Callback status = 90 Green Power Translation Table Stack Status Callback status = 90 NWK Steering stack status 0x90infoshows the same details as those from the previous operational network.Check the operation of the Z3Switch that was joined earlier and the already commissioned gpd-switch. They should start working without any rejoin.