It seems xBee AT mode is for point-to-point communications only. For
many-to-many communication, we need to use API mode and the xbee-
arduino module (http://code.google.com/p/xbee-arduino/). So, I tried
to flash my modules with the XB24-ZB API firmware set.
To save you potential frustration, I'm posting my adventure with the
two end-point modules.
To summarise: when things go wrong and you're not sure of your
module's settings, you need to repeat all permutations up to six times
before you give up on them. You might not be able to keep track of the
permutations in your head, given the repetition count. I succeeded
once I started writing everything down.
On with the log:
I started with my XB24-ZB running firmware 2821 (AT mode end-point).
In X-CTU, Test/Query worked with API mode disabled, 38,400 baud, and
hardware flow control.
I upgraded the firmware as follows:
* Switch to Modem Configuration
* Select ZIGBEE END DEVICE API (2921)
* Click Show Defaults
* Check Always Write Firmware
* Click Write.
I saw "Getting modem type", then "Unable to communicate with modem",
so I tried Write again.
It wrote the firmware, then broke while setting AT parameters due to
"Failed to enter command mode". That made sense: X-CTU is still in AT
mode, and the module is now in API mode. Oops. Switching back to API
mode, however, didn't seem to help.
The default is BD=3 (9600 baud), and I last spoke to the device with
BD=5 (38400 mode), so I tried:
* 38400/hardware/API mode/ATAP=2: communication "OK", modem type="Name
unknown (49249672482098212)", modem firmware version=""
* 9600/hardware/API mode/ATAP=2: same
* 9600/hardware/API mode/ATAP=1: WOOHOO! modem type="XB24-B", modem
firmware version="2921"
We can speak, so:
* Back to Modem Configuration
* Click Read (worked first try, but took >4 attempts below)
* Set ID - PAN ID=2323
* Set BD=5
* Set AP=2
* Set NI=NODE2
* Uncheck Always Write Firmware
* Click Write
* Watch "Reading AT commands" appear at bottom
* Wait
The response was, seven times:
Getting modem type…OK
Programming modem…Lost communication with modem
Write parameters…Failed"
Luckily, it worked on the eighth try of the Write button.
For my second module, which I misconfigured without keeping track of
how:
* 38400/hardware/API mode/ATAP=2: communication "OK", modem type="Name
unknown (49249672482098212)", modem firmware version=""
* 9600/hardware/API mode/ATAP=2: same
* 9600/hardware/API mode/ATAP=1: same :(
* 38400/hardware/API mode/ATAP=1: same
* 38400/hardware/AT mode: WOOHOO! modem type="XB24-B", modem firmware
version="2821"
Finishing this off was easy, but took >4 attempts on PC setting test/
query and Modem Configuration reads and writes:
* Switch to Modem Configuration
* Select ZIGBEE END DEVICE API (2921)
* Click Show Defaults
* Check Always Write Firmware
* Click Write.
* Watch the same AT parameter failure
* Switch to PC Settings
* Set 9600/hardware/API mode/ATAP=1 (no checksums)
* Click Test/Query and cheer
* Switch to Modem Configuration
* Back to Modem Configuration
* Click Read (took five tries to work)
* Set ID - PAN ID=2323
* Set BD=5
* Set AP=2
* Set NI=NODE2
* Uncheck Always Write Firmware
* Click Write
* On first four attempts: See "Lost communication with modem"
* On attempt #5: "Unable to program module. Incompatible function set
for selected module."
* On attempt #6: watch it re-flash the firmware (!), then succeed in
writing the AT parameters (!!)
* Switch to PC Settings
* Set ATAP=2
* Click Test/Query until you get a sensible result (took six tries)
* Switch to Modem Configuration
* Click Read
* Double-check the results
In theory, I now have three compatible xBee modules in API mode
(ATAP=2) at 38400 baud on PAN 2323. Now I can start on the fun stuff:
Arduino code.
Yours,
Garth.