It seems that one can quite easily lockup these XBee modules. Today I used the X-CTU application to change the XBee configuration from Router AT to Coordinator AT (more on that later) and after writing to the XBee module completed I suddenly lost all communication. “xbee unable to communicate with modem”. So I tried using other XBee modules and reflashing the Arduino board but in the end I got to the conclusion that the XBee modules was causing the errors. Searching on the web I found not to much information that could really help me, the documentation on Digi’s website didn’t get me any further and on others sites they tell you to mess around with the COM-port settings and to check if it’s the correct COM-port, etc. But I noticed that sometimes after I reset the XBee module (unplug and plug the Vcc wire) I would have a small amount of time to enter some commands. Not enough for the X-CTU software to query the whole device but enough to enter 3 or 4 commands. So here is how I fixed it:
1) open X-CTU and use 9600 baud rate and other default communication parameters
2) open the terminal tab in X-CTU
3) reset XBee module (you can unplug and plug the power connections for example)
4) after XBee has been reset, try to enter AT command mode by pressing ‘+++’ (without enter!)
5) if XBee replies with ‘OK’ communication is working and your now in command mode. If it does not, try entering command mode again few seconds later by again pressing the same ‘+++’ command (without enter!). If it still doesn’t respond try resetting again and wait a little longer or a little less before you give send the command.
6) In command mode, give the ‘ATRE’ command which will erase the custom configuration and which will send you back to the default config. XBee will confirm with ‘OK’. Then send the ‘ATWR’ command which will save the current (default) configuration in the non volatile memory so that the next time you boot up you’re back at defaults. XBee will once again reply with ‘OK’.
The reason why the communication failed in the first place is not very clear to me. I found some info that explained that perhaps one of the XBee sleep mode configuration settings got wrongly set by X-CTU and that perhaps the module goes to sleep soon after it has booted. So that’s why you have to enter these commands after a reset. I don’t know if this is correct because there is a pin on XBee (pin 13) which tells you if the XBee is on or sleeping. If I use a LED to display the status of this pin it stays HIGH all the time indicating that the module is not sleeping. Anyway, if you run into the same problems as I did than this might be a fix, bon chance.