Hi all,
i’m currently testing the ADR of my new node, but it seems not working as i expected. After 10 packages it seems that the ADR process is started, but not responded or recognized from the LMIC library. After a few packages i become the “error: too many failed ADR requests”. See the screenshot from my gateway:
Here is the code for init the LMIC:
void setup()
{
uint8_t mcusr = MCUSR;
MCUSR = 0;Serial.begin(115200); debugPrintLn(F("Boot")); showBootStatus(mcusr); // LMIC init os_init(); // Reset the MAC state. Session and pending data transfers will be discarded. LMIC_reset(); LMIC_setClockError(MAX_CLOCK_ERROR * 1 / 100); LMIC_setupChannel(0, 868100000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); // g-band LMIC_setupChannel(1, 868300000, DR_RANGE_MAP(DR_SF12, DR_SF7B), BAND_CENTI); // g-band LMIC_setupChannel(2, 868500000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); // g-band LMIC_setupChannel(3, 867100000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); // g-band LMIC_setupChannel(4, 867300000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); // g-band LMIC_setupChannel(5, 867500000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); // g-band LMIC_setupChannel(6, 867700000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); // g-band LMIC_setupChannel(7, 867900000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); // g-band LMIC_setupChannel(8, 868800000, DR_RANGE_MAP(DR_FSK, DR_FSK), BAND_MILLI); // g2-band LMIC_setLinkCheckMode(1); LMIC_setAdrMode(1); LMIC.dn2Dr = DR_SF9; debugPrintLn(F("S")); // Setup complete!" debugFlush();
}
This is my onEvent method:
void onEvent (ev_t ev)
{
debugPrint(os_getTime());
debugPrint(": ");
debugPrintLn(ev);
switch(ev)
{
case EV_SCAN_TIMEOUT:
//debugPrintLn(F(“EV_SCAN_TIMEOUT”));
break;
case EV_BEACON_FOUND:
//debugPrintLn(F(“EV_BEACON_FOUND”));
break;
case EV_BEACON_MISSED:
//debugPrintLn(F(“EV_BEACON_MISSED”));
break;
case EV_BEACON_TRACKED:
//debugPrintLn(F(“EV_BEACON_TRACKED”));
break;
case EV_JOINING:
//debugPrintLn(F(“EV_JOINING”));
break;
case EV_JOINED:
//debugPrintLn(F(“EV_JOINED”));
break;
case EV_RFU1:
//debugPrintLn(F(“EV_RFU1”));
break;
case EV_JOIN_FAILED:
//debugPrintLn(F(“EV_JOIN_FAILED”));
break;
case EV_REJOIN_FAILED:
//debugPrintLn(F(“EV_REJOIN_FAILED”));
break;
case EV_TXCOMPLETE:
debugPrintLn(F(“EV_TXC”));
if (LMIC.txrxFlags & TXRX_ACK)
debugPrintLn(F(“R ACK”)); // Received ack
if (LMIC.dataLen)
{
debugPrintLn(F(“R “));
debugPrintLn(LMIC.dataLen);
debugPrintLn(F(” bytes”)); // of payload
}
LMIC_transmitted = 1;
break;
case EV_LOST_TSYNC:
//debugPrintLn(F(“EV_LOST_TSYNC”));
break;
case EV_RESET:
//debugPrintLn(F(“EV_RESET”));
break;
case EV_RXCOMPLETE:
// data received in ping slot
//debugPrintLn(F(“EV_RXCOMPLETE”));
break;
case EV_LINK_DEAD:
//debugPrintLn(F(“EV_LINK_DEAD”));
break;
case EV_LINK_ALIVE:
//debugPrintLn(F(“EV_LINK_ALIVE”));
break;
default:
//debugPrintLn(F(“Unknown event”));
break;
}
}
Where is the problem? Do i need to set some other flag or use another event. The serial monitor of the Arduino IDE shows only that a “EV_TXCOMPLETE” is received by the LMIC.
Kind regards
Stefan