Router getting XBee parent/coordinator serial

Hello!

I'd like to ask help coding an arduino to retrieve a coordinator serial (sh + sl)

this is what I have so far:

cpu + unchipped arduino(xbee set to "coordinator at", jumpers in usb position) <---> remote arduino(xbee set to "router at", jumpers in xbee position);

What is happening here is that the remote arduino is sending strings which I can read in cpu.

I'd like to know if there is a code to run in the remote arduino which allows it to read the coordinator's sh/sl...

And..

If I attach this remote arduino in a notebook, and try to read in arduino's serial monitor, the incoming data, how should I set the xbee shield's jumpers? I undestand that when jumpers are in Xbee position, the router xbee is sending/directing data to stream, and not pointing it to serial communication. Otherwise, if I set the jumpers to usb position, arduino itself stops talking to xbee =/

Any directions would change the world!
:wink:

Regards,
Btp~

If you only have 2 xbees, and one is attached to the Arduino, don't you know which one that is?

The xbee attached to the Arduino does respond to AT commands, regradless of where they come from. The Xbee can't tell the difference between a request from the X-CTU program via a USB Explorer, a chipless Arduino board, or a chipped Arduino. It simply replies to the AT command.

So, you can, from the chipped Arduino issue an AT command, and the xbee will respond. Issue the correct AT command, and the info you want will be sent back.

The xbee chip piggybacks on the TX/RX ports of the Ardiuno. When the xbee receives data, it puts it on the Arduino's RX pin. When the Arduino wants to send data, it puts it on the TX pin. The xbee sees and broadcasts the data.

It does not remove the data. So when the chipped Arduino is attached to a PC, and the jumpers are in the xbee position, all the data that the xbee receives appears to the PC just like data received from the Arduino.

The reason that there are jumpers at all is because programming the Arduino with the xbee in place causes interference. Once the Arduino is programmed, the jumpers go in the xbee position, so that the xbee can ALSO see what is on the TX pin and can ALSO put data on the RX pin.

Any directions would change the world!

Well it would if it was towards or away from the sun ;D

Mowcius

Thanks for answering.

I know which one is indeed, but I was interested in retriving the parent serial number thinking on a network mesh where devices must know where they are.

Now I'm looking for how to send modem commands via arduino. I'm a begginner, and I could only find advanced forums talking about it. The first thing I ve thought was coding arduino to send the "+++" and the "ATSL" command.

It didnt work. Plus, I dont know when the xbee attached on a chipped arduino would receive itself the "+++" string and respond with its serial and when it pass the string away so the other XBee would respond.

I havent make a Serial.read() here thinking any response could be caught on the X-CTU Terminal window.

void setup(){
   Serail.begin(19200);
}

void loop(){
   Serial.print("+++");
   delay(2000);
   Serial.println("ATSL");  //here, I think println already puts a carriage return, no?
   //delay(2000);   //here, I dont know if this is the way to proceed to finally see a the serial I'm trying to retrieve.
   //Serial.print(Serial.read());
}

Thanks for helping
Btp~

I'm still not sure I understand the problem. The arduino has a xbee attached. It can be programmed to KNOW which xbee it is carrying.

For mesh situations, where any xbee can send and everyone else listens, the thing to do is have the sender prefix the message with the sender ID. Then, each receiver knows who sent the message.

hmm, sorry for the explanation.

well, I have a computer, which is a fixed node.
This computer is connected to an unchipped arduino, and a xbee-shield carring a modem set to coordinator at.

Now, a remote node.
A chipped arduino attached to a xbee-shield where the modem is set to router at.

This is a very basic scenario. But I needed the router/end device to recognize which parent it is connecting to. That's all.

So, in a practical situation, whenever a device approaches a coordinator, it will know which coordinator is that. This is a first problem: retrieve the coordinator id/serial...

Do you have the series 1 xbees, or the series 2 xbees?

Series 2.

I made it work last night. But I had to send an ID from cpu "manually".
I have set a program to write a number "ID" in serial, which coordinator broadcasts to router. The arduino/router receives this ID and returns a confirmation string to coordinator.

I'd like to know if XBee themselves could make this kind of verification based on the XBee library, where I could see examples talking about it, but couldnt make it work here. Also, I was told to change my modems configuration to API mode, but I think I cant do that using an unchipped arduino. I'm waiting for my usb explorer to arrive.

Hey

I have some problems with XBee and arduino...
I'm hijacking your thread as I have a similar setup.

I'm using series 2 PRO modules, one connected to arduino with a shield in RouterAT mode and the other to my computer with an XBee - USB Board in CoordinatorAT mode.

I have no problems sending serial data from arduino to my computer using this guide.

Though I can't send data from my computer to the arduino, the Tx led on the usb board flashes when I try to send from X-CTU terminal but no response on the arduino end. When I send data from arduino to my computer the leds on both arduino and usb board flashes.

So as you said you successfully sent data back and forth to arduino, could you plz tell me how you did it and what settings you have on your modems and maybe some sample arduino code :slight_smile:

Thx!

**
URL's will come in next post if necessary, couldn't post links in my first post. dooh!
**

I dont know if you re using flash. I made it work by using an usb explorer (or unchipped arduino) attached on the computer where flash is running.
Flash sends an string to serial via serProxy. This goes trough xbee, so the device receives it, reads, and give back an response which is received by flash.

Flash sends data ---> serial proxy ---> arduino + xbee (coord at) --->>> xbee(router at *) + arduino. Arduino receives and responses...

...(from arduino) --->>> to Flash.

This device is not attached to a computer, but if I needed it, I would try the same aproach I did, using an unchipped arduino an treating the response direcly on actionScript.

*router at could be device at. But I ve read about the sleeping mode and I thought it would be more issues to solve. I set as a router instead, works the same for what I need.

let me know if you got it working :wink:

Btp~