# XBee Pro S3B with Raspberry Pi 2

**URL:** https://forums.digi.com/t/xbee-pro-s3b-with-raspberry-pi-2/16292
**Category:** Python
**Tags:** development, pro, 900hp, s3b, raspberry
**Created:** [February 19, 2016, 4:52pm UTC](https://forums.digi.com/t/xbee-pro-s3b-with-raspberry-pi-2/16292 "2016-02-19T16:52:25Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![SuperCad](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@SuperCad](https://forums.digi.com/u/SuperCad)
#### Post date: [February 19, 2016, 4:52pm UTC](https://forums.digi.com/t/xbee-pro-s3b-with-raspberry-pi-2/16292/1 "2016-02-19T16:52:25Z")

</div>

Hello,

We got one of your XBee-PRO® 900HP Development Kits and the XBees work great when connected to PCs and using XCTU. I then tried to connect them to a couple Raspberry Pis to see if I can connect with them.

The information I’m getting from the net is that You should be able to read and write to the serial and access them this way. I hooked the hardware up this way:

[https://sonyarouje.files.wordpress.com/2014/12/connection\_diagram\_bb.jpg](https://sonyarouje.files.wordpress.com/2014/12/connection_diagram_bb.jpg)

The Python code for the receiver is below:

#!/usr/bin/python

import serial

serialport = serial.Serial(“/dev/ttyAMA0”, 9600)  
while 1:  
x = serialport.readline()  
print “%s” % (x)

The Python code for the transmitter is below:

#!/usr/bin/python

import serial

serialport = serial.Serial(“/dev/ttyAMA0”, 9600)  
while 1:  
serialport.write(‘L’)

I’m new to Python, so I might have done something dumb here. If anybody has any suggestions on code or hardware I would appreciate it. A working example would be great too.

Thanks

---

<div class="post-metadata">

### Author: ![abhishekjp.ospl](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@abhishekjp.ospl](https://forums.digi.com/u/abhishekjp.ospl)
#### Post date: [February 22, 2016, 8:02am UTC](https://forums.digi.com/t/xbee-pro-s3b-with-raspberry-pi-2/16292/2 "2016-02-22T08:02:52Z")

</div>

Hello,

You have written x = serialport.readline(), which could receive the data until ’  
’ or EOL is received on the XBee receiver module.So from Transmitter side you must have provision for EOL(end of line) character. Or you could specify the length of string in the argument.

Try for x = serialport.read(size=1) in this case to receive character ‘L’ from the transmitter.

Thank you.

---

<div class="post-metadata">

### Author: ![SuperCad](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@SuperCad](https://forums.digi.com/u/SuperCad)
#### Post date: [February 22, 2016, 11:06am UTC](https://forums.digi.com/t/xbee-pro-s3b-with-raspberry-pi-2/16292/3 "2016-02-22T11:06:36Z")

</div>

Thanks for your response. I did try that after I posted the question, but I’m still not getting any communication.

Do you have any other suggestions?

---

<div class="post-metadata">

### Author: ![SuperCad](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@SuperCad](https://forums.digi.com/u/SuperCad)
#### Post date: [February 25, 2016, 10:03pm UTC](https://forums.digi.com/t/xbee-pro-s3b-with-raspberry-pi-2/16292/4 "2016-02-25T22:03:19Z")

</div>

I got it to work with the USB, but my boss wants me to use the GPIO to interface with the XBee, which is still giving the same result. Does anyone have any other suggestions?
