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
  • Tested according to the method you said, and did not solve the problem, indicating that the problem I encountered is different from the problem you mentioned, and it should be a new problem.

    First of all, the connection to mqtt is blocked, and I did not reconnect to mqtt because the program is stuck in the mqtt connection and does not return, but once the mqtt connection is successful, I will use mqtt_disconnect() to close the socket after sending the data.I can make sure that the socket is closed every time before connecting mqtt

Children
Related