This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF9160 serial lte modem use mqtt

HI

   I use NRF9160 serial_lte_modem to test  NBIOT/MQTT, current SDK is V1.6.0 ,and config mqtt keepalive =1200S.

  after 9160 connect net, control mqtt connect my mqtt server  and publish data. another mqtt client subscribe 9160 publish topic.

this log show, in 11:59:46 NRF9160 publish data to server,and another mqtt client recv this data .but in 14:01:14  nrf9160 publish data,another mqtt client don't recv data .

In http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/serial_lte_modem/doc/MQTT_AT_commands.html  show, all MQTT operate will have EVENT return, but  publish data don't have  event return .

by AT log in 14:01:14,9160  should  be disconnected. Why the link will be disconnected?and this disconnect don't have event notification。If no notification ,I don't know when the 9160 is disconnected

Parents
  • Hi,

     

    In http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/serial_lte_modem/doc/MQTT_AT_commands.html  show, all MQTT operate will have EVENT return, but  publish data don't have  event return .

     No, that is not what is shown. #XMQTTPUB does not trigger an event if you send with QoS 0.

     

    this log show, in 11:59:46 NRF9160 publish data to server,and another mqtt client recv this data .but in 14:01:14  nrf9160 publish data,another mqtt client don't recv data .

     Are you sure the device was connected and subscribed to the correct topic?

    What QoS level did you use?

    I have not been able to reproduce this.

     

    by AT log in 14:01:14,9160  should  be disconnected. Why the link will be disconnected?and this disconnect don't have event notification。If no notification ,I don't know when the 9160 is disconnected

     Why should it be disconnected?

    Depending on the reason for the disconnect, you should get a MQTT event similar to this:

    #XMQTTEVT: 1,-113

    At the latest the next time the device publishes a message or sends a PING.

    Best regards,

    Didrik

  • HI

        the 9160 publish topic and another mqtt client subscribe topic  is same.

        MQTT config keepalive=1200S,and have two hours from 11:59 to 14:01. there should be 6 times keepalive and EVENT(#XMQTTEVT:9,0) return ,but none.  SO I thinks mqtt disconnect but  no  EVENT return 

       

Reply Children
Related