Facing QMTOPEN errorcodes 2 and 3 frequently

Hello Quectel,

I’m using the EC200U LTE chipset in my project. It is interfaced with ESP32-S3 chip via UART. I’m using MQTT protocol in my project and occasionally when trying to establish the MQTT connection I’m facing +QMTOPEN=<client_idx>,2 and +QMTOPEN=<client_idx>,3 errors even though I’m testing with the same setup. These two errors pop out randomly.

Please let me know if I’m doing something wrong or anything else needs to be added to get rid of this issue totally.

Thanks !

My AT command sequence for your reference :
[LTE_DEBUG]TURN_OFF_ECHO_CMD
[LTE_DEBUG]Command sent : ATE0
[LTE_DEBUG]6 bytes Data Received :
OK

I (4548) [LTE_DEBUG]: 6 bytes Data Received :
OK

[LTE_DEBUG]network_flag(0) | client_flag(0) | sub_flag(0) | mqtt_connected(0)
[LTE_DEBUG]MQTT_NETWORK_CLOSE
[LTE_DEBUG]Command sent : AT+QMTCLOSE=5
[LTE_DEBUG]24 bytes Data Received :
OK

+QMTCLOSE: 5,0

I (5252) [LTE_DEBUG]: 24 bytes Data Received :
OK

+QMTCLOSE: 5,0

[LTE_DEBUG]MQTT_NETWORK_OPEN
[LTE_DEBUG]Command sent : AT+QMTOPEN=5,“3.7.8.183”,1883
[LTE_DEBUG]23 bytes Data Received :
OK

+QMTOPEN: 5,0

I (5961) [LTE_DEBUG]: 23 bytes Data Received :
OK

+QMTOPEN: 5,0

[LTE_DEBUG]network_flag(1) | client_flag(0) | sub_flag(0) | mqtt_connected(0)
[LTE_DEBUG]MQTT_CLIENT_DISCONN_CMD
[LTE_DEBUG]Command sent : AT+QMTDISC=5
E (6542) [LTE_ERROR]: 9 bytes of Data Received :
ERROR

[LTE_DEBUG]MQTT_CLIENT_CONN_CMD
[LTE_DEBUG]Command sent : AT+QMTCONN=5,“GWY00100/07ebf099-2d3e-451e-9f8b-0cf34838a246”,“unimaqtt”,“T5DRIIJEBgfhjsrFkaDERkgJhswMwk4”
[LTE_DEBUG]25 bytes Data Received :
OK

+QMTCONN: 5,0,0

I (7260) [LTE_DEBUG]: 25 bytes Data Received :
OK

+QMTCONN: 5,0,0

[LTE_DEBUG]network_flag(1) | client_flag(1) | sub_flag(0) | mqtt_connected(0)
[LTE_DEBUG]MQTT_SUB_CMD
[LTE_DEBUG]Command sent : AT+QMTSUB=5,2,“GWY00100/commands”,0
[LTE_DEBUG]26 bytes Data Received :
OK

+QMTSUB: 5,2,0,0

I (8022) [LTE_DEBUG]: 26 bytes Data Received :
OK

+QMTSUB: 5,2,0,0

[LTE_DEBUG]MQTT_READ_MSG_CMD
[LTE_DEBUG]Command sent : AT+QMTRECV=5
[LTE_DEBUG]6 bytes Data Received :
OK

I (8556) [LTE_DEBUG]: 6 bytes Data Received :
OK

[LTE_DEBUG]network_flag(1) | client_flag(1) | sub_flag(1) | mqtt_connected(1)
[LTE_DEBUG]MQTT_READ_MSG_CMD
[LTE_DEBUG]Command sent : AT+QMTRECV=5
[LTE_DEBUG]6 bytes Data Received :
OK

I (9138) [LTE_DEBUG]: 6 bytes Data Received :
OK

[LTE_DEBUG]network_flag(1) | client_flag(1) | sub_flag(1) | mqtt_connected(1)
[LTE_DEBUG]MQTT_READ_MSG_CMD
[LTE_DEBUG]Command sent : AT+QMTRECV=5
[LTE_DEBUG]6 bytes Data Received :
OK

I (9717) [LTE_DEBUG]: 6 bytes Data Received :
OK

[LTE_DEBUG]network_flag(1) | client_flag(1) | sub_flag(1) | mqtt_connected(1)
[LTE_DEBUG]MQTT_READ_MSG_CMD
[LTE_DEBUG]Command sent : AT+QMTRECV=5
[LTE_DEBUG]6 bytes Data Received :
OK

You may need to monitor this probabilistic event and grab the debug log

Thanks for the response. I’m trying to understand why I’m getting that error. Sure I can grab that error when it occurs, but how do I get rid of it. From this MQTT commands reference document, it seems qmtopen error code 3 means Failed to activate PDP and error code 2 means MQTT identifier is occupied.

If I get +QMTOPEN=<client_idx>,2, what should I do ?

I recommend that you use another MQTT server for cross-validation

I’ve verified with another MQTT broker too. Still the problem persists. Also, now I’m facing a different issue. I’m using the QCOM tool to send AT commands to the chip and check the response.

By using this tool, I’m able to perform AT+QMTOPEN command and almost always get a successful open response. But after that, I’m trying AT+QMTCONN for which I’m getting +CME ERROR: 58

Also, I’m getting responses like this when I run my application. Like as if there isn’t enough time provided between two successful commands. I’m using a Baud rate of 921600bps and providing a delay of 100ms to read a buffer of 800bytes. So, 100ms should be more than enough:

I (00:01:20.897) [LTE_DEBUG]: Command sent : AT+QMTOPEN=0,“IP”,1883
I (00:01:21.020) [LTE_DEBUG]: Received :
OK

I (00:01:21.021) [LTE_DEBUG]: Command sent : AT+QMTOPEN=0,“IP”,1883
I (00:01:21.143) [LTE_DEBUG]: Received :
OK

+QMTOPEN: 0,2

I (00:01:21.144) [LTE_DEBUG]: Command sent : AT+QMTCLOSE=0
I (00:01:21.267) [LTE_DEBUG]: Received :
OK

+QMTOPEN: 0,1

+QMTCLOSE: 0,0

Please provide firmware for your module

AT+QGMR