Ec200u +qmtopen: 0,5 (qmtopen -network connection error)

Hi,

I was facing QMTOPEN problem in EC200U modem with SSL connection. I had tried many things and I was checked different kind of ways and I referred with old topics as per my problem but I can’t get solution, still I can’t to establish MQTT connection. Can anyone help to resolve this issue…Thanks.

AT

OK
ATI

Quectel
EC200U
Revision: EC200UCNAAR02A09M08

OK
AT+CREG

OK
AT+CREG?

+CREG: 0,5

OK
AT+CGREG?

+CGREG: 0,5

OK
AT+CSQ

+CSQ: 18,99

OK
AT+QIACT?

+QIACT: 1,1,1,"100.91.78.11"

OK
AT+CGDCONT?

+CGDCONT: 1,"IP","airtelgprs.com","100.91.78.11",0,0

OK
AT+QFLST="UFS:*"

+QFLST: "UFS:cacert.pem",1356
+QFLST: "UFS:client.pem",1060
+QFLST: "UFS:user_key.pem",1737

OK
AT+QSSLCFG="cacert",2,"UFS:cacert.pem "

OK
AT+QSSLCFG="clientcert",2,"UFS:client.pem"

OK
AT+QSSLCFG="clientkey",2,"UFS:user_key.pem"

OK
AT+QMTCFG="recv/mode",0,0,1

OK
AT+QMTCFG="SSL",0,1,2

OK
AT+QMTCFG="version",0,4

OK
AT+QSSLCFG="seclevel",2,2

OK
AT+QSSLCFG="sslversion",2,4

OK
AT+QSSLCFG="ciphersuite",2,0xFFFF

OK
AT+QSSLCFG="ignorelocaltime",2,1

OK
AT+QMTOPEN=0,"<HOST_NAME>",8883

OK

+QMTOPEN: 0,5  // I am getting this response repeatedly





AT+QCSQ

+QCSQ: "LTE",73,-103,84,-11

OK
AT+QSPN

+QSPN: "Airtel","Airtel","airtel",0,"40494"

OK
AT+CIND=?

+CIND: ("battchg",(0-5)),("signal",(0-5)),("service",(0,1)),("sounder",(0,1)),("message",(0,1)),("call",(0,1)),("roam",(0,1)),("smsfull",(0,1))

OK
AT+CIND?

+CIND: 0,0,0,0,1,0,0,0

OK
AT+QENG="SERVINGCELL"

+QENG: "servingcell","NOCONN","LTE","TDD",404,94,9571F0A,450,39150,40,5,5,D76E,-103,-11,-72,79,20

OK

Hi,

I found that problem, For the problem in inside the length of the license file. Here license file contains multiple letters and contains many “\r\n” and we need to ignore the count of “\r\n” letters when we are calculate the string length…so I was mistaken to calculate that letters also
when I change the length of the license file after that my data was published…

Thanks ,

Hi Udhaya, Which license file are you referring to? Are you using AWS/SSL connection? I get the same problem described above by you… I tried to remove all /n/r characters from the rootca, clientcert and user_key files and updated the length… but still the problem exists… I am following the same identical steps that you have listed in the original post… Kindly let know if there are any other things I need to do to connect to AWS successfully… Thanks a ton in advance. - Sudheendran

Hi @sudheendrantl ,

I was established SSL connection. Are you get success in MQTT connection without SSL?

Hi @UdhayaKumar_Mani Thanks for your response. I am using AWS and using SSL only. Have not tried w/o SSL, as I don’t have a service that gives me username/password. Here is the complete list of commands that I am giving for the MQTT/AWS/SSL connection.

AT+QSSLCFG=“cacert”,2,"UFS:cacert.pem "
AT+QSSLCFG=“clientcert”,2,“UFS:client.pem”
AT+QSSLCFG=“clientkey”,2,“UFS:user_key.pem”
AT+QMTCFG=“recv/mode”,0,0,1
AT+QMTCFG=“SSL”,0,1,2
AT+QMTCFG=“version”,0,4
AT+QSSLCFG=“seclevel”,2,2
AT+QSSLCFG=“sslversion”,2,4
AT+QSSLCFG=“ciphersuite”,2,0xFFFF
AT+QSSLCFG=“ignorelocaltime”,2,1
AT+QMTOPEN=0,“xxxxx”,8883
AT+QMTCONN=0,“mydevice”

The QMTOPEN command fails with “0,5”

Hi @sudheendrantl ,

Are you upload the certificates, If you are done mean use file system at commands and verify the uploaded certificates are correct in the UFS system and length also I was attached manual in below.

And check the below things are cause of MQTT connectivity problem.
1.Verify internet on your sim card
2. Are you activate PDP content on your module “AT+QIACT=1”
3.Do connect with MQTT server without SSL by using thingspeak platform for the testing to ensure your module have a internet and working properly or not (Sign In - ThingSpeak IoT)
4.Ensure your module version as “EC200UCNAAR02A09M08” or above
5.Verify the uploaded certificates length
6.Ensure the uploaded certificates are in correct by using file read AT commands

Quectel_GSM_FILE_AT_Commands_Manual_V1.5.pdf (1.0 MB)

Thanks a ton for supporting, Udhaya. With some updated commands, stepping down to TLS1.2 in AWS, waiting for some time after open/before connect and using the certificates as is (with the LF characters created by AWS), I am able to open/connect and publish/subscribe to messages.

Hi @sudheendrantl ,

Are you tried previously suggested things ? Can you send full log with file read and certificate length also ?

I tried removing the LF characters as suggested by you, but that didnt work. So, I used the certificate and key files AS given by AWS itself. Here is the log during successful execution. It has answers for your other questions.

[2024-08-28_13:30:52:422]AT

[2024-08-28_13:30:52:422]OK
[2024-08-28_13:30:57:434]AT+CGREG?

[2024-08-28_13:30:57:434]+CGREG: 0,1

[2024-08-28_13:30:57:434]OK
[2024-08-28_13:31:00:952]ATI

[2024-08-28_13:31:00:952]Quectel
[2024-08-28_13:31:00:952]EC200U
[2024-08-28_13:31:00:952]Revision: EC200UCNAAR03A08M08

[2024-08-28_13:31:00:952]OK
[2024-08-28_13:31:04:977]AT+CGREG?

[2024-08-28_13:31:04:977]+CGREG: 0,1

[2024-08-28_13:31:04:977]OK
[2024-08-28_13:31:09:755]AT+QICSGP=1,1,“airtelgprs.com”,“”,“”,1

[2024-08-28_13:31:09:755]OK
[2024-08-28_13:31:12:710]AT+QIACT=1

[2024-08-28_13:31:12:710]OK
[2024-08-28_13:31:15:866]AT+QIACT?

[2024-08-28_13:31:15:866]+QIACT: 1,1,1,“100.87.53.157”

[2024-08-28_13:31:15:866]OK
[2024-08-28_13:31:20:343]AT+QMTCFG=“SSL”,0,1,2

[2024-08-28_13:31:20:343]OK
[2024-08-28_13:31:23:945]AT+QMTCFG=“recv/mode”,0,0,1

[2024-08-28_13:31:23:945]OK
[2024-08-28_13:31:29:430]AT+QFDEL=“cacert.pem”

[2024-08-28_13:31:29:446]OK
[2024-08-28_13:31:32:497]AT+QFDEL=“client.pem”

[2024-08-28_13:31:32:497]+CME ERROR: 418
[2024-08-28_13:31:35:559]AT+QFDEL=“user_key.pem”

[2024-08-28_13:31:35:559]+CME ERROR: 418
[2024-08-28_13:31:42:773]AT+QFUPL=“cacert.pem”,1187,100

[2024-08-28_13:31:42:773]CONNECT
[2024-08-28_13:31:50:193]+QFUPL: 1187,2d19

[2024-08-28_13:31:50:193]OK
[2024-08-28_13:32:13:372]AT+QFUPL=“client.pem”,1220,100

[2024-08-28_13:32:13:372]CONNECT
[2024-08-28_13:32:16:282]+QFUPL: 1220,6737

[2024-08-28_13:32:16:282]OK
[2024-08-28_13:32:36:215]AT+QFUPL=“user_key.pem”,1675,100

[2024-08-28_13:32:36:215]CONNECT
[2024-08-28_13:32:37:597]+QFUPL: 1675,0137

[2024-08-28_13:32:37:597]OK
[2024-08-28_13:32:47:808]AT+QSSLCFG=“cacert”,2,“UFS:cacert.pem”

[2024-08-28_13:32:47:808]OK
[2024-08-28_13:32:51:181]AT+QSSLCFG=“clientcert”,2,“UFS:client.pem”

[2024-08-28_13:32:51:181]OK
[2024-08-28_13:32:54:652]AT+QSSLCFG=“clientkey”,2,“UFS:user_key.pem”

[2024-08-28_13:32:54:652]OK
[2024-08-28_13:32:58:298]AT+QSSLCFG=“seclevel”,2,2

[2024-08-28_13:32:58:298]OK
[2024-08-28_13:33:01:188]AT+QSSLCFG=“sslversion”,2,4

[2024-08-28_13:33:01:188]OK
[2024-08-28_13:33:04:641]AT+QSSLCFG=“ciphersuite”,2,0xFFFF

[2024-08-28_13:33:04:641]OK
[2024-08-28_13:33:07:270]AT+QSSLCFG=“ignorelocaltime”,2,1

[2024-08-28_13:33:07:270]OK
[2024-08-28_13:33:10:618]AT+QMTOPEN=0,“xxxx”,8883

[2024-08-28_13:33:10:618]OK
[2024-08-28_13:33:11:985]
[2024-08-28_13:33:11:985]+QMTOPEN: 0,0
[2024-08-28_13:33:24:585]AT+QMTCONN=0,“mydevice”

[2024-08-28_13:33:24:585]OK
[2024-08-28_13:33:24:899]
[2024-08-28_13:33:24:899]+QMTCONN: 0,0,0
[2024-08-28_13:33:37:585]AT+QMTSUB=0,1,“test”,1

[2024-08-28_13:33:37:585]OK
[2024-08-28_13:33:38:103]
[2024-08-28_13:33:38:103]+QMTSUB: 0,1,0,1
[2024-08-28_13:33:43:288]AT+QMTPUB=0,1,1,0,“test”

[2024-08-28_13:33:43:288]> {“message”:“Hello from device”}
[2024-08-28_13:34:11:100]
[2024-08-28_13:34:11:100]OK
[2024-08-28_13:34:11:398]
[2024-08-28_13:34:11:398]+QMTPUB: 0,1,0

[2024-08-28_13:34:11:398]+QMTRECV: 0,1,“test”,33,“{“message”:“Hello from device”}
[2024-08-28_13:34:11:398]”
[2024-08-28_13:34:30:345]
[2024-08-28_13:34:30:345]+QMTRECV: 0,0,“test”,45,“{
[2024-08-28_13:34:30:345] “message”: “Hello from AWS IoT console”
[2024-08-28_13:34:30:345]}”