3

I tried to change ZigBee's PAN ID and node discovery, but as soon as I changed its PAN ID, I received a modem status packet (0x03) that apparently described disassociation. After that, I send ATND command for node discovery, and I got modem status (0x06) -- coordinator start, but no discovery result.

I found that if I send any ATND command again after first ATND command, it worked as I expected. Why was a disassociation packet received from ZigBee after I changed the PAN ID?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
REALFREE
  • 4,378
  • 7
  • 40
  • 73

1 Answers1

2

When you change the PAN ID on a coordinator, it's shutting down one network (disassociation) and then creating another (coordinator started). You then need to wait for nodes to join that new network before you can discover them. It doesn't make sense to perform node discovery on a device that isn't currently joined to a network.

If you set ATJN to 1 on the coordinator, the host will receive Join Notification frames (type 0xA5) as devices join the network. Maybe this is what you're looking for?

tomlogic
  • 11,489
  • 3
  • 33
  • 59
  • Thanks for clarification. But I am still confused that I didn't get coordinator started until I issue ND command after changing ID. – REALFREE Mar 21 '14 at 18:57
  • The two events are un-related. If you don't issue the `ATND` command, you'll still see a Modem Status that the coordinator started (as long as you're watching the serial port and processing inbound frames). – tomlogic Mar 25 '14 at 14:39
  • so I guess I need to wait enough time til I get coordinator start packet – REALFREE Mar 25 '14 at 14:41
  • Correct, you can use the ModemStatus frames to keep track of whether you're on a network or not, and only send your `ATND` when you're on a network. Note that you might even want to wait some amount of time to allow other nodes to join your network before doing discovery, or make use of the Join Notification frames (as described in my answer) to receive a message whenever a node joins the network created by the coordinator. – tomlogic Mar 30 '14 at 14:55