Hello¡¡:
I am initiating me with Xbee.
I have a router whose configuration is the one shown in Figures. The configuration file is:
XB24-ZB_23A7.mxi
80
0
251
23A7
0
[A]ID=1234
[A]SC=FFFF
[A]SD=3
[A]ZS=0
[A]NJ=FF
[A]NW=0
[A]JV=1
[A]JN=0
[A]DH=0
[A]DL=0
[A]NI= Router_3
[A]NH=1E
[A]BH=0
[A]AR=FF
[A]DD=30000
[A]NT=3C
[A]NO=0
[A]CR=3
[A]PL=4
[A]PM=1
[A]EE=0
[A]EO=0
[A]BD=3
[A]NB=0
[A]SB=0
[A]D7=1
[A]D6=0
[A]AP=2
[A]AO=0
[A]SM=0
[A]SN=1
[A]SO=0
[A]SP=20
[A]ST=7D5D
[A]PO=0
[A]D0=2
[A]D1=3
[A]D2=3
[A]D3=3
[A]D4=3
[A]D5=3
[A]P0=3
[A]P1=3
[A]P2=3
[A]PR=1FFF
[A]LT=0
[A]RP=28
[A]DO=1
[A]IR=3E8
[A]IC=0
[A]V+=0
I have a coordinator connected to Arduino and I want to read data from 0x92 frame. Arduino code is:
void loop(){
// make sure everything we need is in the buffer
Serial.print("Try to connect, package size : “);
Serial.println(mySerial.available());
nbytes=mySerial.available();
if (nbytes >= 23) {
// look for the start byte
byte0=mySerial.read();
if (byte0 == 0x7E) {
// blink debug LED to indicate when data is received
digitalWrite(debugLED, HIGH);
Serial.print(” Byte “);
Serial.print(“0”);
Serial.print(” “);
Serial.print(byte0, BIN);
Serial.print(” ");
Serial.print(byte0, HEX);
Serial.print(" ");
Serial.print(byte0, DEC);
Serial.println(" ");
for (int i = 1; i < nbytes+1; i++){
byte1 = mySerial.read();
Serial.print(" Byte ");
Serial.print(i);
Serial.print(" ");
Serial.print(byte1, BIN);
Serial.print(" ");
Serial.print(byte1, HEX);
Serial.print(" ");
Serial.print(byte1, DEC);
Serial.println(" ");
}
digitalWrite(debugLED, LOW);
}
else
{
Serial.print("No Start Delimiter: ");
}
}
delay(100);
}
The problem I have is that the bytes that arduino is receiving do not match the specification of 0x92 frame:
Try to connect, package size: 26
Byte 0: 7e 126 ok
Byte 1: 0 0 ok
Byte 2: 14 20 Not true, is 24¡¡¡
Byte 3: 92 146 ok
Byte 4: 0
Byte 5: 7d 125
Byte 6: 33 51
Byte 7: A2 165
Byte 8: 0 0 This byte means???
Byte 9: 40 64 ok, but in the reference is byte 8
Byte 0: 8B 139 ok, but in the reference is byte 9
Byte 1: 6A 106 ok, but in the reference is byte 10
Byte 2: 98 152 ok, but in the reference is byte 11
Byte 3: 48 72 ok, but in the reference is byte 12
Byte 4: 7D 125 ok, but in the reference is byte 13
Byte 5: 5D 93 Is that the Package acknolewgement?? This byte means???
Byte 6: 1 1
Byte 7: 1 1
Byte 8: 1C 28
Byte 9: 3E 62
Byte 0: 1 1
Byte 1: 1C 28
Byte 2: 3E 62
Byte 3: 2 2
Byte 4: D 13
Byte 5: 60 96
Byte 6: FF 255
I can follow the sequence until byte 14 but because new bytes are appearing (e.g bytes 8 and 15) I am not sure about this frame.
Thank you in advance for your help