Have some questions about Xbee communication

Ive decided to make a robot for my thesis and i want to use xbee for rf communication. But there are some points i couldn't figured out.

I want to use two of Arduinos. One for mobile control and the other one for the controlling robot functions. But the things are:

  • Which communication type should i use when setting up xbees via x-ctu? I mean are there any master/slave topography? Can i use xbees as transreceiver or does the communication types limits that functions?

  • What type of things i can send with Xbees. For instance: can i send simply W,A,S,D or numbers like 1,2,3 via serial connection for commanding robot?

-If i had two of UNOs or Duemilanoves and if want to use sending commands with hyperterminal, im going to have to remove xbee shield because they are using the same pins. Can i change default serial pins for USB communication of boards with computer?

or

-Instead of two UNOs if i would use Arduino MEGA i know i can use 6 of serial ports. But still the board would be communicate with computer via same pins with xbee. Question is the same can i change default com port for communicate with computer? I can use other serial port for xbee i know about that i want to use shield for it.

I know i can use xbee explorer usb kind of stuff but i dont want to. For further applications like using a joystick for controlling robot on computer im going to need send datas over RF.

Last question: Are there any way to make my usb port (virtual rs232) make accessible over internet? Ethernet shields doesn't look like that simple. I really want to control it via internet i do some research about similar projects but i couldn't figured out the codes about it. I dont understand coding htmls...

Best Regards.

I realised that i forgot the add devices links:

here is the xbee module that im talking about:

Which communication type should i use when setting up xbees via x-ctu?

From XBee Pro 900 RPSMA - WRL-09099 - SparkFun Electronics

Capable of point-to-point, peer-to-peer and point-to-multipoint networking, the XBee-900 XSC is ideal for solutions where RF penetration and absolute transmission distance are paramount to the application.

So, what kind of communication do you want to do? Point to point would be my guess, but I'm not much into guessing.

Can i use xbees as transreceiver

Yes.

What type of things i can send with Xbees.

Well, you can't send shoes. I don't think you can send fishing poles, either.

You CAN send serial data.

I'll leave you the option of refining the question.

If i had two of UNOs or Duemilanoves and if want to use sending commands with hyperterminal, im going to have to remove xbee shield because they are using the same pins. Can i change default serial pins for USB communication of boards with computer?

If you are sending data from a PC, rather than an Arduino, you don't need an Arduino on the sending end. Instead, you need something like this:

[edit]Never mind. I see you ruled that out. Then, it's not the shield you need to remove. It's the ATMEGA chip. I guess you need to remove the shield to remove the chip, if it's removable at all.[/edit]

Can i change default serial pins for USB communication of boards with computer?

With a soldering iron, and some careful study of the schematics, nearly anything is possible.

Instead of two UNOs if i would use Arduino MEGA i know i can use 6 of serial ports.

Serial: 0 (RX) and 1 (TX); Serial 1: 19 (RX) and 18 (TX); Serial 2: 17 (RX) and 16 (TX); Serial 3: 15 (RX) and 14 (TX).

4 serial ports, not 6.

Only one pair (0, 1) is connected to the USB chip, though.

Question is the same can i change default com port for communicate with computer?

No. The PC connected to the USB port which connects to pins 0 and 1 which are Serial's pins.

Are there any way to make my usb port (virtual rs232) make accessible over internet?

Not directly. If you run a web server on your computer, you can make your computer accessible from the internet. Then, any PUT or Get request that the server handles can access the serial port, for write at least. Some scripting languages on the PC can read and write to the serial port. Others can just write. Depends on the scripting language and the OS.

first of all thank you sir.

Im considering to using point-to-point, i couldnt explained much about this in question, sir. which function set (coordinator at/ router end device etc.) should i use for my application. Actually, i didnt understand of these functions. Are these funcs. limiting my transreceive activity?

And about the xbee; i dont have any intensions like sending shoes :slight_smile: what i want to ask was can i send letters, or numbers? like serial.print("W"); (assumed xbee connected to serial 0). Because it would be easy to use on receiver;

a=serial.read()

if ( a == W) { do something }

I think im not going to able to change default serials with modification in software. i guess im gonna have to use other ports for xbee (on mega)

I think im not going to able to change default serials with modification in software. i guess im gonna have to use other ports for xbee (on mega)

You are not going to be able to change which is the serial port.
Depending on how you connect the XBees, you may not be able to change the pins they read from/write to, either.

You can send bytes to the serial port, for the XBee to transmit. The bytes received by the XBee are written to the serial port.

A byte is a collection of 8 bits, which, conveniently enough, is also the size of a character. So, so can send numbers (from 0 to 255) or characters. If the numbers represent servo positions, and the servo is limited to 0 to 180, then sending numbers is easier, since there is no need to convert to a string and convert back to a number on the other end.

On the other hand, sending 16 bit integers and 32 bit floats is harder. They need to be sent as multiple bytes and reassembled on the receiver. Or, they need to be sent as strings.

Im considering to using point-to-point

Good choice, for two devices that need to communicate in both directions.

Digi claims:

No configuration needed for out-of-the-box RF communications

but, I don’t believe that. On the other hand, I’ve never use that particular XBee, so, for that model, they may be right.

The X-CTU program will show you a list of modem types that the XBee supports. That list will be different for each XBee model. If XB24 is on your list, and the function set XBEE 802.15.4 is available, select that, and set PAN ID, MY, and DL on one XBee. Then, for the other one, set the same PAN ID, and swap MY and DL values, so MY1 = DL2 and MY2 = DL1.

If not, you’ll need to experiment.

if ( a == W)

should be if ( a == ‘W’).

Thank you PaulS

That made my solution easier. if can send 8 bit of data easily, since i want to drive dc motors i could easily send the amount of pwm duty cycle. you have just made my day sir.

What i wanted to say about serial ports was; if i use xbee shield for rf on board and connect the board to computer and sending commands from pc with hyperterminal, im gonna have to use another rx/tx pins like serial1 for xbee on the mega2560 board. Because the board communicates with computer via serial0

About configuring xbees; i particularly didnt understand functions of router/end , coordinator at. I guess the answer is setting XBEE 802.15.4 on function set. identification of xbees means they wont use any data from other xbess except the devices which have the same id, am i right? that means i dont need a special number or letter in case of reflected wawes and faulty datas. thats good

thank you again

You haven't said anything about how you will be connecting the XBee to the Arduino, so it's hard to comment on that issue. But, typically, you can only have one device on each end of a serial port - the PC on one end and the Arduino on the other end. The Arduino with XBee is a special case. Anything that appears on the serial port, the Arduino will read and process AND the XBee will see and broadcast.

If it is important on the receiving end to know which data came from the PC and which came from the Arduino, the Arduino should preface all of it's transmissions with some prefix. The receiver can then distinguish PC data/messages from Arduino data/messages.

I am using xBee 900 Pro modules, which I think are very similar. Out of the box, without even running xCTU, they communicate as if you had run a wire. I don't use a shield, though. I breadboard so I can pick the serial port on the MEGA. I also have a couple on Pro Minis and there I have to share Serial 0 with the FTDI (USB via a special cable). I have to take the xBee module out while I am uploading fresh code. But if you don't do any special programming via xCTU, it's a party line. All the receivers get data from whoever transmits. It's serial data and you can define your own protocol if you want (sending characters as you said, for example).