Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send from XCTU Coordinator to Arduino Router Did Not Work #69

Open
facetime88 opened this issue Sep 4, 2018 · 0 comments
Open

Send from XCTU Coordinator to Arduino Router Did Not Work #69

facetime88 opened this issue Sep 4, 2018 · 0 comments

Comments

@facetime88
Copy link

facetime88 commented Sep 4, 2018

Hello,

This is a great library. But I think there is a bug.
I tried to communicate xbee pro s2c on arduino (set as router) to xbee pro s2c in PC XCTU (set as coordinator). No problem when sending from arduino to xtcu. Arduino get ACK (XCTU receive option said C0).

The problem when send request from XCTU to arduino with T0 (transmit options) set to C0 (means request for ACK). XCTU transmit status said delivery status is success. It means xbee on arduino has confirm it received the request made by XCTU. Yet there is no receive on the side of arduino. I use the Series2_Rx example in arduino and put some serial debug. But it never being hit.

Note: This only happen when using specific 64 address. But when in broadcast, arduino side receive normally. XTCU side all the same, whether broadcast or unicast, both get success delivery status.

xbee.readPacket();

if (xbee.getResponse().isAvailable()) {
  Serial.println("available...");
  // got something
  
  if (xbee.getResponse().getApiId() == ZB_RX_RESPONSE) {
    // got a zb rx packet
    
    // now fill our zb rx class
    xbee.getResponse().getZBRxResponse(rx);
        
    if (rx.getOption() == ZB_PACKET_ACKNOWLEDGED) {
        // the sender got an ACK
        flashLed(statusLed, 10, 10);
    } else {
        // we got it (obviously) but sender didn't get an ACK
        flashLed(errorLed, 2, 20);
    }
    // set dataLed PWM to value of the first byte in the data
    analogWrite(dataLed, rx.getData(0));
  } else if (xbee.getResponse().getApiId() == MODEM_STATUS_RESPONSE) {
    xbee.getResponse().getModemStatusResponse(msr);
    // the local XBee sends this response on certain events, like association/dissociation
    
    if (msr.getStatus() == ASSOCIATED) {
      // yay this is great.  flash led
      flashLed(statusLed, 10, 10);
    } else if (msr.getStatus() == DISASSOCIATED) {
      // this is awful.. flash led to show our discontent
      flashLed(errorLed, 10, 10);
    } else {
      // another status
      flashLed(statusLed, 5, 10);
    }
  } else {
  	// not something we were expecting
    flashLed(errorLed, 1, 25);    
  }
} else if (xbee.getResponse().isError()) {
  //nss.print("Error reading packet.  Error code: ");  
  //nss.println(xbee.getResponse().getErrorCode());
}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant