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

nRF9160 MQTT connection failure

Hi,

We are using nRF9160 ncs version 1.0.0. 

I have two queries.

We are making connection with AWS server. In the backend we have telenor server. 

We make MQTT connection, publish data and disconnect from server.

Connection interval is 5 minutes. 

We have observed that after 7-8 hours of successful connection (more than 100 times ) it gets stuck in

"connect" function inside "mqtt_client_tls_connect" function. It never comes out of "connect" function. 

Second query is we are using "lte_lc_psm_req" function to put the device in PSM mode to save power.

During first MQTT connection with AWS server device takes more than 10 minutes ( There are multiple failures in MQTT connection during this time )

Initially we get error -111 and then we get error -60. 

After 10 to 15 minutes, connection with  server is established and thereafter we don't have any issue in connection.

Can you help me in resolving this issue ?

Regards,

Smitesh Mali

  • Hi

    I've asked my colleagues about your matter, and they suggest this might be a mismatch somewhere. Could you try running a checkout in the repo, and a west update, as well as reinstalling the newest modem firmware onto the nRF9160.

    Also, it seems I misunderstood the AT+CPSMS? command, this will give you the requested values, and not the actual set values from the network. If you call AT+CEREG=5 followed by AT+CEREG? you should get the actual PSM-interval from the network.

    Best regards,

    Simon

  • Hi,

    I got "+CEREG: 5,1,"7A45","011DA405",7,,,"00000001","10111110"<CR>".

    So settings received from network is

    CONFIG_LTE_PSM_REQ_RPTAU="10111110" and CONFIG_LTE_PSM_REQ_RAT = 00000001

    Our setting is below 

    CONFIG_LTE_PSM_REQ_RPTAU="00000011"

    CONFIG_LTE_PSM_REQ_RAT="00000000"

    So TAU value as per my calculation is 30 minutes in both "10111110" and "00000011" settings. 

    So I don't think it should make difference in terms of timing is concerned.

    Regards,

    Smitesh Mali

  • Hi

    Yeah, the timing seems to check out. Please confirm whether or not running a checkout, updating west, and reinstalling the modem firmware worked.

    Best regards,

    Simon

  • Hi,

    I checked after checkout and update west again and also reset modem firmware but we are getting same issue. 

    We did another test yesterday. 

    We are powering off and on the nRF9160 supply every 2 hours. 

    After doing this we are not getting issue of nRF9160 getting stuck in "connect" function and data is being sent 

    to server every 5 minutes. 

    So it definitely seems firmware related issue. 

    Regards,

    Smitesh Mali

  • Hi

    So you can confirm that bsdlib and ncs matches? These commands in the CLI should do the trick, sorry for not posting these earlier:

    cd ncs/nrf
    git checkout master
    git pull
    git checkout v1.0.0
    west update

    Please confirm you've done this, and that bsdlib matches ncs. If the problem persists, please get a modem trace with this behavior and upload it here, so our developers can have a look at what exactly is going on. You can follow this guide to get the modem trace using the Trace Collector app in nRFConnect for desktop.

    Best regards,

    Simon

Related