Closed ThomasLeister closed 2 years ago
I have a very similar setup and I'm experiencing the same issue. I'm using Elementary OS 6.1, so Ubuntu 20.04.
Update: I've started using a different LoRaWAN module from Waveshare (SX1262). I'm still in the process of updating / rebasing their custom version of this library, but I stumbled across the "duty cycle restricted" issue once again.
After reverting Commit e31d3c133f0effca9d3660e35b383506018eca39 and thus removing all new EMMc functions, the library seems to work fine for SX1262.
Maybe Commit e31d3c133f0effca9d3660e35b383506018eca39 is also causing the issue here. ... :thinking: Need to check that out.
I was unable to replicate this issue with the following setup:
LORAWAN_REGION
set to LORAMAC_REGION_EU868
Thanks for trying! Strange. Maybe that issue is related to my particular module type. I guess I'll continue debugging this issue after my WaveShare module has been brought into service :)
But any further feedback / experiences are appreciated! Maybe it helps to hunt down the issue.
Its a long shot but I noticed you used GCC 9 and I used GCC 10. I doubt thats the issue but its worth checking
I've ran into the same issue today, on a brand new board. After I called NvmDataMgmtFactoryReset
the problem disappeared.
More precisely, I've flashed firmware that called the NvmDataMgmtFactoryReset()
before lorawan_init_otaa()
. It immediately started to work. Then I flashed the previous version (without the NvmDataMgmtFactoryReset
call) and it again joined the network successfully.
It looks like something in LoRaMac-node breaks when the NvmDataMgmtRestore fails? In any case, I'm too tired (and probably too unfamiliar with the code) to try to narrow it down today.
@Mrkvak this sounds familiar to me. I've run into a very similar issue with my WaveShare SX1262 module. It wouldn't join the network via OTAA and said "Duty-cycle restricted" after a while. I could resolve the issue by running NvmDataMgmtFactoryReset() and then EepromMcuFlush() to write the changes to flash.
To me it seems that there's are bug related to context restoring. Maybe the machanism breaks with invalid data in flash? Not sure what is going on, either, but as soon as I'm back to using my SX1276 module, I'll try and investigate further.
I can confirm that doing a NvmDataMgmtFactoryReset()
fixes the "Duty-cycle restricted" issue.
Do you have to do the reset each time, or after doing it once, does it work from that point forward?
Like I've said, after performing the NvmDataMgmtFactoryReset once, everything works. Even after subsequent flashes, reboots, etc..
Finally had some time to check om this issue. Using NvmDataMgmtFactoryReset
and EepromMcuFlush
for a single time resolved the issue for me, too! (on my SX1276 setup as well as on my SX1262 setup)
I consider this thread solved, then. Still, it might be advisable to mention this pitfall somewhere in the README, because esp. newbies like me might not be aware that their settings are written to flash and persist on the device, even if the DEV_EUI and other "defines" have changed in the meantime.
@Mrkvak, @gniezen, @ThomasLeister thank you for the feedback!
I've created pull request https://github.com/ArmDeveloperEcosystem/lorawan-library-for-pico/pull/18 with a new example that can be used to erase the NVM.
Setup / Environment
1.2.0
.3.22.1
and arm-none-eabi-gcc11.1.0
Goal
Using the SX1276 with the lorawan-library-for-pico on a Raspberry Pi Pico. I'd like to use the library's "hello_otaa" example. The device is expected to use the OTAA mechanism and the send the "hello world!" message.
I would expect to see the device register at the gateway (gateway logs available in TTN Gateway Dashboard). After that, I should see a new upstream message in the Gateway log (and in the device's TTN log).
Issue
After setting the correct values in config.h, enabling LoRa debugging and uploading the example to the Raspberry Pi Pico target, the following log is displayed on the serial console:
(
XX-XX-XX-XX
was redacted ;-) )"Duty-cycle restricted" appears and I cannot observe any new LoRa payload messages or "join" messages on the gateway. The device log in TTN Dashboard stays empty. No sign of communication. TTN Dashboard says "never connected" about the Raspberry Pi Pico.
Even after wainting for an hour (=3599891 ms) nothing happens. I would have expected the LoRaWAN stack to re-try the join process, but no more log output appears. Also no updates on the TTN dashboard.
What I've tried
default_dev_eui
example.-DACTIVE_REGION=LORAMAC_REGION_EU868
)3.16.3
and arm-none-eabi-gcc9.2.1 20191025
1.3.0
I'm pretty clueless why I can't get my setup working. Maybe I forgot something important, maybe there were some undocumented changes or I can into a rare bug ;-) How could I try to debug the issue / what could possible cause the trouble?
I'm aware that this is not a support forum, but there should be plenty of LoRa experts here, so that's why I think this might be the most appropriate place to ask for some help.
References
Attachments
config.h: