Hello Weilbs,
samples can be taken from the XBee sensor and wall router by polling then using an “IS” remote AT command from an API radio, or they can be pushed from the wall router or sensor by setting the sample rate “IR” parameter on them. This would have to be done by means of remote configuration, as there is no serial interface on these devices.
To poll the sensors from an API radio you will need to send a remote AT command with the IS parameter such as the following example.
7E 00 0F 17 01 00 13 A2 00 40 4A BA 3B FF FE 02 49 53 18
See page 92 of teh product manual found here for a byte by byte breakdown of this packet.
This example is going to take a sample from a sensor or wall router with the 64 bit address 00 13 A2 00 40 4A BA 3B.
The response frame will look something like this:
7E 00 1B 97 01 00 13 A2 00 40 4A BA 3B 20 FA 49 53 00 01 08 00 0E 08 00 00 C3 02 63 01 F0 45.
The frame breaks down like this:
7E - Delimiter
00 1B - Length bytes
97 - API frame Identifier
01 - Frame ID
00 13 A2 00 40 4A BA 3B - 64 bit address of sending module
20 FA - 16 bit address of sending module
49 53 - AT command sent (IS)
00 - Option Byte
01 - number of samples
08 00 - digital channel mask
0E - Analog Channel Mask
08 00 - Digital samples
00 C3 02 63 01 F0 - Analog Samples
45 - Checksum
This frame happens to come from a Temp/Light/Hum sensor so there are 3 analog samples of interest. (00 C3 02 63 01 F0)
The samples are read in this order: (light,temp,hum)
Light =00 C3 or decimal 195
Temp=02 63 or decimal 611
Hum=01 F0 or decimal 496
The formulas to convert these values to Lux, temp and Humidity are:
light = ADC1
temp = ADC2
hum = ADC3
So using these formulas, we get the following results.
Light (Lux)= 228.7390029
Temperature (C)= 21.67155425
Humidity= 35.36020917
The formulas for the wall router are similar:
mVanalog = (TempADC/1023.0)*1200.0
temp_C = (mVanalog - 500.0)/ 10.0 - 4.0
lux = (LightADC/1023.0)*1200.0
Hopefully this helps and is not too confusing. Let me know if you need any clarification.
This sort of “nuts and bolts” information is normally found in our Knowledgebase, which is basically a collection of articles written by Tech Support personnel based on experiences.
We will be adding an article based on the type of situation you mentioned in this thread at some point in the future.
I’m having an issue with calculating checksums and even the Excel checksum calculator didn’t seem to help me come up with the correct answer.
I’ve set up a Series 2 XBee Pro 900Mhz DigiMesh module to send periodic I/O samples via escaped API frames. The data packets I receive don’t make any sense to me at all.
Here is a packet with escape characters still in tact;
The first thing I notice is the length is wrong. The length bytes indicate a total payload length of 20 bytes, but this is obviously not the case. Also, I’ve tried arriving at the checksum of AD (173) by doing just about every combination of bytes in the payload possible and I can’t seem to figure it out.