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,

     

    george.zhou said:
    I added the two macros you mentioned and tested them for a day on ncs1.6.0 and mfw_nrf9160_1.2.7, and found that the problem was improved. Some get stuck for 3 and a half minutes and return an error code, and sometimes get stuck for more than ten minutes and return an error code. The error returned is EINVAL.

    This is expected behavior if the nRF is unable to connect, due to network connectivity problems.

    george.zhou said:
    I tested one more day, unfortunately, the problem reappeared, stuck in mqtt connection with no return value all the time.

    And this was with which SDK and modem fw?

    The connect() call never returned?

     

    Kind regards,

    Håkon

Children
Related