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

NRF modem 1.1.1 firmware, 1.2 SDK. Re-using sockets causes hang in nrf_connect.

I'm porting a working app from SDK 1.1 to 1.2, and have noted that when I make an mqtt connection close it, and re-open (to a different mqtt server) that the call to nrf_connect hangs indefinitely.

The socket number is the same, which makes me think that when the first connection closes, it leaves something in a bad state.

The two separate mqtt connections work fine in isolation from each other, just not when the connections are made sequentially. (open, close, open)

Also, I've noted that when I modify the code to make both connections one after the other, forcing the use of another "new" socket for the second connection, things work fine.

This worked fine with modem firmware 1.1.1 and SDK 1.1, so it seems like it might be a new SDK 1.2 bug.

Parents
  • Hi and .

    I have been able to re-create your issue on my end, using the cloud_client sample. I was not able to re-create it with the mqtt_simple sample, as the problem seems to be related to the TLS negotiation. I have also not been able to re-create 's workaround yet. Simply opening another socket does not seem to be enough (I'll keep working on it tomorrow). While I have captured a modem trace and forwarded it to our R&D team for further analysis, I would still like a trace from both of you. That way, I can verify that we see the same problem.

    , could you give more details about your application? What other sockets do you have open (or are you using any libraries that could be using sockets)? Which socket number is the problem? What protocol are you using? What server are you connecting to?

    I'll keep you updated when I know more.

    Best regards,

    Didrik

  • Hi Didrik,

    I am using NCS v1.2.0 on a Thingy:91 for my application, but am having the same problem on the nRF9160 DK. I'm connecting to an Azure Device Provisioning Service using secure MQTT, and then connecting to the IoT Hub that I get assigned. The application seems to use socket no. 2 for both connections. It worked using NCS v1.1.0.

    I am attaching a modem trace from my attempt this morning.

    Regards,

    Johan

    trace-2020-03-04T07-36-09.418Z.bin

Reply Children
No Data
Related