+QMTOPEN: 0,-1 error

Hello. I have an issue with AT+QMTOPEN command. When I send it I got +QMTOPEN: 0,-1
Here is log below

[2020-02-19_15:43:38]AT

[2020-02-19_15:43:38]OK
[2020-02-19_15:43:40]AT+COPS?

[2020-02-19_15:43:40]+COPS: 0,0,“vodafone TR”,0

[2020-02-19_15:43:40]OK
[2020-02-19_15:43:43]AT+QFLST

[2020-02-19_15:43:43]+QFLST: “cert.pem”,1224
[2020-02-19_15:43:43]+QFLST: “key.pem”,1675
[2020-02-19_15:43:43]+QFLST: “root.pem”,1188

[2020-02-19_15:43:43]OK
[2020-02-19_15:43:46]AT+QMTCFG=“SSL”,0,1,2

[2020-02-19_15:43:46]OK
[2020-02-19_15:43:51]AT+QSSLCFG=“cacert”,2,“root.pem”

[2020-02-19_15:43:51]OK
[2020-02-19_15:43:53]AT+QSSLCFG=“clientcert”,2,“cert.pem”

[2020-02-19_15:43:53]OK
[2020-02-19_15:43:56]AT+QSSLCFG=“clientkey”,2,“key.pem”

[2020-02-19_15:43:56]OK
[2020-02-19_15:43:58]AT+QSSLCFG=“seclevel”,2,2

[2020-02-19_15:43:58]OK
[2020-02-19_15:44:01]AT+QSSLCFG=“sslversion”,2,4

[2020-02-19_15:44:01]OK
[2020-02-19_15:44:03]AT+QSSLCFG=“ciphersuite”,2,0xffff

[2020-02-19_15:44:03]OK
[2020-02-19_15:44:08]AT+QSSLCFG=“ignorelocaltime”,1

[2020-02-19_15:44:08]+QSSLCFG: “ignorelocaltime”,1,1

[2020-02-19_15:44:08]OK
[2020-02-19_15:44:16]AT+QMTOPEN=0,“a2u7s0al75g2nd-ats.iot.us-east-2.amazonaws.com”,8883

[2020-02-19_15:44:16]OK
[2020-02-19_15:44:24]
[2020-02-19_15:44:24]+QMTOPEN: 0,-1

Dear Sir,
Thanks for your inquiry in Quectel forum.
About your issue, please make sure the MQTT server you used is normal, you can try to change another server to have a try. And, you also can double check whether the certificate you used is correct, and whether the network is normal now. Thanks!

What do you mean for “normal”? I tried for cloudmqt and it returned same thing. When I send AT+COPS? it returns one operator . Should I choose that operator with any at command for connection? and when I send AT+CSQ It returns 22,99. Is 22 bad for connection?

Dear Sir,
I mean that whether the network of your server is normal, and other client whether can connect to server normally.
The CSQ is not bad, and it is no need to choose the operator. You can try to connect the TCP server to confirm whether the network you used is normal. Thanks!

I couldnt setup even TCP server. It gives me same error. I tried setup new aws certificates. I tried to use QNavigator. Noting fixed my problem. Can you give me full at ommand for mqtt normal or with ssl? Or Do you know any video link about it? Like tell how to set aws pem files. Mine at command set didnt work
image


I am trying to use cloud mqtt. My cloudmqtt information is below.

What should I do AT+QMTCFG=…
Must I use that At command?

Dear Sir,
Please check the following document about how to test MQTT with SSL. Hopefully it is useful to you. Thanks!
GSM MQTT AT Logs.pdf (51.5 KB)
Please note, it is just an example, the certificate file and the server address should use your’s. Thanks!

Should I add \ r at the end of lines?


like this picture before send

It is better not add such character at the lend of lines. Thanks!

I fixed the problem. Thx. I read these 3 files that in memory. Private_key wasnt correct. One “-” were missing. Thx again for helping.

Got it. Thanks for your updating. Thanks!

Hi alikemalaldogan,
I am also facing the same issue. Did you add \r at the end of line in certificate

Regards
Sivanantham A

@sivanantham if you send using with terminal via uart with At commands it, you shouldnt add . if you send from a c code you should add \r. Also check with file commands what you added. When you show text file as hex file you will see \r mean 0x0A. If you need help you can add me linkedn.
Regards
AliKemal

Hi alikemalaldogan,

Thank you for your input. I tried with \r on each line for one iteration then \n on each line for 2nd iteration and \r\n on 3rd iteration. But I ended up getting same error. I am able to see the files through FWDL command. I am using EG25G module

@sivanantham Do you work with AT commands using with a kind of terminal program? or are you trying to write a code? if you use terminal you cannot change key with add \r\n. Open your key file and try to show them as hex file. You will see 0A datas at the and of the lines. Also try file at commands to read key that you added inside of EG96. Copy keys that response of AT+QFREAD=" "(for BG96) and paste it somewhere which you can see as hex format. They should be %100 equal each other.

HI alikemalaldogan,
Thanks for the response.I am writing in C code I will Check and come back on this I was reading the Key files back using AT+QFDWL file and it looks fine

HI alikemalaldogan,
Now the issue was resolved. I was sending one of the configuration in other commands. Thanks for your comment to add \r in the certificate

Regards
Sivanantham A

No problem. I am happy to help to fix your problem.
AliKemal

HI @alikemalaldogan
I’m using the EC25 module.
But… When I tried connecting to Amazon, I also can see return message +QMTOPEN:0-1…

And I use the AT command.

Hello @Maker_i
Check certificate and keys inside of module with AT commands.
AT+QFOPEN=filename
AT+QFREAD=filename
And close it with AT+QFCLOSE=filename
these at commands should be true İf I remember it correctly . It should be wrong. You should also check end line things of keys and certificate.