Decoding XBee Series 1 API Packet

I'm having issues trying to decode a XBee API packet. I start decoding it, but I'm not sure what my actual analog data should be. Several of them look like:

7E 00 12 83 56 78 43 00 05 02 00 00 00 03 FF 03 FF 00 00 00 00 60 7E 00 12 83 56 78 43 00 05 02 00 03 E8 03 FF 00 2A 00 00 01 C8 84 7E 00 12 83 56 78 43 00 05 02 00 03 FF 02 DE 00 0D 00 00 03 FF 73 7E 00 12 83 56 78 42 00 05 02 00 03 FF 00 00 00 00 03 DB 03 FF 83

So far I have:

7E - start 00 - length byte 1 12 - length byte 2 83 - API identifier 56 - source address byte 1 78 - source address byte 2 43 - RSSI value bytes 00 - option byte 05 - sample quantity byte 02 00 - channel indicator 0000 0010 0000 0000 (A0 is active) (IO header) (I'm not sure if this is right) last byte is chechsum

I'm using the XBee series 1 using XB24 firmware. I have a Lilypad temperature sensor based on the MCP9700.

The documentation for the XBee module is: http://ftp1.digi.com/support/documentation/90000982_G.pdf

The doc also says if any of the DIO lines are the first two bytes are the DIO sample. Why do I get "03 FF" or "E8 03" and sometimes "00 00" if I don't have any of the DIO lines active?

Schematic: Lilypad Temperature Sensor (pin S) --> Xbee (pin AD0)

For example using the last packet, assuming the "03" and "FF" are DIO info and ignored, my data would be: '00 00 00 00 03 DB 03 FF' Which is 64685055 in decimal, but it cant be greater than 1023 so I'm lost where my analog data is.

Any help is greatly appreciated trying to find the sensor output.

Also if there is any way to use the x-bee arduino library is helpful, I used the Series1_IoSamples but I get no output on the serial monitor. Does anyone know what pins should be set for ssRX and ssTX when using this shield

http://www.sparkfun.com/products/9976

Thanks a lot !!!

I'm trying to figure out something similar. If you figure it out please post what you ended up doing. I'll post if I figure something out.

Any chance you could post your xbee configurations?

Yes,

Base:

DL = 5678 MY = 1234 P0 = 2 IU = 1 IA = 5678 AP = 2

Remote: DL = 1234 MY = 5678 DO = 2 IR = 14 IT = 5 AP = 2

I have ATAP=2 for both XBee modules. I set it through the terminal. Does the Enable API and "Use escape characters" have to be checked in X-CTU ? Every time I check them, the setting doesn't seem to stay, even after I write the settings.

Thanks for the help !!

I'm starting to think that I don't have my Xbee configured correctly, or maybe that it isn't working properly (possibly I loaded the pin with too high of voltage). I get a serial output from my receiver when I turn on the transmitting Xbee, but I don't see anything that looks like analog data. I'll load up the settings and post them here and then try and change them.

Have either of you had luck recently?

Well, that was awful. I was at least getting something off of the Xbee communication this morning, but after fiddling with some things I get absolutely nothing off of them. I don't know if I fried one or what happened. I can still read/write the settings from the chips if that means anything.

Okay, back in business:

Receiver: PAN ID: 3137 DH: 0 DL: 0 MY: 0 AP:1 IU: 1 IA: FFFF DD: 10,000

Transmitter PAN ID: 3137 DH: 0 DL: 0 MY: 0 AP: 1 D2: 2 D1: 2 D0: 2 IR: 100 IU: 1 IA: FFFFFFFFFFFFFFFFF DD: 10,000

However, when I read the serial port this is what I get:

7E 00 0E 83 00 00 35 00 01 0E 00 03 FF 03 FF 03 FF 32 7E 00 0E 83 00 00 32 00 01 0E 00 03 FF 03 FF 03 FF 35 7E 00 0E 83 00 00 33 00 01 0E 00 03 FF 03 FF 03 FF 34 7E 00 0E 83 00 00 32 00 01 0E 00 03 FF 03 FF 03 FF 35 7E 00 0E 83 00 00 32 00 01 0E 00 03 FF 03 FF 03 FF 35 7E 00 0E 83 00 00 32 00 01 0E 00 03 FF 03 FF 03 FF 35 7E 00 0E 83 00 00 32 00 01 0E 00 03 FF 03 FF 03 FF 35 7E 00 0E 83 00 00 34 00 01 0E 00 03 FF 03 FF 03 FF 33 7E 00 0E 83 00 00 33 00 01 0E 00 03 FF 03 FF 03 FF 34 7E 00 0E 83 00 00 2F 00 01 0E 00 03 FF 03 FF 03 FF 38

I'm guessing that FF means that it is maxing out the inputs for some reason. But I don't know what the 03 means and I don't know why I'm maxing it out (I have a signal of 0.6V).

I think I figured out what my problem was. I didn't have anything for my Vref.

I have it working. If anyone still cares let me know and I can post how I did it.

I'm just wondering why your sender and receiver are both using broadcast mode. Paired communication (MY on one matches non-zero DL on the other) is faster and more reliable.

I haven't been able to figure out what's wrong still. Can you post what you did to get yours working. Thanks !!

Yes please post, I got my project working but I have an arduino at the Tx end as well as at the RX end. Not exactly what you are doing so my code might not work for you...

mtgordon: I have it working. If anyone still cares let me know and I can post how I did it.

Yes please post! :) I have my Vref connected to +5V (using Sparkfun regulator) and i'm still having problems.

Hello everyone,

I am facing the similar problem.

I have the “data” of the analog pins as “03 FF” ( hexa dec. eq. of 1023) in the data packet. But when I give a low, I am still getting it as “03 FF”.
Can anyone help me with this?
I am shorting the Ground with My analog Pin 3 to give a low o/p.
Both the XBees are USB Powered.

Here are my settings:

Co-ordinator : Sensor

Channel - 0 0
Pan ID - 0 0
Destination Add High - 13a200 13a200
D. Add Low - 4049cd27 40631e01
MY ( 16 bit source ) - 0 2345
SH - 13a200 13a200
sl - 40631e01 4049cd27
mac mode - 0 0
retry - 0 0
random delay slots - 0 0
node discover time - 19 19
node discover options - 0 0
cordinator enable - 1 0
scan channels - fffe 1ffe
scan duration - 4 4
end device association - 0 0
co - ord ass - 0 0
associatoin indi - 0 0
aes encryption enable - 0 0
aes encryption key - ky ky
node identifier - CO-ORD SENSOR_1

Power level - 4 4
CCA Threshold - 2c 2c

Sleep mode - 0 0
Time before sleep - 1388 1388
Sleep cycle period - 0 0
Disassociated cylce sleep period - 3e8 3e8
Sleep options - 0 0

Interface Data Rate - 3 3
Parity - 0 0
Packetization Timeout - 3 3
Api Enable - 1 1
Pull - up registers - FF ff

D8 - 0 0
D7 - 1 1
D6 - 0 0
D5 - 1 1
D4 - 0 0
D3 - 0 2
D2 - 0 0
D1 - 0 0
D0 - 0 0
IU ( i/p o/p enable) - 1 1
IT ( samples before tx) - 1 1
IC (DIO Change detect ) - 0 0
IR ( sampling rate) - 0 1000

I/O Input Address - FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF
t0-d0 - ff ff
t1-d1 - ff ff
t2-d2 - ff ff
t3-d3 - ff ff
t4-d4 - ff ff
t5-d5 - ff ff
t6-d6 - ff ff
t7-d7 - ff ff
po (Pwm 0) - 1 1
p1 (PWM 1) - 0 0
PT (PWM O/p timeout) - ff ff
RSSI PWM Timer RP - 28 28

Device type ident - 10000 1000
Ct-at Command mode timeout - 64 64
Gt (Guard times) - 3e8 3e8
cc (Command sequence character) - 2b 2b

Sample Recvd Packet on the co-ordinator -

7e 00 0a 83 23 45 28 00 01 10 00 03 ff d9

7e - delimiter
00 0a - length from the next byte till the checksum
83 - operating mode
23 45 - 16 bit address
28 - rssi
00 - options
01 - samples
10 - the analog masking of the in out pins
00 - digital mask ?
03 ff - decimal equ. of 1023. analog value.
d9 - checksum

Hello,

I am able to see the Digital Data on the screen .. but still cant get the analog data. Must me some circuit fault. Some really silly mistakes I made.

If I get proper analog values, I shall post back.

bump. any updates? mtgordon disappeared :(

Sorry about disappearing. I go busy trying to get the other parts of the project to work and forgot.

Here's the settings for my receiving XBee:

PAN ID - 3137 DH - 0 DL - 0 MY - 0 SH - 13A200 SL - 407B7712 CD - 1 AI - 0 AES Encryption Key - KY AP - 1 IA - FFF DD - 10000

Unfortunately my transmitter is in the middle of the project so I can't get to it easily. I might be taking everything apart early next week and I'll try to remember to get the settings off of it if I do.

What is CD? did you mean CE?