shimmeringbee / zstack

Implementation of a ZNP and support code designed to interface with Texas Instruments Z-Stack, written in Go.

Home Page:https://shimmeringbee.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

If End Devices parent is the Coordinator, it may have issues after restart

pwood opened this issue · comments

When some low power End Devices choose the Coordinator as their parent, they may have issues if ZStack is restarted.

This is caused by ZStack requiring resolution of the IEEE address for any event. As the coordinator is responsible for the End Device it is also responsible for knowing their IEEE address. When ZStack restarts the adapter on Initialise it issues a hard reset, this clears the CC2530's child cache (amongst other things).

return z.writeNVRAM(invokeCtx, ZCDNVStartUpOption{StartOption: 0x03})

This is not a problem for Routers as they regularily reintroduce themselves and the mesh network reforms, some End Devices do not, or do so very infrequently.

It is sensible to issue the hard reset when the adapter is being reconfigured to be a different network, however during normal operation (and restarts) we should not hard reset the adapter.

We could take a couple of approaches:

  • Defer this choice to the ZStack consumer.
  • Query the CC2530 for Channel, Network ID, PAN ID, Extended PAN ID and Network Key, if they differ hard reset.

It should also be noted that if we don't hard reset, then the routers do rejoin the network quicker.