MQTT TCP Connect Error

Hi, I want to use my ESP32 with a Telit LE910C1 Cellular Module on Google Iot Core. I have used the pppos and mqtt libraries to achieve this. However as there is an error executing the AT+CGDCONT=1 with Telit from the pppos library, I have done a local build and changed that to AT+CGDCONT=? instead.

When I run my code, the module connects to the internet successfully and starts to send messages to Google IoT core. However, I noticed that the MQTT connection keeps disconnecting and reconnecting every 5 minutes with these error messages:

[May 8 15:50:13.384] mg_ssl_if_mbedtls.c:35 0x3ffd4990 mbedtls_ssl_flush_output() returned -78 (-0x004e)
[May 8 15:50:13.390] mg_ssl_if_mbedtls.c:35 0x3ffd4990 mbedtls_ssl_write_record() returned -78 (-0x004e)
[May 8 15:50:13.394] mg_ssl_if_mbedtls.c:35 0x3ffd4990 mbedtls_ssl_send_alert_message() returned -78 (-0x004e)
[May 8 15:50:13.408] mgos_mqtt.c:164 MQTT Disconnect
[May 8 15:50:13.408] mgos_mqtt.c:493 MQTT connecting after 2053 ms
.
.
.
[May 8 15:50:38.545] mg_resolv.c:213 Failed to resolve ā€˜mqtt.googleapis.comā€™, server 8.8.8.8
[May 8 15:50:38.552] mgos_mqtt.c:141 MQTT TCP connect error (-1)
[May 8 15:50:38.558] mgos_mqtt.c:164 MQTT Disconnect
[May 8 15:50:38.558] mgos_mqtt.c:493 MQTT connecting after 8672 ms

I am running a similar system using a SIMCOM 7600E module and am not encountering this error. I am able to build on the cloud for this.

My question is: Is there any difference with the cloud build and the local build that could be contributing to this error? Or is there another issue here?

It looks like your module gets disconnected.
Error -0x004e

Failed to resolve... indicates the same thing.

Iā€™m coming across the same error connecting to AWS IoT for MQTT. Most devices are fine, but a small number seem to randomly fail the MQTT ping, the MQTT gets disconnected and is then my ESP32 is unable to then resolve the endpoint address with the same error your are seeing above.

Did you ever get to the bottom of this?