Saturday, February 16, 2013

The New XBee Chronicles: Setting Baud Rate

2/16 Chronicles: We spent the entire afternoon trying to set the parameters of our XBee modules.

Sources:
http://www.libelium.com/squidbee/index.php?title=How_to_set_XBee_parameters

- To send a command to the XBee: Serial.print(cmd), where cmd is a string
- A 2 second delay is required before the next command, perhaps more.

- To enter command mode: send "+++" until OK is returned.

Useful cmds (all prefixed with "AT" and suffixed by "\r" (a carriage return))
1. Check/set something (suffix with the setting)
a. BD - baud rate
b. - network id -Arduino website is down right now :(
c. CH - channel
d -
* whenever we set something, the command is sent twice...?

Configuration
SettingPINKYXWHITEX
ID33323332
CHCC
SH13A20013A20013A20013A20013A20013A200
SL40998CB340998CB340998D0040998D00
MY00
DH00
DL00
BD77


2. WR - write settings to memory so power off will not erase them

3. CN - exits command mode
- after each command you should receive an OK
* instead of OK, we get a random character after ATWR, and our script completely resets...

We managed the change the baud rate setting and save it using ATWR (even with the anomaly described above), but running our 5 sine wave signal generation code seems to break the setting. We thought this was why our other XBee was not receiving anything until we realized that they were on different network IDs...

_________________________________________________________________


2/23 Chronicles: After Anand found that XBees may have a bug that prevents them from transmitting at 115200 bits/s, we tried 57600 bits/s instead and it seems to be working well! We can graph data generated by our FiveSinLongGen script nicely in Python. However,  buffer overflow appears to be a potentially crippling issue, since our Python script is not processing data quickly enough as it is being sent through the air. See Python Adventures post for more information on our (possible brewing) solution!




No comments:

Post a Comment