1

I have an XBee that I want to use on a Raspberry Pi that I would like to use use to receive and transmit data through the Raspberry Pi's SPI port. I am using a shield (https://www.cooking-hacks.com/documentation/tutorials/raspberry-pi-to-arduino-shields-connection-bridge/) that connects both the serial and the SPI ports of the XBee to the Raspberry Pi.

The regular serial port (Tx and Rx pins) on the Raspberry Pi is already used for something else. I would like to avoid the use of the USB ports as these will need to be free and the whole solution should be fairly compact (only room for the shield) so no external USB hubs or whatever.

I've seem in the user manual that the XBee is usable in API mode through its SPI interface. So I've been looking everywhere for an API library that can send and receive frames in API mode through SPI to the XBee to avoid having to rewrite my own. However, I can only find implementations that communicate through Serial (UART). I have found the following 3 options:

All of their interfaces seem imcompatible with SPI as far as I can see. Is there a way I could use them without having to modify these libraries? Or perhaps, are there existing libraries or a method to do this that I am unaware of?

Thanks in advance!

user33355
  • 13
  • 3
  • Have you studied the kernel documentation on [SPI](http://lxr.free-electrons.com/source/Documentation/spi/)? You need a SPI *protocol* driver for the XBee module. If it's not a kernel driver, then you could use the generic userspace spidev driver. Unless you make the kernel SPI protocol driver (for XBee) emulate a serial port for a terminal (e.g. drivers/tty/serial/ifx6x60.c or max3100.c), you would have to modify one of those libraries to access SPI instead of a terminal. – sawdust May 10 '16 at 23:54
  • I wrote Digi's ANSI C driver, and wanted to include SPI support, but wasn't aware of any standard SPI interface for POSIX systems (like the Pi) and knew that each embedded platform would have its own interface for the SPI ports. You should be able to modify the serial layer of the driver (xbee_ser_X) to work over SPI instead of a standard UART. – tomlogic May 11 '16 at 17:07

0 Answers0