Hi Aaron. Thanks a lot.
I don’t get it, no matter how many hours I put in it. I am at +20 hrs now to my last post.
I checked modem time according to your suggestion, which is ok and exactly matches current time).
Below I copied an output from my device, I just don’t see what is wrong with the upload and conversion. I only can see that it does not work after successfully uploading it.
What I want to achieve is using HiveMQ over LTE with SIM card, and it is ridiculous that it is impossible to get a working example code where we all just have to enter our credentials.
I mean I just invested like 50 hours, to be exactly where I was before - only that I have a feeling that there can be about 20 culprits and I may have any combination of them.
What I can say is that I would give a f… if not using any certificates but only password and username would be working - I do not want to have high security that would justify the work of certificates.
what I am doing is a birthday present for a colleague and I want to activate it without need of wifi.
It should be simpler…
Please advise, and preferably in a way that others can also use it.
I know that the issue is me not understanding how it works, but no matter how much information I consume I can still not comprehend what is going on.
The first, more general issue:
Why do I have code that is working over WiFi (including a ca cert and all that is registered wit pubsubclient and that works with my hiveMQ account) but that does not work when connected over LTE?
I so far understood that the .pem needs to be uploaded to sim7000 so that sim7000 can handle ssl with hiveMQ, essentially using totally different certificate as my code that authenticates over wifi connection (uses .ar certificate).
Then I found conflicting information about if the .pem needs to be converted or not,
Nevertheless uploading seems successful but reading it back from or converting on sim7000 fails - which would suggest that the upload was not successful.
I assume that uploading it to “/customer/” is correct:
Using the command
AT+CFSWFILE=3,“isrgrootx1.pem”,0,1939,9000
and the following information from AT commands for sim7000:
Directory of AP filesystem:
0= “/custapp/”
1= “/fota/”
2= “/datax/”
3= “/customer/”
…which should upload the file “isrgrootx1.pem” to /customer/ (index 3) and overwrite it in case it exists (mode 0), providing its filesize (1939 bytes) and a 9000ms timeout.
Simple question:
Arduino IDE, a Sim7000 and a microcontroller like ESP8266 or ESP32.
Software/Library: pubsubclient for MQTT (already working perfectly over WiFi with HiveMQ and certs/authentification using an .ar file)
What the heck do we have to do to get the authentication from your servers also when using LTE internet connection over SIM7000?
I also tried not using pubsubclient with sim7000 but the builtin AT commands for MQTT, but again that only works for the public hiveMQ but not for my private account that needs certification.
So I got MQTT working with public and private hiveMQ over WiFi but over LTE and sim7000 only public (without certificate) works so far.
here’s some output from my device:
[…]
—> AT+CPMS=“SM”,“SM”,“SM”
<— +CPMS: 0,20,0,20,0,20
Modem is OK
Found SIM7000
—> AT+GSN
<— 111112222233333
Module IMEI: 111112222233333
—> AT+CFUN=1
<— OK
—> AT+CGDCONT=1,“IP”,“hologram”
<— OK
—> AT+CNMP=38
<— OK
—> AT+CMNB=1
<— OK
waiting 6s:
Sending to modem: WAIT=6
…
disabling GPRS first…
—> AT+CIPSHUT
<— SHUT OK
—> AT+SAPBR=0,1
<— OK
—> AT+CGATT=0
<— +APP PDP: DEACTIVE
Failed to turn off
now enabling GPRS…
turning GPRS on automatically on boot…
—> AT+CIPSHUT
<— OK
—> AT+CGATT=1
<— OK
—> AT+SAPBR=3,1,“CONTYPE”,“GPRS”
<— OK
—> AT+SAPBR=3,1,“APN”,“hologram”
<— OK
—> AT+CSTT=“hologram”
<— OK
—> AT+SAPBR=1,1
<— OK
—> AT+CIICR
<— OK
—> AT+CNACT=1,“hologram”
<— OK
<— +APP PDP: ACTIVE
GPRS turned on successfully
—> AT+CGNSPWR?
<— +CGNSPWR: 1
Turned on GPS.
+CCLK: “25/01/03,04:18:24+04”
OK
Current time retrieved from SIM7000:
25/01/03,04:18:24+04
OK
File system session activated successfully.
—> AT+CGREG?
<— +CGREG: 0,5
Network status 5: Registered roaming
Connected to cell network!
—> AT+CNACT?
<— +CNACT: 1,“100.82.143.15”
Data already enabled!
CNACT? - STATUS RESPONSE:
OK
+CNACT: 1,“100.82.143.15”
OK
Got valid IP address:
OK
+CNACT: 1,“100.82.143.15”
OK
Signal quality raw response:
+CSQ: 20,99
OK
RSSI: -73 dBm
Signal quality: 65% - Good
[…]
Certificate file found on SPIFFS: /isrgrootx1.pem
Certificate content of /isrgrootx1.pem:
-----BEGIN CERTIFICATE-----
MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw
TzELMAkGA1UEBhMCVVMxKTAn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IyBpY9umbbjANBgkq
hkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZL
ubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ
3BebYhtF8GaV0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KK
NFtY2PwByVS5uCbMiogziUwthDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5
ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7Ur
TkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdC
jNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVc
oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq
4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA
mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d
emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc=
-----END CERTIFICATE-----
Certificate size: 1939 bytes
AT+CFSWFILE=3,“isrgrootx1.pem”,0,1939,9000
DOWNLOAD
DOWNLOAD prompt received.
Uploaded 512/1939 bytes
Uploaded 1024/1939 bytes
Uploaded 1536/1939 bytes
Uploaded 1939/1939 bytes
OK
Successfully uploaded /isrgrootx1.pem from SPIFFS to SIM7000 internal memory as isrgrootx1.pem.
Converting certificate: isrgrootx1.pem…
as QUAPI_NET_SSL_CERTIFICATE_E (ssltype=1)
AT+CSSLCFG=“convert”,1,“isrgrootx1.pem”
ERROR
Timeout waiting for: OK
Partial response received:
ERROR
Failed to convert certificate: isrgrootx1.pem on SIM7000.
AT+CSSLCFG=“sslversion”,0,3
OK
SSL version set to TLS 1.2.
AT+CSSLCFG=“cipher suite”,0,0
ERROR
Timeout waiting for: OK
Partial response received:
ERROR
Failed to set cipher suite.
Reading contents of isrgrootx1.pem…
AT+CFSRFILE=3,“isrgrootx1.pem”,0,1939
ERROR
Failed to read contents of isrgrootx1.pem.
File content verification failed.
Activating client certificate: isrgrootx1.pem…
AT+CSSLCFG=“clientcert”,1,“isrgrootx1.pem”
ERROR
Timeout waiting for: OK
Partial response received:
ERROR
Failed to activate client certificate: isrgrootx1.pem.
Certificate activation failed.
AT+CSSLCFG=“sni”,1,“2bdc1234567899876543211234567890a1.s1.eu.hivemq.cloud”
OK
==== Successfully set SSL SNI ====
AT+CFSTERM\r\n
OK
File system session terminated successfully.
Waiting for 30 seconds
Setting up global MQTT client:
MQTT Connection Parameters
Client ID: Vince3-00CA7758
Server: 2bdc1234567899876543211234567890a1.s1.eu.hivemq.cloud
Port: 8883
User: testuser
Password: abcdef_donttell
################################
MQTT: Trying to connect as clientID ‘Vince3-00CA7758’ to MQTT server 2bdc1234567899876543211234567890a1.s1.eu.hivemq.cloud at Port 8883 with user ‘testuser’ and password ‘abcdef_donttell’
MQTT: Trying to connect as clientID ‘Vince3-00CA7758’ to MQTT server 2bdc1234567899876543211234567890a1.s1.eu.hivemq.cloud at Port 8883 with user ‘testuser’ and password ‘abcdef_donttell’
MQTT: Trying to connect as clientID ‘Vince3-00CA7758’ to MQTT server 2bdc1234567899876543211234567890a1.s1.eu.hivemq.cloud at Port 8883 with user ‘testuser’ and password ‘abcdef_donttell’
MQTT: Trying to connect as clientID ‘Vince3-00CA7758’ to MQTT server 2bdc1234567899876543211234567890a1.s1.eu.hivemq.cloud at Port 8883 with user ‘testuser’ and password ‘abcdef_donttell’
MQTT: Trying to connect as clientID ‘Vince3-00CA7758’ to MQTT server 2bdc1234567899876543211234567890a1.s1.eu.hivemq.cloud at Port 8883 with user ‘testuser’ and password ‘abcdef_donttell’
MQTT: Failed to connect after maximum tries.