XBee to XBee wireless communication

Hallo!

I've gandered through page upon page of threads related to XBee modules but can't seem to find the information i'm looking for.

I recently purchased 2x Seeeduino, 2x XBee shields and 2x XBee 2.5 modules as part of a project to get to grips with wirelessly sending data from one module back to my laptop.

I've got both Seeeduinos and XBee's setup with reference from the Arduino XBee Shield guide: http://arduino.cc/en/Guide/ArduinoXbeeShield and have uploaded the Physical Pixel sketch to one and the example sketch to the other however, nothing is happening when the two try to communicate.

This leads me to think that the XBee modules aren't setup to talk to each other but from all the reference i've seen, this can only be achieved using a windows machine?

I'm using a macbook pro so I can't download the software i've seen to configure the modules. From other threads it seems that it's not possible to configure them using Mac OS X. Is this true?

If it is not the case that the modules need to be configured, what else am I missing out on?

I'm pretty new to the whole ardunio field so i'm feeling a little out of my depth here. Any help you can suggest to get the two modules to communicate would be greatly appreciated :slight_smile:

Thanks for reading!

Just another quick question:

Is it possible to configure the XBee modules from the Seeeduino itself or do I need to purchase a separate item such as: http://www.coolcomponents.co.uk/catalog/product_info.php?products_id=243&osCsid=j90j5kqfegquksdbumahtmuqg5

I've already read that it may be possible to configure the XBee via the Arduino/Seeeduino but each thread/page i've read mentions removing the microprocessor from the board. I'm not sure i'm comfortable with this being such a n00b and all :confused:

I'm still looking for information how to configure the XBee using Mac OS X but at least if I can verify that I have the right equipment for the job i'll know if i'm heading in the right direction.

Thanks for reading!

i got 2 Xbee pro and they are both working together no setup required

you don't need to take the atm micro controler out if you got a xbee shield on it there are jumpers that allow the xbe to talk to the computer not taking in account the arduino at all

Thanks for your reply :slight_smile:

I had to remove the jumpers to be able to upload my sketches to the seeeduino so I think I'm confident enough to do that but will it also allow me to configure the XBee's themselves?

I'm trying to determine if I even need to configure them at all. All of the sketches i've tried don't seem to be doing anything at all.

I've included the code for both below, just in case i'm making any n00b mistakes :wink:

//client
//setup
void setup()
{
  //init serial communication
  Serial.begin(9600);
}

//main
void loop()
{
  //send H
  Serial.print('H');
  
  //delay
  delay(1000);
  
  //send L
  Serial.print('L');
  
  //delay
  delay(1000);
}
//server

//led pin
const int led_pin = 13;

//incoming data stream
int stream;

//setup
void setup()
{
  //init serial communication
  Serial.begin(9600);
  
  //init led pin as output
  pinMode(led_pin, OUTPUT);
}

//main
void loop()
{
  //check incoming data
  if(Serial.available() > 0)
  {
    //read data
    stream = Serial.read();
    
    //check data
    boolean value = (stream == 'H' ? HIGH : LOW);
    
    //set led pin value
    digitalWrite(led_pin, value);  
  }
}

If I use the serial monitor when connected to the 'server' via USB, I can send "H" and "L" characters to turn on the LED and when connected to the 'client' via USB I can see it sending "H" and "L" also so I know the sketches are working, the data just seems to be getting lost somewhere as the two XBee's don't seem to be connecting.

Any help would be greatly appreciated! :slight_smile:

Thanks for reading!

this explain the jumper mode

also note that if you wan the data to come back to the computer throought the XBee well there is no reliable way of doing it without taking the arduino out

you can how ever send datas

te other possibilitie is that your Xbee are on diferent channel wih is wierd mine came on the default and i changed them to as custom in case i encounter an other Xbee user

(is you wanna try to run the sof you could try DarWine (Wine for mac os) i never tyed it can,t say if it works well or not)

X-ctu exist for linux to if i'm right

the last option is to write a code for arduino that have for only goal to change the setting of the Xbee

Ok, i've been trying all day and i've had no luck whatsoever in getting to the XBees to communicate with each other.

I've uploaded the sketches to two separate Seeeduinos with XBee shields and XBee Pro Series 2 modules attached and the sketches work fine. I can see the output in the Serial Monitor when the jumpers are in USB setting. In XBee setting, serial output displays a load of random characters instead. I'm not sure if this is normal.

I've followed the steps on the XBee Shield guide http://arduino.cc/en/Guide/ArduinoXbeeShield but still can't seem to get the two to talk.

I read somewhere that Series 2 modules are slightly harder to setup, is this correct?

I'm using a Mac so I can't download the X-CTU application i've seen plastered in every thread. Also, I only have 2 seeeduino boards, not the fancy little explorer things everyone seems to be using. Do I need to purchase one of those to configure the modules or is it possible through the Seeeduino itself?

My current configuration is:
http://www.coolcomponents.co.uk/catalog/product_info.php?products_id=510

http://www.coolcomponents.co.uk/catalog/product_info.php?products_id=116

http://www.coolcomponents.co.uk/catalog/product_info.php?products_id=298

Two of each of the above trying to talk to each other via the sketches in my previous post. If anyone can shed some light on where I may be going wrong, i'd be most grateful.

Thanks for reading!

The series 2/2.5 xbees are a little more difficult to set up than the series 1. You need to set one of them as the "Coordinator". I have only done it using x-ctu. There might be a way to do it without but I don't know for sure. I would find a windows pc and download x-ctu.

Once you get them set up you should be good on your mac.

I don't know a lot about macs, but you should be able to use a terminal program and you can enter commands and configure the XBee's. On a PC I use hyperterm.

If you're really stuck I could try using my wife's mac and see what I can do.

I run a mac and have been able to easily configure my xbees - but I do this from the Arduinos in the setup function - I send the XBee +++ ; AT commands etc at startup time. I can't speak with experience about the 2.5 series but Series 1 are a breeze to set up and get going.

Thank you all for your replies.

I've managed to find a Mac OS X equivalent for configuring the XBee modules. I downloaded an application call CoolTerm which seems to let me get into the command interface and configure the modules.

I've read that I need to set one module as the coordinator but can't seem to find this command from the XBee user manual. Does anyone know the command for this?

It seems the XBee 1 modules allow you to set the address and destination of each module to point to each other but this isn't possible through the fireware currently running on my XBee Pro 2 modules. I don't know how to update the firmware without X-CTU, perhaps I don't need to if it's possible to configure the modules to be a coordinator etc.

Currently, i've got each XBee module setup on the same PAN ID but they still don't seem to be connecting to each other.

Am I correct in thinking that simply turning on each Seeeduino with a XBee attached they should connect to each other without any code running? Currently, I have a blank sketch on each module but the Associate LED just stays lit constantly. As a bare minimum, do I need to create/begin the serial connection for each module to connect?

I'm still pretty much running the same sketches I posted previously but still having no luck. I'm assuming that they look fine or enough to communicate between the two?

Thank you all for your replies, I'm feeling a little out of my league at the moment but hopefully now i've managed to at least attempt to configure the two modules i'm on the right track, i hope!

You need to have one of the xbee's firmware set to "Coordinator," and the other one set to a "Router/End Device." This is completely different than Series 1 xbees. Because this is a Firmware issue, I don't think you will be able to change it without using X-Ctu.

Am I correct in thinking that simply turning on each Seeeduino with a XBee attached they should connect to each other without any code running? Currently, I have a blank sketch on each module but the Associate LED just stays lit constantly. As a bare minimum, do I need to create/begin the serial connection for each module to connect?

Yes, once they are setup correctly, and as long as the xbees have power, they will automatically create and join the mesh network. No code is required to start them. The associate LED will start blinking at a different rate when they are connected. I think it goes from 1/sec to 2/sec. I did a little googling this morning about setting them up on a mac, all i could find was people running windows and x-ctu using a virtual machine on their macs. Im not a mac person so I can't help you with that.

Side note: If you are only planning on using the xbees as point to point, ie just sending a message from 1 xbee to 1 other xbee, you might want to purchase Series 1 xbees. Series 2 are optimized for "mesh" networking. That adds a layer of complexity to everything.

Thanks to everyone for the replies.

I'm going to have a bash tonight at setting up the XBee's again to see if I can make any progress.

I've managed to set some options via CoolTerm for Mac OS X which allows me to configure the modules so all seems well for the time being.

One thing i'm struggling to find at the moment is how to enable Coordinator mode for one of the XBees. I've seen mention of the command "CE" or "ATCE" rather but can't seem to see this is the XBee manual.

Do I have to update the firmware to set up an XBee as a coordinator, or is it simply a case of setting the right flags when in command mode?

Updating the firmware could be a pain in the ass seeing i'm running Mac OS X. I don't think CoolTerm will allow me to do this as X-CTU does. I don't suppose there are any alternatives if this is indeed the case?

Many thanks for reading!