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

OTAA, ADR and LMIC_setLinkCheckMode #284

Open
hackdaworld opened this issue Jun 10, 2020 · 0 comments
Open

OTAA, ADR and LMIC_setLinkCheckMode #284

hackdaworld opened this issue Jun 10, 2020 · 0 comments

Comments

@hackdaworld
Copy link

Hi all,

just a quick question concerning ADR and link check validation.

Afaics, ADR is enabled by default since in LMIC_reset(), LMIC.adrEnabled ist set to FCT_ADREN.
In the example code (OTAA), link check validation is disabled once the node joined.

    case EV_JOINED:
      Serial.println(F("EV_JOINED"));
      // Disable link check validation (automatically enabled
      // during join, but not supported by TTN at this time).
      LMIC_setLinkCheckMode(0);
      break;
which essentially sets adrAckReq to LINK_CHECK_OFF
void LMIC_setLinkCheckMode (bit_t enabled) {
    LMIC.adrChanged = 0;
    LMIC.adrAckReq = enabled ? LINK_CHECK_INIT : LINK_CHECK_OFF;
}

However, since ADR is enabled and once the network sends MAC commands that result in data rate optimizations, link check validation is enabled again.

    if( LMIC.adrChanged ) {
        if( LMIC.adrAckReq < 0 )
            LMIC.adrAckReq = 0;
        LMIC.adrChanged = 0;
    }

Which makes sense of course since the node just changed its data rate and it needs to validate that the network still receives the uplink frames.

To put it in a nutshell, since ADR is enabled by default, disabling link check validation of a node that joins a network supporting/utilizing ADR is useless (but in the same time doesn't harm).

Can somebody confirm this?

Thanks and all the best, Frank

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