botletics / SIM7000-LTE-Shield

Botletics SIM7000 LTE CAT-M1/NB-IoT Shield for Arduino
https://www.botletics.com/products/sim7000-shield
GNU General Public License v3.0
478 stars 216 forks source link

Amazon AWS MQTTs Connection Issue #328

Closed Gruzzberry closed 6 months ago

Gruzzberry commented 7 months ago

I seem to have gotten an issue with trying to connect to the Amazon AWS MQTT server. I have follows the commands exactly but get the same error as shown at the bottom. I believe the issue has come from the certificate, CA and key files. When uploading the originals they would not be accepted (AT+CSSLCFG=convert,1 and 2). After seeing a post about it being an issue with the newline characters (0A) in hex, I removed these and reuploaded the files as one line which got accepted.

However the connection has not being accepted. To test I used MQTTX using the same configurations I was easily able to connect. I have tried different configurations in regards to the MQTT packet settings (QoS, Will Message etc). I'm just wondering if me removing these characters would cause them to be invalid as trying the edited files on MQTTX resulted in a CONNECTION REFUSED. The connection isn't immediately refused it seems to timeout, any help at all will be accepted as been a long time issue.

AT+CPIN? +CPIN: READY

OK AT+CSQ +CSQ: 12,99

OK AT+CGREG? +CGREG: 0,1

OK AT+COPS? +COPS: 0,0,"vodafone UK",3

OK AT+CGNAPN +CGNAPN: 0,""

OK AT+CNACT=1,"pp.vodafone.co.uk" OK

+APP PDP: ACTIVE AT+CGDCONT=1,"IP","pp.vodafone.co.uk" OK

AT+CNACT? +CNACT: 1,"10.120.184.34"

OK

at+csslcfg=convert,2,CA1edit.pem OK

AT+CSSLCFG="convert",1,"certificateedit.crt","privateedit.key" OK

AT+CSSLCFG="sslversion",0,3 OK

AT+SMSSL=1,CA1edit.pem,certificateedit.crt OK

AT+SMCONF="URL","XXXXXXXXXXXX-ats.iot.eu-west-2.amazonaws.com",8883 OK

AT+SMCONF="CLIENTID","Tracker" OK

AT+SMCONF="KEEPTIME",60 OK

AT+CCLK? +CCLK: "24/03/08,17:14:29+00"

OK

AT+SMCONN +CME ERROR: operation not allowed

Gruzzberry commented 7 months ago

Update, using a different tool (EFS Explorer), I was able to get the original CA, key and crt file on the device which is now being accepted however I am still unable to make a connection as I get +CME ERROR: operation not allowed

Mark-Wills commented 7 months ago

I think it's time that someone with the appropriate knowledge made a step by step YouTube video on how to get certificates onto the modem and then communicate with MQTT servers, web servers etc as we see this same issue come up multiple times and it's nothing to do with the botletics board, or the library.

Can anyone step forward for the sake of humanity? 😀

On Sun, 10 Mar 2024, 14:12 Gruzzberry, @.***> wrote:

Update, using a different tool (EFS Explorer), I was able to get the original CA, key and crt file on the device which is now being accepted however I am still unable to make a connection as I get +CME ERROR: operation not allowed

— Reply to this email directly, view it on GitHub https://github.com/botletics/SIM7000-LTE-Shield/issues/328#issuecomment-1987247104, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFAGDCQFJUJ5GALER4JAIEDYXRS6TAVCNFSM6AAAAABENH5MXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBXGI2DOMJQGQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Gruzzberry commented 6 months ago

I've seen a few tutorials, @botletics did do one with MQTT here: https://www.youtube.com/watch?v=h8aX3EnNHpw&t=1199s however this was 6 years ago so there have been changes and it doesn't focus on MQTTs. I've managed to get to this point but have an error 11 which means "Connect failed error" so not to much to help me debug this.

AT+CFUN=1,1 OK

RDY

+CFUN: 1

+CPIN: READY

SMS Ready AT+CNMP=13 OK AT+CMNB=1 OK AT+CSTT="pp.vodafone.co.uk","wap","wap" OK AT+CGATT=1 OK AT+CSSLCFG="sslversion",1,3 OK AT+CSSLCFG="sni",1,"XXXXXXXXXXXXXXXXXXX.iot.eu-west-2.amazonaws.com" OK AT+CSSLCFG="protocol",1,1 OK AT+CSSLCFG="convert",1,"cert.crt","private.key" OK AT+CSSLCFG="convert",2,"amz.pem" OK AT+CSSLCFG="protocol",1,1 OK AT+CACID=1 OK AT+CASSLCFG=1,"cacert","amz.pem" OK AT+CASSLCFG=1,"crindex",1 OK AT+CASSLCFG=1,"ssl",1 OK AT+CASSLCFG=1,"protocol",0 OK AT+CCLK? +CCLK: "80/01/07,00:19:17+00"

OK AT+CCLK="24/03/12,19:41:49+00" OK AT+SMCONF="MESSAGE","hello" OK AT+SMCONF="RETAIN",0 OK AT+SMCONF="TOPIC","test" OK AT+SMCONF="QOS",0 OK AT+SMCONF="CLEANSS",0 OK AT+SMCONF="URL","XXXXXXXXXXXXXXXXXXXX.iot.eu-west-2.amazonaws.com",8883 OK AT+SMCONF="KEEPTIME",60 OK AT+SMCONF="CLIENTID","Tracker" OK AT+SMSSL=1,amz.pem,cert.crt OK AT+CNACT=1,pp.vodafone.co.uk OK

+APP PDP: ACTIVE

AT+CNACT? +CNACT: 1,"XX.XXX.XXX.XX"

OK AT+CAOPEN=1,"XXXXXXXXXXXXXXX.iot.eu-west-2.amazonaws.com",8883 +CAOPEN: 1,11

Gruzzberry commented 6 months ago

So after a month long conversation with SimCom and Qualcomm they found that I was getting a fatal error. They made a beta version firmware which will allow me to connect but has seemingly broken GPS now.