Device had problem with network, it seem to go into this(ZDapp.c) part:
if ( events & ZDO_DEVICE_RESET )
{
#ifdef ZBA_FALLBACK_NWKKEY
if ( devState == DEV_END_DEVICE_UNAUTH )
{
ZDSecMgrFallbackNwkKey();
}
else
#endif
{
// Set the NV startup option to force a "new" join.
zgWriteStartupOptions( ZG_STARTUP_SET, ZCD_STARTOPT_DEFAULT_NETWORK_STATE );
// The device has been in the UNAUTH state, so reset
// Note: there will be no return from this call
SystemResetSoft();
}
}
Turn out, it is become DEV_END_DEVICE_UNAUTH. It did joined the coordinator before but, because of poor connectivity for a long period of time,
it lost connection. Then it become joined but lost authenticated from trust center.
Any hint on why it lost authenticated from trust center?
To solve this, I add in compile option ZBA_FALLBACK_NWKKEY, but this bring out a side effect.
If the device is lost connection because of poor connectivity from it original coordinator, it will suddenly jump join to other nearest coordinator(without permit join).
Without compile option ZBA_FALLBACK_NWKKEY, it will not jump to nearest coordinator, but it will always reset(because of SystemResetSoft();)
Is there a suggestion/way to change this line:
{
// Set the NV startup option to force a "new" join.
zgWriteStartupOptions( ZG_STARTUP_SET, ZCD_STARTOPT_DEFAULT_NETWORK_STATE );
// The device has been in the UNAUTH state, so reset
// Note: there will be no return from this call
SystemResetSoft();
}
So that it will not reset the device? Because, if the device is a light switch, it will switch off the light by surprise which is not a good solution to restore the network.
Please advice. Thank you.
