TCP Socket open failed on Bc660k-gl

Hi Quectel Team,

We have set up the Bc660k-GL module with Freertos cellular library. We work with a STM32, wiich sends commands to the quectel NB-IoT module. Sometimes, mostly after a STM32 reseset, we have following error, which gets repeated over and over again. Do we need to close the mobile connection? Or do you have an idea on how to continue here? Thanks

1756983077] [ERROR] [CellularLib] [_parseSocketOpenNextTok:112] _parseSocketOpen: Socket open failed, conn 0, status 566
[1756983077] [ERROR] [TCP Sockets] [TCP_Sockets_Connect:705] Socket connect timeout.
[1756983077] [ERROR] [MbedtlsTransport] [TLS_FreeRTOS_Connect:676] Failed to connect to … with error -6.
[1756983077] [WARN] [mqtt_agent] [vMQTTAgentTask:1148] Connecting to the mqtt broker failed. Retrying connection in 10300 ms.
[1756983088] [INFO] [mqtt_agent] [vMQTTAgentTask:1121] Attempting a TLS connection to …com:8883.
[1756983123] [ERROR] [CellularLib] [_parseSocketOpenNextTok:112] _parseSocketOpen: Socket open failed, conn 0, status 566
[1756983123] [ERROR] [TCP Sockets] [TCP_Sockets_Connect:705] Socket connect timeout.
[1756983123] [ERROR] [MbedtlsTransport] [TLS_FreeRTOS_Connect:676] Failed to connect to … with error -6.
[1756983123] [WARN] [mqtt_agent] [vMQTTAgentTask:1148] Connecting to the mqtt broker failed. Retrying connection in 70600 ms.
[1756983194] [INFO] [mqtt_agent] [vMQTTAgentTask:1121] Attempting a TLS connection to …

Hi,

The problem appears to be a “half” socket/PDP issue on the BC660K-GL side after the STM32 reset. A clean shutdown after each reset on the 566 (socket connect failed) and TLS level, then a PDP refresh, then opening TCP/MQTT, may resolve the issue. If necessary, fix DNS and disable sleep during debugging.

After MCU reset:

Cellular_Cleanup()
delay(1000ms);
Cellular_Init()
Cellular_CommonSetPdnConfig()
Cellular_ActivatePdn()

Can you follow this sequence and try again?