mqtt_connect(&client) does not return any value during operation, and the program is stuck in mqtt_connect(&client) and does not come out

When I connected mqtt on nRF9160, I found a strange problem, which caused the device to freeze and become bricked. The location cause was found to appear in err = mqtt_connect(&client), mqtt_connect(&client) does not return any value when running, and the program is stuck mqtt_connect(&client) does not come out. What is going on? It is easy to reproduce after a period of normal operation. The device is running on ncs1.5.1, modem V1.2.3.

Below is my mqtt file:

Parents Reply
  • Hi,

     

    Based on your problem description, it can be several things that can make connect() hang.

    example: If there is a change in the network state, you can hang in the connect() call for minutes. If you enable the CONFIG_AT_HOST=y and issue "AT+CEREG=5", you will enable notifications when the network state changes for instance.

     

    You are running on an older SDK, do you see similar issues on newer SDK?

    If you still experience issues, could you share a modem trace showing the issue?

     

    Kind regards,

    Håkon

Children
Related