mPCIe-XBEE
The mPCIe XBEE RF card has an XBEE PRO compatible footprint providing access to any RF module with an XBEE compatible form-factor and pinout.
In addition to the mPCIe XBEE card you will need an aerial pigtail cable connected up the RF output connector(s). You can read about the capabilities of the Digi XBEE modules here :
The XBEE module is connected to the Raspberry Pi system via a FTDI USB UART device, in order to make the ttyUSBx serial port for the card constantly easy to identify we use a udev rule to help us, this is called 10-ftdi-usbserial.rules and is located /etc/udev/rules.d/
SUBSYSTEMS=="usb",ATTRS{busnum}=="1",ATTRS{product}=="FT230X Basic UART",ATTRS{idProduct}=="6015",ATTRS{manufacturer}=="FTDI",SYMLINK+="ttyS1"
This one line creates a symlink for the mpcie FTDI USB serial port called /dev/ttyS1
In addition to this the /dev/mpcie1-reset system shortcut (GPIO41) is connected to the module's /RESET line to allow a hard reset of the module if it becomes unresponsive.
Here are two methods of communicating with your XBEE and getting it into command mode
Minicom
This is slightly less awkward than with the LoRa module but still needs a few configuration changes before it will respond correctly
In this example we're using an XBEE PRO S1 module
Start minicom
# minicom -D /dev/ttyS1 -b9600
Then re-configure the serial port to have no hardware handshaking, enable local echo and linefeed (CTRL-a e CTRL-a a CTRL-a o)
When using minicom the initial +++ should not have a carriage return after it, just type these three plus signs leaving a 1 second gap before and after it without any keys pressed and wait for the OK response.
Note that the +++ cannot be entered using the numeric keypad
You can then type the AT commands and press enter each time, but be quick as the command mode will time out after a short period of inactivity
Python
Alternatively we can use a python terminal program like this one : https://github.com/sensestage/xbee-tools
Here do the below :
# apt-get install python-serial # mkdir xbeeterm # cd xbeeterm # wget https://raw.githubusercontent.com/sensestage/xbee-tools/master/python/xbee-serial-terminal.py # wget https://raw.githubusercontent.com/sensestage/xbee-tools/master/python/xbee.py # python xbee-serial-terminal.py
On the XBEE module we tested you needed to set the baud rate to 9600
In this case you need to press return after each command (including the +++ at the start)
baudrate 9600 serial /dev/ttyS1 +++ atvl
One of the neat features of DIGI XBee Modules is the ability to go into transparent serial mode, for information see here
Digi XBEE Transparent Serial Comms