xbee to arduino to computer and back:  data flow

Hi,

I am confused about the communication possibiities between xbee/arduino/computer.

From the xbee/arduino page it seems that when you have the shield jumpers in xbee position then
the xbees can talk to one another
the arduinos can talk to thecomputer
BUT the computer can’t talk to the arduino…!

Does this mean that there is no way to send data from the computer to the arduino when the xbee shield is attached and operating? So if i want to use internet data to trigger a wireless event from one xbee to another I am not able to do this?

Apologies if this is an unbelievably stupid question!
Thanks
jgrassi

Xbees read and send serial commands so if they are all set up to the same baud and wireless then they will receive anything sent on the same channel.

Mowcius

The thing is on this page: http://www.arduino.cc/en/Main/ArduinoXbeeShield it says this: With the jumpers in the Xbee position (i.e. on the two pins towards the interior of the board), the DOUT pin of the Xbee module is connected to the RX pin of the microcontroller; and DIN is connected to TX. Note that the RX and TX pins of the microcontroller are still connected to the TX and RX pins (respectively) of the FTDI chip - data sent from the microcontroller will be transmitted to the computer via USB as well as being sent wirelessly by the Xbee module. The microcontroller, however, will only be able to receive data from the Xbee module, not over USB from the computer.

So as far as I can see when I am using the Xbees attached to the computer I can't send data via usb from the computer?

Have I missed something? Thx.

Basically becuase the xbee shield uses the main RX and TX pins of the arduino, they are the same pins that the arduino uses to communicate with the computer. Therefore you cannot use them both at the same time.

If you have not got an xbee shield yet then I would recommend that you get the regulated breakout board for xbee from sparkfun that turns gives you the xbee pins as 5v, Gnd, TX and RX (Din, Dout). then you can use the newsoftserial library to make any other pins on the arduino virtual serial ports to connect the xbee into. Then you can use both the pc(USB) to arduino serial and the xbee serial.

I hope that makes some sense :D

Mowcius

Well, I've had my Arduino with Xbee attached to the computer, and I get data from the Arduino while the Xbee is communicating with another Xbee.

With the jumpers in the Xbee position, you can not upload sketches to the Arduino. With them in the USB position, you can. But, then, the Xbee is physically isolated from the tx/rx pins.

With the jumper in the Xbee position, anything that the Arduino sends to the serial port/tx pin gets broadcast by the Xbee. Everything that the Xbee receives goes to the Arduino rx pin, so that the Arduino receives it, just like the data appeared on the serial port/rx pin.

If you want to be able to communicate with the Arduino [u]without[/u] the Xbee being aware of the communication, you need to use the NewSoftSerial library.

Thanks for all the answers - I think mowcius' solution is the one I am looking for - as the problem is the sending of data from the computer to the arduino so that the xbee can send it on wirelessly. (I don't have a problem sending data between the xbees or back to the computer)

Unfortunately I do already have the shields - so I will have to by separate xbees to do this.

Can anyone point me in the directions of anyone using xbee to get data from the computer and use it to send out wirelessly to an arduino/xbee - and then vice versa to send data back from the arduino/xbee to the computer - in a feedback type scenario.?

Thanks for all the help J.

One of these will let your computer talk directly with the Xbee.

The Arduino with Xbee shield can also talk to the computer. Using the built-in serial port acts like a party line. The Arduino and Xbee both receive data sent to the port, and both send data to the port. The Xbee also broadcasts everything it receives from the serial port, and sends to the serial port everything it receives over-the-air.

http://www.sparkfun.com/commerce/product_info.php?products_id=8687

One of these will let your computer talk directly with the Xbee.

Yep, it is also good to have a one of those USB regulated boards for programming the xbees...

Mowcius

Yeah the way I have mine set up is to use the usb explorer attached to the computer on one end, and the xbee shield attached to the arduinos on the other.

On a side note, why don't they include the momentary switch on the explorer board that is needed when programming?

On a side note, why don't they include the momentary switch on the explorer board that is needed when programming?

Does it need one? I presume you mean the USB regulated board. I program mine fine without it. I am using version 1 xbees with chip antennas...

Mowcius

Yep the USB regulated explorer. With the series 2 xbees when updating the firmware, it always asks to be reset, so you have to bring the RST pin low. It would also be nice if it had an associate LED on it so you can tell when it has joined a network.