Closed vladosam closed 6 months ago
Hi @vladosam, I see that you configured your device as a LoRaWAN 1.0.x device.
LoRaWAN session: v1.0
RadioLib specifically calls out for version 1.1.0 as the LoRaWAN version, as version 1.0.x is not tested and therefore definitely not guaranteed to work. Please register your device with version 1.1.0 and retry.
You may also have more luck by running the most recent version on GitHub (heck, maybe even the currently open PR), as opposed to version 6.4.2 that is currently out. There's a couple of bugfixes and improvements that are not out yet.
And if that still doesn't work, please disable the VERBOSE flag first before posting additional logs, as the SPI output makes the logs way too long to read. If we need the SPI output, we'll let you know :)
Thanks for reply. I will set device to 1.1.0 and try again.
Quick note: I also see that you call out both beginOTAA()
and restore()
. If you look at the current upstream examples, you'll notice that references to restore()
are generally removed; you shouldn't need that call as long as you use saveSession()
. In the current release 6.4.2 that is likely to cause some problems as well.
Progress. I changed device profile to lora 1.1 but now there is a new error code -6. Now I probably have join problem because I don't see device as active on server. I also remove restore()
from code.
[SX1262] Initializing ...
RadioLib Debug Info
Version: 6.4.2.0
Platform: ESP32
Compiled: Feb 27 2024 09:44:01
Found SX126x: RADIOLIB_SX126X_REG_VERSION_STRING:
0000320 53 58 31 32 36 31 20 56 32 44 20 32 44 30 32 00 | SX1261 V2D 2D02.
M SX126x
success!
[LoRaWAN] Attempting over-the-air activation ... Didn't restore session (checksum: 0, mode: 0)
First 16 bytes of NVM:
0000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
Wiping EEPROM and starting a clean session
Setting up dynamic channels
Channel UL/DL 0 frequency = 868.099976 MHz
Channel UL/DL 1 frequency = 868.299988 MHz
Channel UL/DL 2 frequency = 868.500000 MHz
exe MAC CID = 03, len = 4
ADR REQ: dataRate = 2, txPower = 0, chMask = 0x0000, chMaskCntl = 00, nbTrans = 0
DR 72: LORA (SF: 10, BW: 125.000000, CR: 5)
ADR ANS: status = 0x07
exe MAC CID = 04, len = 1
Max duty cycle: 1/2^7
exe MAC CID = 05, len = 4
Rx param REQ: rx1DrOffset = 0, rx2DataRate = 0, freq = 869.525024
Rx param ANS: status = 0x07
exe MAC CID = 08, len = 1
RX timing: delay = 1 sec
exe MAC CID = 09, len = 1
TX timing: dlDwell = 0, ulDwell = 0, maxEirp = 16 dBm
exe MAC CID = 0c, len = 1
ADR param setup: limitExp = 6, delayExp = 5
exe MAC CID = 0f, len = 1
Rejoin setup: maxTime = 15, maxCount = 10
Channel frequency UL = 868.099976 MHz
DR 72: LORA (SF: 10, BW: 125.000000, CR: 5)
Timeout in 556032 us
Join-request sent <-- Rx Delay start
Channel frequency DL = 868.099976 MHz
DR 72: LORA (SF: 10, BW: 125.000000, CR: 5)
Opening Rx1 window (226848 us timeout)... <-- Rx Delay end
closing
DR 104: LORA (SF: 12, BW: 125.000000, CR: 5)
Opening Rx2 window (683552 us timeout)... <-- Rx Delay end
closing
[LoRaWAN] Resuming previous session ... failed, code -6
Do you have access to gateway console / logs?
I have access to gateway. It is Heltec HT-M01 GW with Samtec PacketForwarder_UI.
INFO: Received pkt from mote: 12AC648B (fcnt=17814)
JSON up: {"rxpk":[{"tmst":11275396,"chan":1,"rfch":1,"freq":868.300000,"stat":1,"modu":"LORA","datr":"SF10BW125","codr":"4/5","lsnr":8.0,"rssi":-34,"size":23,"data":"AItkrBItlkVfAAAAAAAAAAABACmWQQ4="}]}
INFO: [up] PUSH_ACK received in 13 ms
Does a join-request arrive at your Chirpstack server (either at the gateway console on your server or in the gateway logs)? If you do see it somewhere, the problem is likely that there is a problem with the DevNonce in the join-request, and you should check "Resets DevNonces" on your device console (no idea where that is on Chirpstack, I use TTN). If you do not see any join-request, we will have to look a bit harder.
I don't see join requests on server. There were join requests when I used 1.0.2 lorawan version.
I don't see join requests on server. There were join requests when I used 1.0.2 lorawan version.
It's super very important to clarify if you see the JR in the gateway console but not in the device console as this will confirm the DevNonce situation.
In the meanwhile we can look at Chirpstack DevNonce config.
There is no JR on server. On GW this is what I see in console when I power up board.
JSON up: {"rxpk":[{"tmst":111289428,"chan":1,"rfch":1,"freq":868.300000,"stat":1,"modu":"LORA","datr":"SF10BW125","codr":"4/5","lsnr":8.5,"rssi":-15,"size":23,"data":"AItkrBItlkVfAAAAAAAAAAABACmWQQ4="}]}
INFO: [up] PUSH_ACK received in 2 ms
INFO: host/sx1301 time offset=(1709071617s:260861 us) - drift=851 us
On Chirpstack DevNonce is under Activation and it is empty for my device.
There is no JR on server.
So the JR isn't getting to the gateway server at all?
Useful screen shot, thanks - good to know there is a clear DevNonce button
No. Nothing comes to server.
Now I found that my GW is acting strange. It looks like it lost connection to server. It's getting late here so I will test this more in the morning and I will get back to you. Thanks for your help.
It was GW misconfiguration that caused code -6 error. I probably made mistake trying to fix my first code -12 error. Now node successfully connects to server. There is [LoRaWAN] Frequency error: -14100.16 Hz
in serial console on node. Is that something unusual?
You can ignore that, it's some gimmick output that has zero meaning about LoRaWAN.
Hi. I'm trying to use radiolib library on board. It worked when I first tried some examples but with current code all I get is code -12 and on next data send -1108. I checked status codes and I see that code -12 is (The supplied frequency value is invalid for this module). I'm not sure is it problem with code or maybe on server side (chirpstack v3). Any help is much appreciated.
Arduino code:
Debug messages: