RadioLib
RadioLib copied to clipboard
RADIOLIB_LORAWAN_NO_DOWNLINK when calling activateOTAA() with Tock setup
Describe the bug
When trying to activate a LoRaWAN device I see the following failure
[2024-06-26 22:25:59.867] [SX1261] Initialising Radio ...
[2024-06-26 22:25:59.995] RLB_PRO: Setting up fixed channels (subband 2)
[2024-06-26 22:25:59.998] RLB_PRO: mask[7] = 0x0002
[2024-06-26 22:26:00.001] RLB_PRO: UL: 65 1 (0 - 1082960896) | DL: 6 6 (0 - 0)
[2024-06-26 22:26:00.007] RLB_PRO: mask[0] = 0xff00
[2024-06-26 22:26:00.009] RLB_PRO: UL: 65 1 (0 - 1082960896) | DL: 6 6 (0 - 0)
[2024-06-26 22:26:00.013] RLB_PRO: UL: 8 1 (1610612736 - 1082959462) | DL: 0 5 (0 - 0)
[2024-06-26 22:26:00.021] RLB_PRO: UL: 9 1 (0 - 1082959872) | DL: 0 5 (0 - 0)
[2024-06-26 22:26:00.025] RLB_PRO: UL: 10 1 (-1610612736 - 1082960281) | DL: 0 5 (0 - 0)
[2024-06-26 22:26:00.034] RLB_PRO: UL: 11 1 (1073741824 - 1082960691) | DL: 0 5 (0 - 0)
[2024-06-26 22:26:00.040] RLB_PRO: UL: 12 1 (-536870912 - 1082961100) | DL: 0 5 (0 - 0)
[2024-06-26 22:26:00.046] RLB_PRO: UL: 13 1 (1610612736 - 1082961510) | DL: 0 5 (0 - 0)
[2024-06-26 22:26:00.052] RLB_PRO: UL: 14 1 (0 - 1082961920) | DL: 0 5 (0 - 0)
[2024-06-26 22:26:00.058] RLB_PRO: UL: 15 1 (-1610612736 - 1082962329) | DL: 0 5 (0 - 0)
[2024-06-26 22:26:00.374] RLB_PRO: [MAC] 0x03
[2024-06-26 22:26:00.374] RLB_PRO: 0000000 00 00 00 80 | ....
[2024-06-26 22:26:00.383] RLB_PRO: LinkADRReq: dataRate = 0, txSteps = 0, chMask = 0x0000, chMaskCntl = 0, nbTrans = 0
[2024-06-26 22:26:00.395] RLB_PRO: LinkADRAns: status = 0x07
[2024-06-26 22:26:00.397] RLB_PRO: [MAC] 0x04
[2024-06-26 22:26:00.397] RLB_PRO: 0000000 00 | .
[2024-06-26 22:26:00.406] RLB_PRO: DutyCycleReq: max duty cycle = 1/2^0
[2024-06-26 22:26:00.409] RLB_PRO: [MAC] 0x05
[2024-06-26 22:26:00.412] RLB_PRO: 0000000 08 68 e2 8c | .h..
[2024-06-26 22:26:00.420] RLB_PRO: RXParamSetupReq: rx1DrOffset = 0, rx2DataRate = 8, freq =
[2024-06-26 22:26:00.433] RLB_PRO: RXParamSetupAns: status = 0x07
[2024-06-26 22:26:00.436] RLB_PRO: [MAC] 0x08
[2024-06-26 22:26:00.436] RLB_PRO: 0000000 01 | .
[2024-06-26 22:26:00.444] RLB_PRO: RXTimingSetupReq: delay = 1 sec
[2024-06-26 22:26:00.447] RLB_PRO: [MAC] 0x09
[2024-06-26 22:26:00.450] RLB_PRO: 0000000 0d | .
[2024-06-26 22:26:00.459] RLB_PRO: TxParamSetupReq: dlDwell = 0, ulDwell = 0, maxEirp = 30 dBm
[2024-06-26 22:26:00.464] RLB_PRO: [MAC] 0x0C
[2024-06-26 22:26:00.467] RLB_PRO: 0000000 65 | e
[2024-06-26 22:26:00.473] RLB_PRO: ADRParamSetupReq: limitExp = 6, delayExp = 5
[2024-06-26 22:26:00.479] RLB_PRO: [MAC] 0x0F
[2024-06-26 22:26:00.481] RLB_PRO: 0000000 fa | .
[2024-06-26 22:26:00.490] RLB_PRO: RejoinParamSetupReq: maxTime = 15, maxCount = 10
[2024-06-26 22:26:00.493] RLB_PRO: RejoinParamSetupAns: status = 0x03
[2024-06-26 22:26:00.809] RLB_PRO:
[2024-06-26 22:26:00.809] RLB_PRO: PHY: Frequency UL = MHz
[2024-06-26 22:26:00.846] RLB_PRO: PHY: SF = 12, TX = 22 dBm, BW = kHz, CR = 4/0
[2024-06-26 22:26:02.403] RLB_PRO: JoinRequest sent (DevNonce = 0) <-- Rx Delay start
[2024-06-26 22:26:02.406] RLB_PRO:
[2024-06-26 22:26:02.409] RLB_PRO: PHY: Frequency DL = MHz
[2024-06-26 22:26:02.447] RLB_PRO: PHY: SF = 12, TX = 22 dBm, BW = kHz, CR = 4/0
[2024-06-26 22:26:07.376] RLB_PRO: Opening Rx1 window (190 ms timeout)... <-- Rx Delay end
[2024-06-26 22:26:07.570] RLB_PRO: Closing Rx1 window
[2024-06-26 22:26:07.573] RLB_PRO: PHY: Frequency DL = MHz
[2024-06-26 22:26:13.471] RLB_PRO: Opening Rx2 window (190 ms timeout)... <-- Rx Delay end
[2024-06-26 22:26:13.664] RLB_PRO: Closing Rx2 window
[2024-06-26 22:26:13.680] activateOTAA failed, code -1116
[OP edited this log to add the timestamps as requested below]
To Reproduce The full code is here: https://github.com/alistair23/libtock-c/blob/alistair/lora-wan/examples/lora/sensor-lorawan/main.cc
The main snippet is below
// create a new instance of the HAL class
TockHal* hal = new TockHal();
int state;
// now we can create the radio module
// pinout corresponds to the SparkFun LoRa Thing Plus - expLoRaBLE
// NSS pin: 0
// DIO1 pin: 2
// NRST pin: 4
// BUSY pin: 1
SX1262 tock_module = new Module(hal, RADIO_NSS, RADIO_DIO_1, RADIO_RESET, RADIO_BUSY);
LoRaWANNode node(&tock_module, Region, subBand);
// Setup the radio
// The settings here work for the SparkFun LoRa Thing Plus - expLoRaBLE
tock_module.XTAL = true;
state = tock_module.begin(915.0);
if (state != RADIOLIB_ERR_NONE) {
printf("begin failed, code %d\r\n", state);
return 1;
}
node.beginOTAA(joinEUI, devEUI, nwkKey, appKey);
state = node.activateOTAA();
if (state != RADIOLIB_LORAWAN_NEW_SESSION) {
printf("activateOTAA failed, code %d\r\n", state);
return 1;
}
Expected behavior
https://github.com/jgromes/RadioLib/wiki/Troubleshooting-Guide seems to indicate that no downlink (-1116) is ok to ignore, but the actual examples check for it when running activateOTAA()
.
I would expect activateOTAA()
to return RADIOLIB_LORAWAN_NEW_SESSION
Screenshots
Additional info (please complete):
- MCU: Apollo3 (Using Tock)
- Link to Arduino core: Tock
- Wireless module type: SX1262
- Arduino IDE version N/A
- Library version: 6.6.0