I have a small PIC-based data collection board that reports switch closure times via an onboard XBee module to a ConnectPort X2. Both devices are running the DigiMesh firmware. The X2 is running a Python app that I've written that receives the data from the XBee module and sends it to a web service over the internet.
This system works perfectly as long as the data collection board stays within the X2's range. The problem is that the data collection board containing the XBee module will be attached to equipment items that will continually move into and out of the ConnectPort coverage zone. Upon sensing switch closures, the board periodically attempts to send the new data to the X2(regardless of whether it is in range as it currently has no way of knowing) until it gets an acknowledgement of successful reception back from the X2.
If the board moves out of range, and while out of range, switch closures occur (and the XBee module starts attempting to send the data while out of range), and then is moved back into range, I see the XBee module periodically attempting to resend the data, but the X2 doesn't pick anything up. Furthermore, if I use the web interface to the X2 and click the "XBee Network" link in the Configuration section and click the "Refresh" button to refresh the list of devices in the "Network View of XBee device", the XBee module on the data collection board isn't listed and the X2 router is the only recognized device in the network.
Eventually, the XBee module on the board shows up in the network list, and the X2 picks up one of the transmission reattempts, but it often takes 20-30 minutes before this happens, even though the device is retrying every minute or so and the green association LEDs on the X2 are lighting each time.
However, if I move the board out of range of the X2 for a period of time (10 minutes) and then move it back into range WITHOUT any switch closures, and then I toggle some switches, the data transfer works fine. The module also reappears in the XBee network listing right away.
Since the reassociation happens very quickly when the device moves out of range and back in WITHOUT switches changing and hence no data transmissions occuring, but takes 20-30 minutes if switch closures are detected and transmissions are initiated in the case when it's out of range, it appears the transmit retries are somehow affecting the XBee module's reassociation with the X2's network.
Is there any way for the PIC uC on the data collection board to query the XBee module to know when it is back "in range" and therefore safe to send?
ANy ideas why the ConnectPort takes so long to reacquire the board when it moves back in range?
I'm using pretty much default settings, and am operating the Xbee module in transparent mode (i.e. not API).