M66 with MQTT Error

Hello good day,

I want to send a message to MQTT using the M66 GSM module and receive a message from MQTT. I want to do this using the Qnavigator program and AT commands. I can send messages and make calls to the normal phone using the Q program. When I do it using SSL commands, I always get errors. The AT commands I have made are StoreCA certificate to RAM, store CC certificate to RAM and store CK certificate to RAM. Also, I get an error when I introduce the link of the MQTT program to the program. When I do these, the answer of the program is “TIMEOUT” and “ERROR”. How can I do the trade I want to do and with which MQTT broker can I do it? Do you have a sample application where I can apply this method. Thank you for your help.

QNavigator version = 1.5
Device Module = Quectel M66
Module version = 2.2

Hi,
I would like to confirm with you whether your MQTT server has SSL or not?
You can send us your detailed steps and we’ll check if there’s anything wrong.
Here is an example of an mqtts with two-way authentication connection:
//Configure MQTT session into SSL mode.
AT+QMTCFG=“SSL”,0,1,2
OK
//If SSL authentication mode is “server and client authentication”, store server root CA certificate to RAM.
AT+QSECWRITE=“RAM:cacert.pem”,1758,100
CONNECT
<Input the cacert.pem data, the size is 1758 bytes>
+QSECWRITE: 1758,384a
OK
//If SSL authentication mode is “server and client authentication”, store CC certificate to RAM.
AT+QSECWRITE=“RAM:client.pem”,1220,100
CONNECT
<Input the client.pem data, the size is 1220 bytes>
+QSECWRITE: 1220,2d53
OK
//If SSL authentication mode is “server and client authentication”, store CK certificate to RAM.
AT+QSECWRITE=“RAM:user_key.pem”,1679,100
CONNECT
<Input the user_key.pem data, the size is 1679 bytes>
+QSECWRITE: 1679,335f
OK
//Configure server root CA certificate.
AT+QSSLCFG=“cacert”,2,“RAM:cacert.pem”
OK
//Configure CC certificate.
AT+QSSLCFG=“clientcert”,2,“RAM:client.pem”
OK
GSM/GPRS/GNSS Module Series
GSM MQTT Application Note
GSM_MQTT_Application_Note 26 / 29
//Configure CK certificate.
AT+QSSLCFG=“clientkey”,2,“RAM:user_key.pem”
OK
//Configure SSL parameters.

AT+QSSLCFG=“seclevel”,2,2
OK
AT+QSSLCFG=“sslversion”,2,4
OK //SSL authentication mode: server and client authentication
//SSL authentication version

AT+QSSLCFG=“ciphersuite”,2,“0xFFFF” //Cipher suite
OK

AT+QSSLCFG=“ignorertctime”,1
OK //Ignore the time of authentication.

//Start MQTT SSL connection.
AT+QMTOPEN=0,“a1zgnxur10j8ux.iot.us-east-1.amazonaws.com”,8883
OK
+QMTOPEN: 0,0
//Connect to MQTT server.
AT+QMTCONN=0,“M35_0206”
OK
+QMTCONN: 0,0,0

Hi,

Firstly thank you for helping.

When I write command which is below, the answer of program to me, TIME OUT. I do not get to “CONNECT”.

//If SSL authentication mode is “server and client authentication”, store server root CA certificate to RAM.
AT+QSECWRITE=“RAM:cacert.pem”,1758,100
CONNECT

Hi ,

I think you have missed sending the data after connect hence you do get timeout .
Please check you are ending command with i.e. /r in C programm .

Thank you

Hi, I did not use C program, I am only use Qnavigator and I send to data with AT commands.

Hi,
If you want to upload CA certificate to RAM,It is recommended that you use other serial test tools.
You can use the tools in the link below:
https://cnquectel-my.sharepoint.com/:f:/g/personal/ae-fae_quectel_com/Ep6jJxJMH-tFuIXiHbbgJRUByvvx32osLyiozK9H8wKuLQ?e=z5MRja
Please note that:
1.What I have given you in the forum is just an example, and the server could not be connected successfully.
2.If you want to use the MQTTS functionality, you will need to set up the MQTTS server and make your own certificate files.

Thank you I will try

Hi There

I am sitting with a similar issue. I am not sure when they are asking for input if I should include the:
-----BEGIN CERTIFICATE-----
and
-----END CERTIFICATE-----

and if those characters should also be included in the length parameter.

Hope someone is able to assit

Hi Wernes_Van_Wyk:
image
These contents need to be included in the certificate.This need be included in the length of the certificate when you pass it to the module.