API Mode XBee Series 1 Analog Sensor

Hello! I have 2 XBee S1’s with one as the coordinator hooked up to an Arduino Uno and one as the end device connected to a pressure sensitive resistor. I am trying to send the analog signal from the one XBee to the other using API mode. I am currently using the following code:

void setup() {
Serial.begin(9600);
}

void loop() {
if (Serial.available()>21){
for (int i=0; i<22; i++){
Serial.print(Serial.read(),HEX);
Serial.print(“,”);
}
Serial.println();
}

The issue, however, is that the data that is printing is not consistent with what I would expect.

The first couple lines I receive are as predicted:
7E , 0 , A , 83 , 0 , 0 , 27 , 0 , 1 , 2 , 0 , 0 , F , 43
In this case from what I understand, F is my analog value from the sensor.

However, after a short period of time, the packets become much shorter:
7E , 0 , A , 83 , 0 , 24 , 2 , 55

I am not sure what is causing this issue. Possibly something with my code? Thank you!

These are invalid API frames. You can verify that by using the XCTU’s API frame explorer.

How can I fix this?

You are going to need to adjust your code that you are using to assemble the API frames till you get valid frames being sent to the radio.