andrewrapp / xbee-arduino

Arduino library for communicating with XBee radios in API mode
GNU General Public License v2.0
337 stars 163 forks source link

No packet ACK on Coordinator #40

Closed garvamel closed 7 years ago

garvamel commented 7 years ago

Hello! I'm connecting 2 Xbees with the examples Series2_Rx_Nss and Series2_Tx. Communication is working great, but I never get a positive ACK on the coordinator. On the end device, the delivery status returns "succesful". The relevant excerpt from the Series2_Rx example is:

      // got something

      if (xbee.getResponse().getApiId() == ZB_RX_RESPONSE) {
        // got a zb rx packet

        // now fill our zb rx class
        xbee.getResponse().getZBRxResponse(rx);

        nss.println("Got an rx packet!");

        if (rx.getOption() == ZB_PACKET_ACKNOWLEDGED) {
            // the sender got an ACK
            nss.println("Sender got and ACK");
        } else {
          nss.println("Sender didn't get an ACK");
        }

Which always prints "Sender didn't get an ACK". Any insight on this is much appreciated.

Thank you all in advance!

garvamel commented 7 years ago

I'm an idiot for posting right before finding my mistake. The ACK validation had to be done against 0x41 and not 0x01 (ZB_PACKET_ACKNOWLEDGED). Because the message came from an End Device directly. Closed!