Lopy4 not retry join request every 15 secs
The documentation says that:
Join a LoRaWAN network. Internally the stack will automatically retry every 15 seconds until a Join Accept message is received.
Seeing in the NS, after the first request, the next one comes just 2 min later
@fernandes-son That would be consistent with what I believe the code does.
The AU915 region only sends join requests at SF12, which take a long time to send, and are thus affected by the specific duty cycle. Some other regions can use faster data rates which mitigates the issue, depending on what data rate is used first.
Is there a specific reason this is an issue for you? Normally a device just joins once and after that it doesn't need to do it again, so it shouldn't be a big issue.
You may try restricting data rates on the channels, but I wouldn't be surprised if the code actually enforced the DR0 rule for joins per the spec.
@jcaron I did a test with these other channels and had the same result :\
lora.add_channel(index=8, frequency=916800000, dr_min=0, dr_max=5) lora.add_channel(index=9, frequency=917000000, dr_min=0, dr_max=5) lora.add_channel(index=10,frequency=917200000, dr_min=0, dr_max=5) lora.add_channel(index=11,frequency=917400000, dr_min=0, dr_max=5) lora.add_channel(index=12,frequency=917600000, dr_min=0, dr_max=5) lora.add_channel(index=13,frequency=917800000, dr_min=0, dr_max=5) lora.add_channel(index=14,frequency=918000000, dr_min=0, dr_max=5) lora.add_channel(index=15,frequency=919200000, dr_min=0, dr_max=5) lora.add_channel(index=65,frequency=916400000, dr_min=4, dr_max=4)
@fernandes-son not in regular operation, no, but for join requests there is a mandatory 1% duty cycle (and even less past the first hour) which applies in all regions, per section 7 of the LoRaWAN spec (and not due to local regulations like duty cycles in other regions).
You’ll see this in the RegionCommon.c file.
Again, I may be wrong, but it does seem consistent. One would have to check when that changed.
@jcaron On AU915, duty cycle is not used
@fernandes-son It's been a long time since I looked into that, and I was under the impression that, at least in the EU868 region join requests were indeed repeated every 15 seconds, but the logic is actually a lot more complex than that (not sure if that changed recently or not), and it seems there is a 1% duty cycle limitation across the whole band for join requests during the first hour after power-on (it becomes much worse after that), see section 7 of the LoRaWAN spec.
As the join request is supposed to be sent at SF12/BW125 (the slowest data rate), it probably takes over a second to send, which in turns means it has to wait 99 times that TX time (this is how the duty cycle limitation is enforced in the code), which brings us to over 100 seconds, which is probably what you are observing. It's supposed to also add a bit of randomness, I didn't check if/how that was done.
So it's probably just the documentation which is not accurate (either because it changed or because the behaviour varies between regions).
I have only skimmed through the code & specs so I may be wrong, though.
@fernandes-son It looks like it matches, which invalidates my first theory, time to find another one :-/
Do you have anything else you can use to monitor traffic actually send over the air?
Also, do you have the logs of what the gateway sees (including channels, data rates...)?
I'm wondering if there is any difference in the AU915 code compared to other regions, though I don't quite see why.
@jcaron What do you think?
Using AU915, Lopy4 release='1.20.1.r2', version='v1.11-06dfad0.
for i in range(0, 72): lora.remove_channel(i) lora.add_channel(index=0, frequency=915200000, dr_min=0, dr_max=5) lora.add_channel(index=1, frequency=915400000, dr_min=0, dr_max=5) lora.add_channel(index=2, frequency=915600000, dr_min=0, dr_max=5) lora.add_channel(index=3, frequency=915800000, dr_min=0, dr_max=5) lora.add_channel(index=4, frequency=916000000, dr_min=0, dr_max=5) lora.add_channel(index=5, frequency=916200000, dr_min=0, dr_max=5) lora.add_channel(index=6, frequency=916400000, dr_min=0, dr_max=5) lora.add_channel(index=7, frequency=916600000, dr_min=0, dr_max=5) lora.add_channel(index=64,frequency=915900000, dr_min=4, dr_max=4)
@fernandes-son what region are you in? What channels are configured on the LoPy? What channels are configured in the gateway? What firmware version are you using?
In most cases such issues are related to the LoPy sending the requests on channels the gateway is not listening on. Quite frequent in the US region which has lots of channels but where gateways only listen on a very small subset of them, for instance.