M66 MQTT demo code

Hi,

I have successfully connected M66 to AWS cloud using MQTT AT commands with QCOMM.
Now i need to develop application in openCPU sdk. I have recieved mqtt library from FAE, Is there any example code for connecting M66 to AWS cloud?
Please share me if there is any mqtt demo code.

Thanks,
Sirisha

Dear Sirisha,
Thanks for your inquiry in Quectel forum.
You can just modify the example code to support AWS cloud. Thanks!

Dear Sir,
You can check the following link. Hopefully it is useful to you. Thanks!
https://cnquectel-my.sharepoint.com/:u:/g/personal/asean-fae_quectel_com/EdP5lXWKEcNJslDtnCrR29oBHo8FJm0Ch3mpgnh1xJOHcg?e=AgECDc

Hi sir. Please share document for mqtt

Hey,
Could you please share the example MQTT code for M66 module(OpenCPU)

Regards,
Suraj

@Grey.Tu-Q Could you help on this issue?Thank you in advance.

I cannot access this document, it is no longer available.??

@Suraj_Hebbar
please get MQTT example from below link
https://cnquectel-my.sharepoint.com/:u:/g/personal/india-fae_quectel_com/EQDRByaRx8pNvcsYbDY29ywB45NAri2voO2el7eLPCyluw?e=ToHc5P

@Winnie.Xi-Q We have an MQTT connection example in our SDK development kit, so just follow this example.

Hi Rahul,
Got a response from @Grey.Tu-Q that it is not possible to use MQTT commands upfront with M66 module(M66FA-04-STDN). Rather, MQTT can be implemented on using existing TCP stack.
FYI, here is the link to the post

I have a query:
I just wanted to confirm, does the MQTT example code-shared by you is supported for the model M66FA-04-STDN chip? As we are running on a tight product deadline, we want to be assured if MQTT can actually be implemented on M66FA-04-STDN or should we look for a different chip?

PS: We will be using the opencpu environment of M66.

Regards,
Suraj

what is current f/w version of module.
Yes you can use shared code with M66.

Hi Rahul,
As I would be writing codes in the Elipse IDE for opencpu provided by Quectel, how do I get the firmware version?
Which firmware are you referring to? Could you please help me get some clarity?

I have a prebuilt bin file that spits the AT command responses on the UART port, are you referring to FW version of this bin file?

Regards,
Suraj

Hi Rahul,
Can you please let us know the procedure for calucalating the length of certificate files.
Should we include the “begin certificate” and “end certifacte” while calucating the length?
If you have any document that could help us get insights about calculating length ? It would be very helpful if you can respond soon

Hi Rahul,
I am using the sample code you provided to connect to azure iot hub. I am getting error in establishing ssl connection to azure .I think the error is due to incorrect parsing of CA file . i am attaching the CA cert pem, client cert pem , clientkey pem , main file and Qcom output can you suggest why the error is happening.

https://drive.google.com/drive/folders/14T2MGaBuPCDK33i-BOur0XBPCAESn0cR?usp=sharing

Thanks Atheerth

Hi Rahul,

Following is the response, that we we obtained on M66FA-04-STDN. We used the same the example code that was shared by you.
We are having trouble establishing connection to Azure cloud. Please respond
We are facing issue with this AT command below:
– Send AT:AT+QMTCFG=“SSL”,0,1,2, ret = -1 -->

Following is complete log.
<Network State:cgreg = 5
//<Set PDP context 0
//<Set APN
//<Activate PDP context,ret = 0
<-- Send AT:AT+QSECDEL=“NVRAM:CA0”, ret = -1 -->
<//There is no certificate plz write certificate
certificate write
CONNECT

certificate write
+QSECWRITE: 1282,2835

certificate write
OK

<-- Send AT:AT+QSECWRITE=“NVRAM:CA0”,1282,100, ret = 0 -->
certificate write
CONNECT

certificate write
+QSECWRITE: 1230,44e

certificate write
OK

<-- Send AT:AT+QSECWRITE=“NVRAM:CC0”,1230,100, ret = 0 -->
certificate write
CONNECT

certificate write
+QSECWRITE: 1702,4633

certificate write
OK

<-- Send AT:AT+QSECWRITE=“NVRAM:CK0”,1702,100, ret = 0 -->
<-- Set SSL CERTIFICATE, ret=0 -->
<//Send AT:AT+QSSLCFG=“cacert”,2,“NVRAM:CA0”, ret = 0 -->
<-- Send AT:AT+QSSLCFG=“clientcert”,2,“NVRAM:CC0”, ret = 0 -->
<-- Send AT:AT+QSSLCFG=“clientkey”,2,“NVRAM:CK0”, ret = 0 -->
<-- Set SSL CERTIFICATE cofigure, ret=0 -->
<-- Send AT:AT+QMTCFG=“SSL”,0,1,2, ret = -1 -->
<-- Set SSL CERTIFICATE cofigure, ret=-1 -->
<-- Set SSL CERTIFICATE cofigure ERROR, ret=-1 -->

Hi ,
Could you please tell me the software version of your module?(Please use ATI to check)

Hi,
we are using M66FAR01A12BT.

Hi Atheerthn:
M66FAR01A12BT does not support MQTT.You can upgrade the firmware.I will communicate with you through email. Please check the email.