- Sun Feb 21, 2016 11:40 pm
#188303
And yes, when I change my for loop to the normal 19,20,21,22, it gives FFFFFFFF, FFFFFFFF
It is like it deleted the bytes at the end which is absurd.
When I program the XBees Series 2 to this:
void setup()
{
Serial.begin(9600);
Serial3.begin(9600);
}
void loop()
{
if (Serial3.available()>=21){
for(int i=0;i<22;i++){
Serial.print(Serial3.read(),HEX);
Serial.print(",");
}
Serial.println();
}
}
It reads all 22 api frames from start delimiter to checksum.
Its like the code discarded half of the frames. Like the even half of the frames leaving only the odd half behide.
22-byte frames:
7E,0,12,92,0,13,A2,0,40,E7,79,DB,70,9E,1,1,0,0,8,2,9,1A
My byte frames:
7E,12,0,A2,40,79,70,1,0,8,9,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,
See how the "even" bytes are taken out?
I dont know if its the cause of the weird RSSI readings, but I am not going to do a distance test with what I have. I am doubting alot on the values though. Will screenshot and update ASAP.
It is like it deleted the bytes at the end which is absurd.
When I program the XBees Series 2 to this:
void setup()
{
Serial.begin(9600);
Serial3.begin(9600);
}
void loop()
{
if (Serial3.available()>=21){
for(int i=0;i<22;i++){
Serial.print(Serial3.read(),HEX);
Serial.print(",");
}
Serial.println();
}
}
It reads all 22 api frames from start delimiter to checksum.
Its like the code discarded half of the frames. Like the even half of the frames leaving only the odd half behide.
22-byte frames:
7E,0,12,92,0,13,A2,0,40,E7,79,DB,70,9E,1,1,0,0,8,2,9,1A
My byte frames:
7E,12,0,A2,40,79,70,1,0,8,9,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,
See how the "even" bytes are taken out?
I dont know if its the cause of the weird RSSI readings, but I am not going to do a distance test with what I have. I am doubting alot on the values though. Will screenshot and update ASAP.