AVSystem / Anjay-zephyr-client

Anjay Zephyr LwM2M client.
Apache License 2.0
19 stars 7 forks source link

Lost Connection ERROR #5

Closed eabase closed 1 year ago

eabase commented 1 year ago

I managed to successfully connect an Nordic Thingy:91 with the latest Anjay LwM2M Client stack to the CoioteDM platform.

But then it suddenly lost the connection with the following error.

<wrn> anjay_zephyr_gps_nrf: GPS was interrupted multiple times by the LTE modem when producing a fix
    <inf> anjay_zephyr_lwm2m: Anjay is now offline
    <inf> anjay: [anjay] servers reloaded
<wrn> anjay: [anjay] transport required for protocol coaps is not supported or offline

After rebooting the device, the connection worked again, but I would like to know what happened and if this is reliable?

I'm using: A coaps URI, with PSK, and no bootstrap with default GNSS settings:

anjay config set lifetime 50
anjay config set bootstrap n
anjay config set security_mode psk
anjay config set gps_prio_mode_timeout 300
anjay config set gps_prio_mode_cooldown 1800

Any ideas of potential issues?

Maybe it would be a good idea to be able to disable BT and GPS from anjay when not in use?

eabase commented 1 year ago

I just found this text about nRF9160 connection loss.

nRF9160 uses the same radio for GPS and LTE connectivity. GPS signal is caught between LTE transmissions and in case GPS "cold" fix acquisition takes too much time, Anjay turns off LTE transmissions for the time of fix acquisition. It can be seen by the following warning:
gps_nrf: GPS was interrupted multiple times by the LTE modem when producing a fix.
Anjay is notified by it, enters offline mode and reconnects when the first fix is acquired and LTE is enabled back.

This was also added to the Thingy:91 documentation as they use the same baseband.

Mierunski commented 1 year ago

Hi, As mentioned by the NRF documentation - this is intended behaviour to allow GPS to catch fix. You can also disable GPS completely through KConfig options during compilation, or set timeout and cooldown values during runtime to different values

Best Regards Mieszko

eabase commented 1 year ago

@Mierunski

You can also disable GPS completely through KConfig options during compilation,

Yes, I know, and my point of #4 was exactly that. Add this functionality to the client so you don't need to recompile the entire client, just to turn on/off the GPS etc.