Best practices for talking to XBee with Ruby, Node.js or Python?

I’m building a basic sensor system (remote thermometer sending data periodically) based upon Rob Faludi’s Wireless Sensor Networks book. However I prefer to use a Raspberry Pi with XBee as the base station vs. XBee/Arduino/computer.

So I would like to use a high level language to read the incoming stream of data. Prefer Ruby, Node.js, Python, in that order.

I’ve researched this quite a bit and it seems like one has to really be expert at talking to a serial port, and parsing bits out of the frames, in order to do this. Is that the case? (That could take longer than designing and assembling the hardware!) I’m willing to learn that but it surprised me that there are no high level constructs for doing this. Can anyone point me to some examples?

Thanks!

There are a lot of open source projects out there for working with XBees. At some point, you’ll probably need to gain some expertise in parsing bits out of frames, but the following projects should get you started a lot faster:

[ul]
[li] https://github.com/motomike/ruby-xbee[/li][li] https://github.com/mozz100/node-xbee[/li][li] https://pypi.python.org/pypi/XBee[/li][/ul]

1 Like

Thanks! I just found a couple of those a couple of hours ago. Also found this: https://github.com/voodootikigod/node-serialport which allows using Node.js (JavaScript).

Hi, I will present my tesis with one network Xbee s2c, node.js and app movil. Thanks for you information