-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Problems in current Lora implementation #10442
Description
I found a Problem in the current LoRa-Implemetation
According to the LoRa specs https://lora-alliance.org/resource-hub/lorawantm-specification-v11 Paragraph 3.3.1 the Receive Windows after Transmitting should account for a 20 microseconds (us or µs) delay inaccuracy. The comment in current master:pkg/semtech-loramac/contrib/semtech_loramac_timer.c contains a comment starting at line 63
seems wrong to me ( it is stating milliseconds).
See my comment in #10180
This might have caused #10352.
If i try to debug this and enable debugging at some places like master:drivers/sx127x/sx127x_getset.c
it behaves different since the debug messages are printed before the state is changed and influence the timing which is critical (is this a Heisen-Bug?)
There is another Problem:
The first RX window is is just about 55ms, it is closed by the DIO1 interrupt (I don't know why) which makes the 50ms even more critical ( if some one sleeps 22 ms short offset it seems to be very safe (hit the actual receive window in the close center) but only as long as u do not enable to many debug messages )
The second RX window is much longer (why?)
this was a join request
XX:28,877 - INFO # [sx127x] Change state: TX
XX:28,942 - INFO # [sx127x] Change state: IDLE
XX:28,944 - INFO # [sx127x] Change state: IDLE
XX:28,947 - INFO # [sx127x] Change state: IDLE
XX:28,951 - INFO # [semtech-loramac] Transmission completed
XX:30,520 - INFO # [semtech-loramac] MAC timer timeout
XX:31,971 - INFO # [semtech-loramac] MAC timer timeout
XX:32,965 - INFO # [semtech-loramac] MAC timer timeout
XX:33,958 - INFO # [semtech-loramac] MAC timer timeout
XX:34,951 - INFO # [semtech-loramac] MAC timer timeout
XX:35,046 - INFO # [semtech-loramac] MAC timer timeout
first rx window ( a littele delayed for debugging )
XX:35,051 - INFO # [sx127x] Change state: RX
XX:35,103 - INFO # [sx127x] Change state: IDLE
closed by DIO1 52ms
XX:35,106 - INFO # [semtech-loramac] RX timer timeout
XX:35,109 - INFO # [sx127x] Change state: IDLE
XX:35,945 - INFO # [semtech-loramac] MAC timer timeout
XX:36,087 - INFO # [semtech-loramac] MAC timer timeout
second rx window (it has some extra delay Why ( should have been 1 second after rxwindow 1 started )
XX:36,092 - INFO # [sx127x] Change state: RX
XX:36,488 - INFO # [sx127x] Change state: IDLE
closed much later (why?)