Raspberry Pi -> GPIO -> Breadboard -> XBee
Moderators: adafruit_support_bill, adafruit

Raspberry Pi -> GPIO -> Breadboard -> XBee

by jasizzlestizzle on Sat Feb 09, 2013 11:38 pm

I am trying to get my Pi to read from an XBee mounted to the breadboard.

Here's what I know:
1) The XBee is receiving data. When I hook the XBee up to a USB Explorer and plug it into my Windows computer, fire up X-CTU, and view the 'Terminal' tab, it is receiving data every second. The data is garbled, but I don't even care at this point, it's getting some data and it's viewable in X-CTU.
2) The Pi is connected to a breadboard. I have "jumpered" the TXD and RXD pins together. I have started minicom using 'minicom -b 9600 -o -D /dev/ttyAMA0' and the program echos back the keys I hit. This makes me think that the GPIO ribbon cable, the serial port configuration, etc., are correct. There is no garbage displayed by minicom, just perfect replication of what I type.

So at this point, both the XBee and the serial port of the Pi seem to be working.

How I'm setup:
1) DIN (pin 3) on the XBee is hooked up to the RXD on the GPIO cable
2) DOUT (pin 2) on the XBee is hooked up to the TXD on the GPIO cable
3) I have 3.3v power running to pin 1 on the XBee, and Ground to pin 10 on the XBee.
4) I have 3 LEDs attached to Pin 13, Pin 15, and Pin 6 of the XBee. Pin 6 (RSSI) is lit steady. Pin 15 is always blinking (because this is a coordinator Series 2 radio). Pin 13 is on steady indicating the radio is awake and has power.

What I'm having a problem with:
1) When running 'minicom -b 9600 -o D /dev/ttyAMA0' I would expect something, anything, to display in the application. It does not.
2) When I created a Python application (I don't know Python very well at all) as listed below, it displays '0', indicating there is no serialDataAvail-able.

Code: Select all | TOGGLE FULL SIZE
import wiringpi
import time
serial = wiringpi.serialOpen('/dev/ttyAMA0',9600)
while(True):
   count = wiringpi.serialDataAvail(serial)
   print count
   time.sleep(1)


Please help me understand why I'm not seeing any data output from my XBee!

Thanks!
jasizzlestizzle
 
Posts: 2
Joined: Wed Jan 09, 2013 9:23 pm

Re: Raspberry Pi -> GPIO -> Breadboard -> XBee

by adafruit_support_bill on Sun Feb 10, 2013 8:10 am

Try crossing the signal lines Tx->DIN, Rx<-DOUT
User avatar
adafruit_support_bill
 
Posts: 31059
Joined: Sat Feb 07, 2009 10:11 am

Re: Raspberry Pi -> GPIO -> Breadboard -> XBee

by jasizzlestizzle on Sun Feb 10, 2013 5:04 pm

Thank you, Adafruit!

I think the lesson learned here is that the labeling on the XBee shield is meant to be from the perspective of the XBee itself, not something hooked up to the XBee. In other words, "Data Out" in terms of the XBee is data the XBee is going to send out on that pin. "Data In" in terms of the XBee is data the XBee is going to read in on that pin.

Thanks again!
jasizzlestizzle
 
Posts: 2
Joined: Wed Jan 09, 2013 9:23 pm