Hello,
We are testing the MQTT on EC200T, rev EC200TCNDAR02A15M16, for a customer design and we have some errors when doing basic test on port 1883 (so no SSL) the authentification is disabled, the broker works fine (tested with MQTT.fx as client).
Here is the commands sent :
void lte_connect(void){
send_cmd("ATE0","OK",12);
send_cmd("AT+CMEE=2","OK",12);// verbose error reporting
send_cmd("ATI","OK",12);
send_cmd("AT+CPIN?","OK",12);
send_cmd("AT+CSQ","OK",12); //RSSI 2:-109dBm to 30:-53dBm
send_cmd("AT+CREG?","OK",12);
send_cmd("AT+CGREG?","OK",12);
send_cmd("AT+QICSGP=1","OK",12);
send_cmd("AT+QICSGP=1,1,\"mobiledata\","","",1","OK",12);
}
void lte_mqtt(void){
send_cmd("ATI","OK",12);
send_cmd("AT+CSQ","OK",12); //RSSI 2:-109dBm to 30:-53dBm
send_cmd("AT+CREG?","OK",12);
send_cmd("AT+QMTCFG=\"recv/mode\",0,0,1","OK",12); //Configure receiving mode
send_cmd("AT+QMTOPEN=0,\"test.mosquitto.org\",1883","+QMTOPEN: 0,2",35); //Open a network for MQTT client.
send_cmd("AT+QMTOPEN?\",\"+QMTOPEN: 0","\"test.mosquitto.org\",1883",35);
send_cmd("AT+QMTCONN=?","OK",35);
send_cmd("AT+QMTCONN=0,a82a8a289ec649599548070bda5930cf","+QMTCONN: 0,0,0",35);
send_cmd("AT+QMTSUB=?AT+QMTSUB=?","OK",12); //list topics
send_cmd("AT+QMTSUB=0,1,\"BS_CF01\",2","+QMTSUB: 0,1,0,2",12); //Subscribe to topic.
}
Here is the log of lte_mqtt() (lte_connect() is not shown because it is already connected) :
ATI
Quectel
EC200T
Revision: EC200TCNDAR02A15M16
OK
AT+CSQ
+CSQ: 16,99
OK
AT+CREG?
+CREG: 0,5
OK
AT+QMTCFG="recv/mode",0,0,1
ERROR
AT+QMTOPEN=0,"test.mosquitto.org",1883
OK
+QMTOPEN: 0,2
AT+QMTOPEN?","+QMTOPEN: 0
+QMTOPEN: 0,"test.mosquitto.org",1883
AT+QMTCONN=?
OK
AT+QMTCONN=0,a82a8a289ec649599548070bda5930cf
+QMTCONN: (0-5),"clientid","username","password"
OK
ERROR
AT+QMTSUB=?AT+QMTSUB=?
+QMTSUB: (0-5), <msgid>,list of ["topic",qos]
OK
AT+QMTSUB=0,1,"BS_CF01",2
ERROR
As clearly shown on the log there is two problems, first AT+QMTCFG=“recv/mode”,0,0,1 returns a non verbose error, second AT+QMTCONN=0,a82a8a289ec649599548070bda5930cf returns OK and then ERROR. I precise that the broker has no username and password, there is only an ID as used in commands.
Could you please point out what is wrong and provide a full AT command example for connection and subscription to MQTT topic?
N.B. we tested with and without quotes around the client ID, changes nothing.
Also we would need the lastest AT command English document for EC200T, the one we have seems quite old (V1.1 2019).
Thank you.