xbee series 2, sparkfun shield and usb explorer - basics

I am currently able to get my xbees sending their full package in a format I can read without the use of arduinos, using Processing. I can get all the hex or dec equivilants, tease out the sensor data and so forth. But now I want to add some expanded capabilities to the xbees by joining the remote xbees with an arduino uno.

My hardware: Attached to computer: 1 Coordinator Xbee Series 2 9600 set to API Mode 1 usb xbee explorer (sparkfun)

Remote Sensor (no actual sensors yet): 1 Router Xbee series 2 9600 set to AT Mode 1 Xbee Arduino Shield (Sparkfun) 1 Arduino Uno

I am looking for the most simple of tutorials to get me started. All I want to see in the Arduino serial monitor is the full 21 part xbee output in hex or dec format. 0x7E, 0x0, 0x12...

Currently I see: ~¢@yçAû®~¢@yçAû¬~¢@yçAû~¢@yçAû®~¢@yçAû®~¢@yçAû¬~¢@yçAû

from a sketch like:

void setup() { Serial.begin(9600); }
void loop() { 
    Serial.write(Serial.read());
    delay(1000);
}

I haven't yet seen anything online that has 'clicked' in my brain. Any help would be appreciated. Thanks Mike

from a sketch like

Are you using Serial to talk to the XBee or to talk to the PC? Both is the wrong answer. So is yes.

Hi. My thinking, and its probably wrong, but loading the arduino UNO (with an xbee shield and router AT xbee attached) with a further simplified sketch that says serial.println("Test"); in stead of the serial.write line below, is essentially telling the UNO every second print to serial the letters T-e-s-t and the attached xbee shield in the UART position is diverting this output from the UNO's regular serial connecter / usb cable and in stead sending it through the TX pin which is then picked up by the attached router AT xbee. That xbee then broadcasts it to the coordinator API xbee which is attached to the xbee usb explorer which acts as a gateway to the computer's serial. Then on the serial monitor I see " ~¢@yçAû®Test ".

Because " ~ " is equivalent to 0x7E and 126 I am fairly certain this is telling me its the start byte of the packet. So my hope is that I can get it and its following characters into a format that spells out the whole packet, address and all.

During this time only the coordinator is physically attached to the computer. The router is on a power jack.

Did I just confuse things further or did that make any sense at all?

Hi mcemond,

All I want to see in the Arduino serial monitor is the full 21 part xbee output in

I too have similar problem until I understand you use X-Ctu to see the Hex value and message ( in your case it is TEST). In the same time, not sure it is 21 part X-bee out. In the X-CTU (Windows only -provided by Digi) there is option "Show HEX ".
Hope you refer that.

In my case, I have similar setup like yours… Seeing some character like as seen the attached X-CTU screen shot.
Hope this helps. Any thoughts

-Chandra

If you want two XBees to talk to each other, it's simpler if both use API mode or both use AT mode. Why are you mixing them?

Why mix API and AT?

My setup: 2 AT End Device XBee + Arduino UNO (Temp sensor, Motion Sensor) 1 API Coordinator XBee -directly connected via USB explorer board ( Collect the data from AT device/ and store in a Text file..just a like Log for particular time interval )

To collect data and store, I wish to use Python library like Pyserial or Xbee Arduino(in case Coordinator had XBee +Arduino) library. Right ? 1 )Am I missing something... Please enlighten me 2) As of now, I have a problem can not solve for last 3 days :( . The Co-ordinator Xbee directly connected to PC - receive either one Sensor data on X-CTU at time. Earlier, very first time, I saw 2 sensor data on X-CTU terminal. After that, i can not see it again. I changed, XBee, Xbee shield..even Arduino. Can not understand issue.. particularly why the Associative LED is not blinking on Arduino Xbee shield. If just interchange the Xbee, the other device which NOT sending data..simply works. (the other device..of course stop working).

I can not understand...why this happening. PLEASE any thoughts /suggestion welcome. :)

My setup: 2 AT End Device XBee + Arduino UNO (Temp sensor, Motion Sensor) 1 API Coordinator XBee -directly connected via USB explorer board ( Collect the data from AT device/ and store in a Text file..just a like Log for particular time interval )

API mode is needed if you want to connect sensors directly to the XBee and have it send packets when the sensor changes state.

I can see no good reason to be using API mode on one XBee and AT mode on the other.

To collect data and store, I wish to use Python library like Pyserial or Xbee Arduino(in case Coordinator had XBee +Arduino) library. Right ?

PySerial is just a way of connecting Python to the serial port. It contains nothing that I'm aware of that knows anything about XBee API packets.

The Arduino XBee library does, but, so what? The sender is not sending API packets.

1 )Am I missing something... Please enlighten me

The way I see it, you are missing a good reason for using API mode on one device and AT mode on the other. Do you often write to friends in Greek, and tell them to respond only in Russian? Or do you expect to send and receive using the same language?

Dear Paul,

Delight to see your reply. Before that let me add some more details. (may helpful for fellow readers). 1.The AT Xbee end device - just send data only -One way communication to Co-ordinator (attached PC). 2. Their destination address 0. So, they will talk to Co-ordinator by default.

Yes..you answer makes sense and logical. :) . So, at one point i just changed the firmware Co-ordinator API to Co-ordinator AT but can not see any data. later change back to API. Yes, I will change to AT Co-ordinator.

So, appreciate 1. Any link /document which explains AT communication between small Xbee based sensor network.Highly welcome :D 2. As, said earlier, 2 AT End devices - 1 API Co -ordinator was working...... After while,, Only 1 device...It is still mystery or I am making some Stupid mistake (s). :(

Many thanks.

Cheers! Chandra P.S - This is university research project. I am working under Prof.

If you don’t have Rob Faludi’s book, Wireless Sensor Networks, I strongly encourage you to get it. All things XBee are explained.

Dear Paul,

Thank for your quick reply. Yes,I have that useful and reading it too. Meanwhile, I found that if co-coordinator API mode, it can not talk to more than one End device( AT) device. Later, I add 2 more device Router AT, it works well. So, set up 1 End device(AT) / 2 Router (AT) --> 1 Coordinator (API mode). So, building on Robert Faludi's book wireless sensor network book -page 27 - mentioned that *a network can be consist of one coordinator and multiple end device. *

I am not sure how to interpret this for network with AT and API mode devices. :open_mouth:

Any thoughts welcome.

Cheers! Chandra

I have solved the API coordinator / Multiple AT End device problem. The End device configured to Sleep. So, they go to sleep after while.. Set the sleep mode =0 ( SM =0) at Enddevice.(AT mode). They can talk to API Coordinator.

Hope this helpful someone. Thanks again for all replies. :)

Cheers! Chandra