Unable to connect to MQTT broker and server returns QMTOPEN: 0, -1 in BC68 module

HI all,
I am using BC68 module and trying to publish message using MQTT. I have tried the AT commad flow as mentioned in the MQTT manual. When I tried to connect to the broker, server returns QMTOPEN: 0,-1 after 10 minutes. I have tried several ways but unable to solve the issue. What may be the issue?

08:07:03.226 → ati
08:07:03.226 → Quectel
08:07:03.226 → BC68
08:07:03.226 → Revision:BC68JAR01A08
08:07:03.273 →
08:07:03.273 → OK
08:07:10.764 → at+cfun?
08:07:10.764 → +CFUN:1
08:07:10.764 →
08:07:10.764 → OK
08:07:15.232 → at+cgatt?
08:07:15.232 → +CGATT:1
08:07:15.232 →
08:07:15.232 → OK
08:07:21.274 → at+cereg?
08:07:21.319 → +CEREG:0,1
08:07:21.319 →
08:07:21.319 → OK
08:08:33.443 → at+csq
08:08:33.443 → +CSQ:24,99
08:08:33.489 →
08:08:33.489 → OK
08:08:36.194 → AT+QREGSWT=2
08:08:36.194 → OK
08:20:13.251 → AT+CGDCONT?
08:20:13.251 → +CGDCONT:0,“IP”,“nbiot”,0,0,0
08:20:13.297 →
08:20:13.297 → OK
08:20:26.511 → at+cops?
08:20:26.511 → +COPS:0,2,“41301”
08:20:26.511 →
08:20:26.511 → OK

08:09:41.748 → AT+QMTOPEN=0,“test.mosquitto.org”,1883
08:09:41.796 → OK
**08:19:41.726 → **
08:19:41.726 → +QMTOPEN: 0,-1

Thank you in advance.

please try to execute in order

AT+QIDNSCFG=8.8.8.8,8.8.4.4
AT+QMTOPEN=0,“test.mosquitto.org”,1883

Thank you for your reply,
09:28:01.074 → AT+QIDNSCFG=8.8.8.8,8.8.4.4
09:28:01.124 → OK
09:28:09.314 → AT+QMTOPEN=0,“test.mosquitto.org”,1883
09:28:09.361 → OK
09:28:09.455 →
09:28:09.455 → +QMTOPEN: 0,-1

Here reply seems fast but I couldn’t connect to the broker and still receive +QMTOPEN:0, -1.

Thank you.

I suggest you change the domain name to the corresponding IP address and try again

Yeah when I changed the domain name to IP, it successfully open the connection. After 20 s it returns +QMTSTAT: 0,1. Within 20s if I connect a client to MQTT server, it replies +QMTCONN: 0,2 and +QMTSTAT: 0,3.

10:32:45.317 → at+qmtopen=0,xx.xx.xxx.xxx,1883
10:32:45.317 → OK
10:32:45.357 →
10:32:45.357 → +QMTOPEN: 0,0
10:32:47.678 → AT+QMTCONN=0,“S1_t”
10:32:47.678 → OK
10:32:57.795 →
10:32:57.795 → +QMTCONN: 0,2
10:32:57.915 →
10:32:57.915 → +QMTSTAT: 0,3

What may be the issue?

After you execute AT+QMTOPEN to enable THE MQTT protocol stack, you need to complete the connection within 10 seconds by executing AT+QMTCONN, otherwise the protocol stack considers that the MQTT protocol stack times out and disconnects from the protocol stack, as shown in the following figure