Pybytes Packet Loss over LTE
-
Hey all!
I'm running a Fipy over LTE and looks like not all of my packets that are sent go through Pybytes.
I'm sending one every 15 seconds for tests and added an HTTP integration for monitoring:
As you can see there's a gap (usually around 5-10 minutes) every so often but when I look at logs they are indeed sending?
This is pack_pybytes_message_variable(5, 0, b'[18.9273, -1, -1, -1]3') __pack_message: b'3e05005b31382e393237332c202d312c202d312c202d315d33' MQTT Protocol Packet sent. (Length: 66) [18.9273, -1, -1, -1]
Any ideas what would be causing this?
I'm thinking of just using Pybytes for OTA with an occasional send_ping_message() and using urequests for posting data instead to see if that helps.
Cheers,
S
-
Here's where I'm at as of now and it's the same issue I found here: https://forum.pycom.io/topic/6310/fipy-lte-not-initialized?_=1605173686464 from @kjm
@ssummers In answer to your question, it's not the reset causing the 'not initialised' error it's the denit itself, you have disposed of the lte so you need to make a new one, lte=LTE() Re network disconnections, I've never had any luck with getting the sequans to reconnect on an existing attachment.
My experience in marginal RF environments is that the modem actually looses attachment but doesn't know it, lte.isattached() and lte.isconnected() are both true but trying lte.disconnect() throws an OSError. I call this ZombiModem mode & the the only fix is to reset the modem & setup a new lte/attachment/connection
For now I'll just use longer intervals and fully disconnect / reconnect I guess.
-
@Scott-Basgaard Today I had a very similar problem. The log indicated that messages had been packed and sent, Pybytes indicated the contact in "last connection" but no data would arrive at pybytes. In my case it was 100% data loss though. It would be interesting to see if you have the same problems with another mqtt broker (like the one from Adafruit). Unfortunately I can't do this test as the Vodafone card only works with pybytes.
-
Here's the best I can do so far but as you can see 1-5pm was not so good and then I had some hours of success and some instability again.
-
@jcaron so it's definitely DNS related. If I just ping an IP in the same loop I never get packet loss, e.g.,
EAI_FAIL
etc.
-
@jcaron said in Pybytes Packet Loss over LTE:
NS servers are quite flaky, so it could solve the issue.
But there’s a good chance that it’s not just DNS, but actual connectivity. Try connecting to resources using just IP addresses to confirm.Thanks for the reply! Have tried both Google and Cloudflare DNS but no luck. I'm not sure it's set correctly for pybytes though and wondering if you have an example of how I can set DNS with Pybytes auto start? Found a few examples but they were overriding the library and doing it manually.
-
@Scott-Basgaard if the issue is DNS-related you’re try using a different DNS server, such as Google’s
8.8.8.8
and8.8.4.4
.Some DNS servers are quite flaky, so it could solve the issue.
But there’s a good chance that it’s not just DNS, but actual connectivity. Try connecting to resources using just IP addresses to confirm.
-
Still struggling with this :(
Have 9 running on latest pytes (7 with CAT-M1 and 2 with NB-IoT on Telia in Norway) and sending a signal every 15 seconds and after some time they still drop out. They do eventually come back though. From what I can tell the issue is after LTE attaches and I have a connection with Pybytes and there is random DNS issues?
I've tried:
- CAT-M1 and NB-IoT firmware
- Multiple sims.
- Pybytes on boot and manual connections.
- Sending data over urequest (to see if it's MQTT) but still locks up.
-
Updates
Was around today when there was data loss and tried:
print(socket.getaddrinfo('google.com', 80))
Which returned a
EAI_FAIL
so I guess it's LTE and carrier related and not Pybytes.