Issues trying to connect Quectel MC90 to AWS via MQTT

Hello,

I am facing some issues trying to connect an MC90 module to AWS. When I try to open the connection with QMTOPEN it returns: -1 Failed to open network.

I have followed the GSM MQTT Application Note v1.3 but it seems that there is a step I’m not doing properly. I double ckecked that the APN, IP address, user, pass… are correct. I have also used some commands from the MC60&MC90 AT Commands Manual. In the SIM provider’s website I can see that there is data being transmitted and received. I am also able to make a ping. Because of this I think that maybe the problem is with the certificates or with how I try to connect to AWS. As consequence, I have tested different configurations and diferent certificates, but they don’t work neither. At this point I’m not sure how to continue. Some suggestion or idea is appreciated.

Below you can find attached the log. Thanks in advance. BR.

ATI

Quectel_Ltd
Quectel_MC90
Revision: MC90CAR01A04

OK

Call Ready

SMS Ready
AT+QSSLCFG="ctxindex",2

OK
AT+COPS=0

OK
ATE1

OK
AT+CMEE=2

OK
AT+CPIN?

+CPIN: READY

OK
AT+CREG?

+CREG: 0,5

OK
AT+CGATT=1

OK
AT+CGATT?

+CGATT: 1

OK
AT+QIREGAPP="*apn*","*user*","*pass*"

OK
AT+QICSGP=1,"*apn*","*user*","*pass*"

OK
AT+CGDCONT=1,"IP","*apn*","*ip*"

OK
AT+CGDCONT?

+CGDCONT: 1,"IP","*apn*","*ip*",0,0

+CGDCONT: 2,"IP","","",0,0

+CGDCONT: 3,"IP","","",0,0

OK
AT+CGREG?

+CGREG: 0,5

OK
AT+CGACT=1
 AT+CGACT?

+CGACT: 1,0

+CGACT: 2,0

+CGACT: 3,0

OK
AT+QISTAT

OK

STATE: IP START
AT+QMTCFG="SSL",0,1,2

OK
AT+QSECWRITE="RAM:cacert.pem",1187,100

CONNECT

+QSECWRITE: 1187,3900

OK
AT+QSECWRITE="RAM:client.pem",1220,100

CONNECT

+QSECWRITE: 1220,3019

OK
AT+QSECWRITE="RAM:user_key.pem",1679,100

CONNECT

+QSECWRITE: 1679,2511

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

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

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

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

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

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

OK
AT+QSSLCFG="ignorertctime",1

OK
AT+QSSLCFG="ctxindex",2

+QSSLCFG: 2,4,2,"0X0005,0X0004,0X0035,0X002F,0X003D,0X000A","RAM:cacert.pem","RAM:client.pem","RAM:user_key.pem"

OK
AT+CGACT=1,1

OK
AT+QIACT
 AT+QMTOPEN=0,"**********.amazonaws.com",8883

OK

+QMTOPEN: 0,-1

+PDP DEACT
AT+QMTOPEN?

OK
AT+QNSTATUS

+QNSTATUS: 0

OK
AT+QISTAT

OK

STATE: PDP DEACT
AT+QNSTATUS

+QNSTATUS: 0

OK
AT+CREG?

+CREG: 0,5

OK
AT+QMTCONN=0,"gsm_test"

+CME ERROR: invalid parameter

Hi,I suggest you change the URL in double quotes to an ip domain name:
AT+QMTOPEN=0,“**********.amazonaws.com”,8883

Hello @vincent.ding-Q

I have tested your suggestion and the result is the same.

Is this firmware version compatible with MQTT commands? (MC90CAR01A04) Or should I update it? In this case could you give me further support?

I also noticed some issues with AT+CGACT=1,2 command.
It returns +CME ERROR: unknown error.
I have tested different contexts and the result is the same.

Regards

112.31.84.164:8306
This is our non-certificate MQTT server, I suggest you test it

Hi,

The AT+CGACT issue was solved.

@herbert.pan-Q I have tested the code succesfully with your MQTT server:
image

Because of this, I think that the reason it doesn`t work with the AWS server may be the certificates. I have checked that my certificates work with MQTT.fx tool. So maybe I’m writing them incorrectly. This is the sequence:


My SSL cfg is the following:

Yes, I also think it’s the certificate. Please check it carefully