Hi,
there are several topics out there regarding this kind of problem, but none of them are really solved to help me out here…
I simplified the example code of the Xbee library:
<< in the second answer below you can find another try>>
I first just want to send an Xbee package to my second Xbee (both connected to an Arduino Uno).
Via onboard led pin 13 I want to show the state on my arduino boards.
I used the code from the “simple RX/TX” example and modified it:
I send a package every 3500 ms…
// SH + SL Address of receiving XBee
XBeeAddress64 addr64 = XBeeAddress64(0x0013a200, 0x40b09937);
ZBTxRequest zbTx = ZBTxRequest(addr64, payload, sizeof(payload));
ZBTxStatusResponse txStatus = ZBTxStatusResponse();
void loop() {
payload[0] = 97;
payload[1] = 98;
xbee.send(zbTx);
// flash TX indicator
flashLed(statusLed, 1, 100);
delay(3500);
}
and I just want to know if my second Xbee receives something, but LED 13 always blinks 3 times, meaning nothing arrives, am I right?
Receiving Code:
void loop() {
xbee.readPacket();
if (xbee.getResponse().isAvailable()) {
flashLed(statusLed, 1, 100);
}
else if (xbee.getResponse().isError()) {
flashLed(statusLed, 2, 100);
//nss.print("Error reading packet. Error code: ");
//nss.println(xbee.getResponse().getErrorCode());
}
else{
flashLed(statusLed, 3, 100);
}
delay(1000);
}
In AT mode I have no problems sending data.
I updated to the newest API firmware for one coordinator and one router - both have the same PanID…
I really don’t know how to troubleshoot this communication problems - any ideas?