I have an XBee3 as a Zigbee coordinator and another XBee3 as a Zigbee end node. Both are running Micropython code.
The end node sleeps for about 5 minutes between sampling various sensors and then creating a packet that is sent to the coordinator - all that works nicely.
I also want to have the coordinator pass a custom packet to the end node (providing commands to adjust the settings etc).
My understanding is that the coordinator will accept the ‘xbee.transmit()’ function call and queue up the message until the end node wakes up when it will pass the message on to the end node.
I have two problems:
- if I send the command to the end node more than about 2 minutes before the end node wakes up, I get a ‘ENOCONN’ error back from the ‘xbee.transmit()’ function. (Less than about 2 minutes then it goers through as expected). How to I extend the timeout (if that is what it is) in the coordinator to allow for the end node to sleep for 5 (or more) minutes?
- the ‘xbee.transmit()’ function seems to block until the message is sent. This stops the other operations that the coordinator is supposed to be doing and also seems to go against my understanding that the coordinator can queue up to 8 packets - if it blocks on the first one then how can it queue the others!. How can the ‘xbee.transmit’ function be made to no block but queue the packet?