Configuring Xbee through personal GUI for conrol app.

Hi,

I have got 2 zigbee modules. One will be placed in the robot and other connected to the PC Via USB Dongle. I am planning to develop a GUI based on C# to send control signals to the robot. Following are the questions I have:

  1. Which mode of transmission should I use(Direct or Indirect)

2.Can I configure the Xbee module from a GUI based on C# ? How?

3.When I send command, Do I send it in Binary or hex ?

Please answer my question as I dnt know where to start from!. I really appreciate it.

thanks,

Mitul

1- ? I don’t know what the difference is.

2- Yes. You send AT commands to the XBee as per the XBee manual.

3- That is up to you. Binary is more compact but not easy for human readability whereas ASCII may require addition code for conversion.

How should I send AT/API command using a GUI made in C# language(Microsoft Visual Studio Platform)?

Can I send the API frames as a text to the xbee module?

I’m sure C# has serial interface library functions to send any data you wish to a serial port on the PC, RS232, USB with serial emulator, etc. See the C# documents.

Can I send the API frames as a text to the xbee module?

API frame are very, very specific and must be exact as per the XBee document. The API frame values are in binary (hex) but the payload can be ASCII.

Well, Ive got 1 idea… which is keeping the xbee in transparent mode and sending the data to be transmitted using C# . But im not sure whether im doing the right thing by keeping xbee in transparent mode. Can anyone tell me which mode of xbee should I use to communicate with my robot… API /Transparent ?

If you only need to send/receive data to/from a robot then transperant (AT) mode is the easiest. In this mode the XBee just passes what ever is put into the UART across the RF link to the other XBee and out the UART. This will work as if the robot is hardwired to the comm port of the PC.

To set-up the parameters in the XBees, connect each one to the PC, with an RS232 or USB board and use X-CTU. Be sure that you ‘write’ the parameters so that they get stored into NVRAM on the XBee.

API mode is handy if there is more than one ‘remote’ XBee since the ‘address’ of the remote XBee is in the API frame and a program on the PC can sort out which XBee the data come from. Also, the PC can direct data to a specific remote XBee since the address must be in API frame.

mitul:
Hi,

I have got 2 zigbee modules. One will be placed in the robot and other connected to the PC Via USB Dongle. I am planning to develop a GUI based on C# to send control signals to the robot. Following are the questions I have:

  1. Which mode of transmission should I use(Direct or Indirect)

2.Can I configure the Xbee module from a GUI based on C# ? How?

3.When I send command, Do I send it in Binary or hex ?

Please answer my question as I dnt know where to start from!. I really appreciate it.

thanks,

Mitul

to clarify:

ZigBee is the name of a network layer protocol with routing so it’s akin to IP and TCP.

ZigBee is used with the data link layers defined by IEEE 802.15.4.

ZigBee is not a synonym for IEEE 802.15.4 - as TCP/IP is not a synonym for IEEE 802.3.

Xbee Series 2 are ZigBee based. Series 1 is not, and can use basic 802.15.4 and optionally, other non-ZigBee protocols.

You benefit in time-saved from reading the tutorials, the XBee user/OEM guide, etc. A lot depends on if you have Series 1 vs. Series 2 XBees, where the latter is ZigBee based for mesh (repeaters) networks which are complex.

Normally, one configures the Xbee (series 1?) rarely, so using Digi’s free XCTU software is most common. The configuration commands are similar to Hayes Modem “AT” commands (all ASCII text) are are each documented in the XBee OEM/user guide, downloadable from Digi.

If you configure the XBee for transparent serial port extension, and that meets you needs, you’re done. The serial port on on is recreated on the other, with certain speed and flow control limitations just like any modem. One Xbee can connect to a PC’s serial port or USB/serial, with the proper RS232 converter since the XBee itself isn’t RS232.

The XBee API mode is all binary. There are C libraries for it to run on a PC, or you can roll your own. The API mode gives your application, on a PC or on a microprocessor connected to an Xbee, full control over configuration, source and destination XBee addresses, and so on.

Thanks a lot guys. Now I am very clear what I need to do to transmit my signal. I think transparent mode should work well. But when I send data from my GUI, can I send anything? or it has to be in a specific format . ex: HExadecimal or Ascii? for example IF I need to send text ’ hello.’ ?

And how should I get the signal to the microcontroller from zigbee in the robot ?

In transparent mode you can send anything except the sequence and timing to put the XBee into command mode (see the manual).

Connect the XBee UART to the processor UART (see the manuals on the XBee and the processor).

mitul:
Thanks a lot guys. Now I am very clear what I need to do to transmit my signal. I think transparent mode should work well. But when I send data from my GUI, can I send anything? or it has to be in a specific format . ex: HExadecimal or Ascii? for example IF I need to send text ’ hello.’ ?

And how should I get the signal to the microcontroller from zigbee in the robot ?

The robot’s microcontroller will have a UART with RX and TX data and GND. These connect to the XBee, but crossed, i.e., RX to TX and vice-versa. The BAUD RATE used by the micro and the Xbee must match.

You really need to step back and read the tutorials on XBee, and maybe a primer on computer number systems and arithmetic.

By Hexadecimal do you really mean binary data, where the 8 bits per unsigned char are used arbitrarily? This is binary mode. Hexadecimal is a textual way to represent binary data: such as 0xFF is all 8 bit set to one in a byte and 0xAA is every other bit.

You should be able to send binary data, but YOU must devise a flow-control method so that the bytes per second don’t exceed the capacity of the wireless link. And once in a while, due to error correction, data frames will be delayed, say, a quarter second. This is life in Wireless (and dial up modems too!)