Step 5XBee Library Discussion
However, we don't need a SD card because we are going to stream that data to a computer. My weapon of choice for this task is the XBee. These are great modules that do a whole lot more than just send and receive blindly. You will need to configure two XBees in API mode. If you are unsure how to do this, please consult my instructable on API Mode for XBees. I used two Series 1 XBees because I have several lying around and I don't need to deal with coordinator/router/end device settings (too much thinking).
We use API mode to more easily ensure that each packet we send gets received. When in API mode the receiver will checksum the packet to make sure it's not corrupt and reply with a Delivery Status (ACK) packet so the sender knows it was sent successfully.You could write your own XBee library but I would recommend using the XBee-Java API written by Andrew Rapp.
There is a Python equivalent of this library, which I had intended to use but was unable to get working. The XBee-Python API depends on PySerial. Every time the XBee sends 0x13, PySerial encodes the byte as 0x7D 0x33. It turns out that there are 3 other problem bytes: 0x11, 0x91, and 0x93. Turns out that "Some modems with software flow control may intercept outgoing DC1 and DC3 ignoring the 8th (parity) bit. This data would be transmitted on the link as follows":
- 0x11 is encoded as 0x7d, 0x31. (XON)
- 0x13 is encoded as 0x7d, 0x33. (XOFF)
- 0x91 is encoded as 0x7d, 0xb1. (XON with parity set)
- 0x93 is encoded as 0x7d, 0xb3. (XOFF with parity set)
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|














































