AT+QMTSUB returns +QMTSTAT: 0,1

Dear All,

I am using a BC95-g module to publish some data and subscribe to a topic. When I try to subscribe, I get response +QMTSTAT: 0,1, but I just opened and connected to the net and even verified that opened correctly. Here are the commands I am using:

AT+QMTOPEN=0,<host_name>,1883
OK
+QMTOPEN: 0,0
AT+QMTCONN=0, “<clientID”>,"",""
OK
+QMTCONN: 0,0,0
AT+QMTPUB=0,0,0,0,""
OK
+QMTPUB: 0,0,0
AT+QMTDISC=0
OK
+QMTDISC: 0,0
AT+QMTOPEN=0,<host_name>,1883
OK
+QMTOPEN: 0,0
AT+QMTCONN=0, “<clientID”>,"",""
OK
+QMTCONN: 0,0,0
AT+QMTOPEN?
+QMTOPEN: 0,"<host_name>",1883
OK
AT+QMTSUB=0,1,"",0
OK
+QMTSUB: 0,1,0,0
+QMTSTAT: 0,1
AT+QMTOPEN?
OK

Every time I execute these commands, response is the same. It seems that when I write AT+QMTSUB, it somehow disconnects from server. It is all done in a much shorter period of time that keepalive, so I don’t know where the problem could come from.

Thank you in advanced!

I recommend that you debug or validate to confirm the server first using the MQtt.fx tool
mqttfx-1.7.1-windows-x64.exe

Thank you for your answer. I tried to publish and suscribe with MQtt.fx and it worked sucessfully. However, I still can’t do it with the module. Now I also receive +QMTSTAT: 0,1 when trying to publish:

AT+QMTPUB=0,0,0,0,""
OK
+QMTPUB: 0,0,0
+QMTSTAT: 0,1

The data doesn’t publish and I can’t disconnect from the broker:

AT+QMTDISC=0
+CME ERROR: 50

please execute the AT commands

at+cereg?
at+cgpaddr
at+nuestats

++MQTT process log
upload log;

Hello Herbert,

here are the commands that you suggested:

AT+CEREG?
+CEREG: 0,5
OK
AT+CGPADDR
+CGPADDR: 0,10.4.7.87
OK
AT+NUESTATS
Signal power:-784
Total power:-716
TX power:0
TX time:955
RX time:22638
Cell ID:72528445
ECL:0
SNR:111
EARFCN:6253
PCI:318
RSRQ:-108
OPERATOR MODE:3
CURRENT BAND:20
OK

I do not know how to interpret some of these values. I would be very grateful if you could tell me if there is something wrong at some point.

Thank you again.

please try again by the following AT Command

AT+QMTOPEN=0,“a160d94a68.iot-mqtts.cn-north-4.myhuaweicloud.com”,1883
AT+QMTCONN=0,“6180f215d0a1830285b86ca5_864430010001091_0_0_2021110610”,“6180f215d0a1830285b86ca5_864430010001091”,“958c3363e14ff75a12491d7499faccac9d84184fe5e267fe4537c66f7bf23bc7”

The first time I executed the program, I recieved:
+QMTOPEN: 0,0
+QMTCONN: 0,2
+QMTSTAT: 0,3

After that, I tried a second time and response was:
+QMTOPEN: 0,-1

AT+NPING=8.8.8.8

AT+QMTCFG=“aliauth”,0,“a1lF4kn5J1Y”,“BC28-CNVAA”,“c95589142af0e6bb72de8e7424835faf”
AT+QMTOPEN=0,“139.196.135.135”,1883
AT+QMTCONN=0,“BC28_TEST”

try it again!

Hello Herbert,

I was able to open and connect correctly. When trying to publish, I recieved:
+QMTPUB: 0,0,0
+QMTRECV: 0,0,"/ext/error/a1lF4kn5J1Y/BC28-CNVAA",{“code”:520,“data”:{“topic”:“c
hannels/1708139/publish/“XXX”,“productKey”:“channels”,“deviceName”:”
1708139"},“id”:“1”,“message”:“no active session for channels&1708139”}

I suppose it is due to the format of the publishing message, but it seems to work properly.

yes,The module should be working properly

Okay. Thank you very much for your help!