nrf9160 MQTT Disconnects after some time

Hello, 

I am working with a thingy9160 to connect to an MQTT broker using TLS.

I have run into an issue where the MQTT connection is disconnected with error code #XMQTTEVT: 1,-128.

This sometimes happens within a few minutes and sometimes after hours. It seems to be related to the keepalive time. If I have the keep a live set to 60 seconds it stays connected longer than if it is set to 10 seconds. The signal strength and quality are both good when this happens. Could this be related to some power saving timing on the LTE end? 

I captured a modem trace of the issue:

Any help is appreciated.

Parents Reply
  • I tried two different networks with the same result. I also tried modifying the prj.conf for the SLM to set the keep alive time using 

    CONFIG_MQTT_KEEPALIVE=20
    I still set the keep alive from the SLM  AT#XMQTTCFG command as well. It seems adding this to the project config has changed things and the device is able to keep the connection better, although the problem eventually does happen. See attached trace.
    I will look at changing the line in the MQTT stack and let you know if that fixes things.Hive MQTT RRC reconnect2.pcap
    Thanks,
    Kevin
Children
Related