Loses of downlinks when receiving data from TTN using LoPy4 nanogateway
-
@robert-hh said in Loses of downlinks when receiving data from TTN using LoPy4 nanogateway:
Is that behavior somehow repeating in time periods, like every 71, 35 or 17 seconds?
I don't think so, because I send uplinks every 20 or 40 secs and try to receive successive downlinks and sometimes works but sometimes does not works, it is a random behavior, for example yesterday I could get 7 successive downlinks with uplinks every 20 or 40 seconds (I reconfigure the uplink period of time with the downlink message) but then the 8th downlink failed, I restarted the node frame counter and started a new test but then the first 4 attempts of downlinks failed, later they worked
If the error occurs, does it affect a single message or a series of messages.
it affects to a serie of messages
From boot time of the nanogateway, is there a certain period where it works well, and then starts to fail?
No, sometimes the downlinks work ok from the start of the test, sometimes works ok after several uplinks, it is a random behavior
the strange is that I made this project in 2019 and I do not remember that I had issues with downlinks, maybe it was a bad idea to update the firmware?
-
@jg_spitfire For further analysis, please change line 416 of nanogateway.py from:
t_us = tmst - utime.ticks_cpu() - 15000into
t_us = utime.ticks_cpu() print("tmst = ", tmst, ", t_us = ", t_us) t_us = tmst - t_us - 15000and post the result for good and bad cases.
-
You say the project worked fine in 2019, do you remember the time/firmware version and are you able to downgrade it? In the meantime, lots of new features were added, which might have disturbed the critical timing window of a downlink message. I am not sure, but let me know if downgrading helps with your problem.
The idea by @robert-hh can help here as well!
Best -
@Gijs Hi, no, unfortunately I lost all that files and I don't have the firmware that I used by that time
-
@robert-hh Hi, this is what I got:
Downlink OK:

downlink error 1

dowlink error 2

downlink error 3

downlink ok 2

all this results are from the same test and I got them in that order
the lines of code you told me to change are just for debug no?, because at the end I see that t_us is in function of the same parameters
-
@jg_spitfire Thank you for the log data. It indicates the reason.
tmst is sent by the TTN host and is the time at which the gateway shall forward the downlink message. The clock scale for tmst is the gateways µs-clock, in this case ticks_us. The required relation is tmst < t_us. That is true for the good case, and false for the error cases. For error1, the downlink message arrives more that 9 seconds late, for error2 and error3 it is more than 4 seconds.So there are most likely large delays in the downlink between the TTN server and your gateway. Maybe a busy WiFi network, maybe problems in the internet connection, maybe issus at the TTN server.
-
@robert-hh I just want to know if this behavior is expected or it should not be this kind of loses in downlinks, you say:
The timing of the xxPy device is not very precise, and the LoRa requirements are strict.
so if it is an issue proper of the device there is no an official fix right?, I mean, I would be more concerned if someone told me that he is using a lopy4 nano gateway and he does not have this kind of behavior, I have read some of your posts but I did not understand if the issue was 100% resolved, did you have the same issue and could you fixed it permanently?
-
@jg_spitfire The errors you demonstrated are most likely not related to the LoPy4 and Microypthon/nanogateway software.
The timing of the xxPy device is not very precise, and the LoRa requirements are strict.
This sentence is related to timing errors intrinsic to the nanogateway + xxPy device. But the magnitude of the error is much smaller. With that error, timing is (or was) off by <200 ms. It happens more rarely with the Lopy than the LoPy4. The LoPy4 with the SPIRAM is a little bit less responsive. See also this thread: https://forum.pycom.io/topic/2676/abp-mode-and-frame-counters
and this thread:
https://forum.pycom.io/topic/2924/not-solved-lora-timing-of-lopy-and-fipy/4?_=1593150795069After having that issue nailed down a little bit, the nanogateway was pretty reliable on up- an downlinks. Actually I am not using a nanogateway for TTN any more. After a few initial tests, I decided to go for a full blown RPI based gateway with the same chipset than the one PyCom announced recently. The reason is the full channel coverage.
I still have a Lopy with nanogateway running in the Loriot network, and that one is running since March, but with almost no traffic. And the only reason it stopped in the last year was for firmware updates and removing the power.
The TTN gateway has some traffic besides mine. Like 200 packets/day. Not overly busy. -
@robert-hh Hi, why do you say that for the good case tmst < t_us?
-
@jg_spitfire We might refer to different code. tmst is the intended time for transmission. When a packet arrives, tmst must be larger than the actual value of ticks_cpu(). So t_us is the calculated as:
t_us = tmst - utime.ticks_cpu() - 15000
That will be the time for the alarm handler, which then actually sends the downlink. The net timetmst - utime.ticks_cpu()is reduced by anther 15 ms to take in account the software needs for setting up the alarm and starting the scheduled function.In the change I suggested for analysis there was the first lines:
t_us = utime.ticks_cpu() print("tmst = ", tmst, ", t_us = ", t_us)in that printout, indeed
tmst > t_usis the good case. So you were right asking.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login