Hi, I’ve observed the following behavior when JV=1 and NW>0: when the router comes up after a power cycle, and the coordinator is not present on the current channel/PAN, the router would re-join the PAN. This is the expected behavior as described in the XBee manual.
Set/read the channel verification setting. If enabled, a router will verify a coordinator exists on the same channel after joining or power cycling to ensure it is operating on a valid channel, and will leave if a coordinator cannot be found (if NJ=0xFF). If disabled, the router will remain on the same channel through power cycles.
However, regarding NW, it is not clear whether the NW timer is set upon power-up, or only after joining a PAN.
My main goal is that the router will first try to verify its coordinator (JV=1) and then, if it is not found after 3NW, leave the PAN.
Network Watchdog Timeout. Set/read the network watchdog timeout value. If NW is set > 0, the router will monitor communication from the coordinator (or data collector) and leave the network if it cannot communicate with the coordinator for 3 NW periods. The timer is reset each time data is received from or sent to a coordinator, or if a many- to-one broadcast is received.
My indication for leaving the PAN is receiving the “disassociated” state in the modem status frame. Though it sounds un-logical that the router is “disassociated” if it was never “associated” (after the power cycle).
When I set JV=0, the NW timer does expire and the router resets its network state, as expected; this gives me the impression that the NW timer is set only upon joining/re-joining.
From the XBee manual:
The following events restart the network watchdog timer:
•RF data received from the coordinator
•RF data sent to the coordinator and an acknowledgment was received
•Many-to-one route request was received (from any device)
•Changing the value of NW.
Still not clear whether the NW timer starts on power-up or only after a successful join.
Is my assumption correct? is the observed behavior is expected?
Remarks:
[ul]
- Both devices have 2xA7 firmware, and operate in API mode.
- Both devices were previously associated successfully.
- Coordinator has NJ=0xFF.
[/ul]