XBee Interfacing With Raspberry Pi Model 2

Arnav Bansal. He is pursuing B.E. in electronics and communication from UIET PUSSGRC, Hoshiarpur


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

fig 11Fig. 11: Prototype of data sending unit
Fig. 11: Prototype of data sending unit

[stextbox id=”grey”]

[email protected] ~ $ cd /XBeeTest[/stextbox]

// Change Directory to XBeeTest

 [stextbox id=”grey”]

[email protected] /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.


  1. I followed the exact steps you’ve mentioned. But I didn’t get the result. I’m not able to see anything in XCTU software.

  2. Hi,
    Thanks for sharing your knowledge. While I update the radio module firmware, I only have “ZIGBEE TH Reg”, “805.15.4 TH” and “DIGIMESH 2.4 TH” function set. Is it compulsory to have “XBEE COORDINATOR AT”. Could you please tell me how can I go forward with the available function sets.


Please enter your comment!
Please enter your name here