Raspberry Pi -> GPIO -> Breadboard -> XBee

XBee projects like the adapter, xBee tutorials, tweetawatt/wattcher, etc. from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
jasizzlestizzle
 
Posts: 2
Joined: Wed Jan 09, 2013 9:23 pm

Raspberry Pi -> GPIO -> Breadboard -> XBee

Post by jasizzlestizzle »

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

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!

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

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

Post by adafruit_support_bill »

Try crossing the signal lines Tx->DIN, Rx<-DOUT

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

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

Post by jasizzlestizzle »

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!

Locked
Please be positive and constructive with your questions and comments.

Return to “XBee products (discontinued)”