Loading...
Pages: [1]   Go Down
Author Topic: How to read Xbee S1 data on a serial monitor  (Read 279 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello guys, here's my setup:

I have two Arduinos, two Xbee Shields and two Xbee S1 radios (baud rate = 9600). One Arduino sends a byte of either "0" or "1" with a delay and the other Arduino receives such byte and lights up an LED when a "1" is received and shuts it off when "0" is received. Basically it's a wireless blinking LED project. Both Arduino's are independently powered through batteries and not connected to any computer.

Here's the question: I want read the received data from the receiving Arduino+Xbee through either a generic serial monitor, the Arduino IDE serial monitor or through X-CTU (it doesn't really matter which one). I tried to connect the receiving Arduino to my PC, but either the Arduino code stop working (I know because I installed a "debug" LED which lights up in the void setup and is always ON) or all serial monitor software including X-CTU and Arduino IDE give me an error stating it cannot open the COM port. (I selected the right port/baud rate and such...)

Any help would be much appreciated guys.
Logged

New Jersey
Offline Offline
Edison Member
*
Karma: 24
Posts: 2345
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The likely issue is that your xBee shield is using pins 0 and 1, so you can't use the serial connection to the PC at the same time.

For debugging purposes, you could detach the shield and wire it up manually using breakout wire and use softwareserial on another pair of pins to communicate with the shield. IIRC, all you need to connect is tx, rx, power and ground.
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 311
Posts: 35474
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
so you can't use the serial connection to the PC at the same time.
You can use the Serial Monitor to display the data send to the RX/TX pins, but you should not use the Send button to put data on the RX pin.

However, there are several XBee shields, so knowing which one OP is using is important. As is knowing which pins it is using. As is knowing what code is running on both Arduinos.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks a lot guys for your replies.

The shield I am using is the XBee Pro Shield from Libelium.com. Too bad I can't find any documentation for this shield, but Arduino.cc has a page describing a shield from Libelium which the page describes as a "deprecated product". http://arduino.cc/en/Main/ArduinoXbeeShield

Looking at the board's bottom traces though, I figured out it does use the 0 and 1 pins for serial communication. I would like to know, PaulS, how exactly can I display such data as you stated. I do not need to input anything so, the Send button is not a problem for me.

Cheers
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 311
Posts: 35474
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That page has a section on jumper settings. That should be a clue that you need to provide more information (if the rest of the text doesn't answer your questions).
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I did read the section on jumper settings. What I understood is if the jumpers where on XBee, then communication is established between the XBee, the Arduino and the PC. However, I do not receive any information to the PC. The XBee and the Arduino are communication well, but I can't view such data.

I did try however to switch the jumpers to the USB position, and I did receive the some of the data. I say "some" because I kind of receive a chunk of data, then it stops. I have to close and re-open the COM port (through X-CTU) to get the next chunk of data and so on. I think there is definitely something wrong but don't know where exactly.

Still open for ideas guys.

Logged

Pages: [1]   Go Up
Print
 
Jump to: