Search code examples
raspberry-pixbeezigbee

Using xbee ansic library for usb interface


I have a raspberry pi board conencted to xbee device via usb adapter. ie: To access my xbee, it will be /dev/ttyUSB. I want to use xbee ansic library api's to send and receive commands from/to my xbee device. Have downloaded xbee ansic library code from https://github.com/digidotcom/xbee_ansic_library.git

  1. How to build xbee ansic library and build some .so (Makefiles are only for generating sample files executables)
  2. Can I use it for usb interface (all examples are for serial interface)
  3. How can I query temperature from xbee device

Solution

    1. It was designed for building complete, stand-alone programs. It targets embedded systems without an OS, where you compile a single program to run on the processor. I guess it's possible to modify it to build a library, but in many instances you have compile-time configuration going on.

    2. Your USB interface is essentially serial once it gets to the XBee module. Just specify the correct /dev/tty device.

    3. You'll have to look up the documentation of the device. Some modules report on their internal temperature (which is likely higher than ambient) using remote AT commands.