xBee API packet assembly

Hi everybody.

I am currently working on a sensor network project at my university. I am using Visual Basic 2008 on the computer connected to the coordinator and I am using xBee 2.5 modules.

Here is the code I wrote to send the packets out the serial port.

Dim TestData(8) As Byte

Dim TX_summa As Integer = 0

Dim TX_checksum2 As Integer = 0

TestData(0) = &H7E

TestData(1) = &H0

TestData(2) = &H4

TestData(3) = &H8

TestData(5) = &H4E

TestData(6) = &H44 ‘Node Discover command

For t = 3 To 6

TX_summa = TX_summa + TestData(t)

Next

TX_checksum2 = 255 - TX_summa

TestData(7) = TX_checksum2

rs232.Write(TestData, 0, 8)

Somehow I got the “ND” command to work.

So my questions are the following

If I wanted to send a command to one of my xBee end devices such that it would send back a read of all enabled input lines, what would such a packet look like? By looking at the xBee manual I can see that I am supposed to use the I/O command “IS” or “1S” but what API identifier am I supposed to use with it?

Also I want to get an RSSI (signal strength) packet from my end devices. Again I know I am supposed to use RF interfacing command “DB” but I cannot seem to get any response from my end devices.

Does there exist some kind of a packet testing program?

If someone knows how to assemble these API packets correctly please enlighten me.

Look for the thread titled “Better XBee documents”. This has a number of links to the help you need.

Thanks.

This will probably help allot.

The Digi support forum is pretty good.

http://www.digi.com/support/forum/index … tegoryID=1

Here is alternative xBee documentation.

viewtopic.php?t=17745&start=0&postdays= … +documents

I am still not getting RSSI to work.

Regarding the 2.5 series, RSSI seem to be a common question, but there appear to be no apparent solutions… I have tried to connect the RSSI/PWM pin to one of the AD pins but I did not get it to work. Any ideas!!!

The RSSI output is PWM with the width propotional to the signal strength.

Download the XBIB dev board schematics from Digi Int. They have a PWM to voltage circuit and then some comparators to light an LED stack to show the RSSI value. The circuit may be useful to produce on analog voltage for the XBee input.

I have been able to locally and remotely read the RSSI register value in Series 2 modules running ZigBee firmware. This does require the ‘base’ unit to be in API command mode to send a remote command.

The Digi forum is pretty good. You will see my user name there also.

waltr:
The RSSI output is PWM with the width propotional to the signal strength.

Perhaps the OP meant accessing RSSI from the packet data, as one can do if the Digi API wrapper is used. At least one can with Series 1 XBees.

stevech:

waltr:
The RSSI output is PWM with the width propotional to the signal strength.

Perhaps the OP meant accessing RSSI from the packet data, as one can do if the Digi API wrapper is used. At least one can with Series 1 XBees.

Yes that is what I meant. I want to get access to the RSSI value in an API packet.

f.eks I want to send a command to the end device and I want it to reply with an RSSI value in an API packet. I am sorry if I’m not clear enough on my questions.

I am using FW:

COORD: XB24-B ZNET 2.5 COORD API version: 1147

END DEVICE: XB24-B ZNET 2.5 ROUTER/END DEVICE API version: 1347

What is the main difference between firmware XB-24B and XB-24ZB.

I was looking at the XB24-ZB FW. I saw that it has a Diagnostic Command = DB, the XB24-B FW does not have this option.

If the two devices have the same transmitter power and antennas, then the received signal strength for node A will be very nearly the same as at node B.

I recall that later firmware versions have a means to do a remote AT command, i.e., send an AT command to the far end and get the results, e.g., RSSI for last packet the far end received.