Construction and testing
Now it is time to test our project. After saving the code and connecting coordinator mode XBee module to your Raspberry Pi, boot the Raspberry Pi and from the terminal write the following commands to execute your program. The destination folder is XBeeTest and file name is serial_XBee.py
pi@raspberrrypi ~ $ cd /XBeeTest[/stextbox]
// Change Directory to XBeeTest
$ sudo python serial_XBee.py
// Run serial_XBee.py Program
This program should send character ‘A,’ pause for a second and then send character ‘B.’ Note that, as soon as you power up both the XBee modules, ASSI (Association Indication) LED should light up. In this case, it is a yellow LED as seen in the prototype (Fig. 11).
Now to confirm reception of data, hook up your end device XBee module to your computer, open the console mode in XCTU, start serial communication with XBee module. You should get the output on your screen as shown in Fig. 10.
Download source code
This article was originally published on September 19, 2016 and has been recently updated.
Feel interested? Check out other raspberry pi projects.