Open AltayAtaman opened 1 month ago
The following fields are missing: Description, Steps to Reproduce, Expected Behavior, Actual Behavior, Environment, IDE. Please update the issue with this information.
I also tried to make it work with AT commands. Connecting to public brokers did work with following commands:
RDY
+CPIN: READY
SMS DONE
PB DONE
AT+CMQTTSTART
+CMQTTSTART: 0
AT+CCERTDOWN="ca_cert.pem",1358
>-----BEGIN CERTIFICATE-----
<certificate here, multiple lines>
-----END CERTIFICATE-----
OK
AT+CSSLCFG="sslversion",0,4
OK
AT+CSSLCFG="authmode",0,1
OK
AT+CSSLCFG="cacert",0,"ca_cert.pem"
OK
AT+CMQTTSSLCFG=0,0
OK
AT+CMQTTREL=0
OK
AT+CMQTTACCQ=0,"Sim7600_fa7d2288",1
OK
AT+CMQTTCONNECT=0,"tcp://broker.emqx.io:8883",60,1
OK
+CMQTTCONNECT: 0,0
But when I try to connecting it to Azure IoT Hub via AT commands, it doesn't connect instead gives +CMQTTCONNECT: 0,32 which is "handshake fail" according to the SIM7600 AT Command Manual.
RDY
+CPIN: READY
SMS DONE
PB DONE
AT+CSSLCFG="sslversion",0,4
OK
AT+CSSLCFG="authmode",0,1
OK
AT+CSSLCFG="ignorelocaltime", 0, 1
OK
AT+CSSLCFG="ciphersuites", 0, 0xFFFF
OK
AT+CSSLCFG="cacert",0,"my_cert.pem"
OK
AT+CSSLCFG="enableSNI", 0, 1
OK
AT+CMQTTSTART
+CMQTTSTART: 0
OK
AT+CMQTTSSLCFG=0,0
OK
AT+CMQTTREL=0
OK
AT+CMQTTACCQ=0,"device_002",1
OK
AT+CMQTTCONNECT=0,"tcp://<my_broker>-devices.net:8883", 60, 1, "<my_broker>.azure-devices.net/device_002/?api-version=2021-04-12", "SharedAccessSignature sr=<my_broker>-devices.net%2Fdevices%2Fdevice_002&sig=********iS=********ZT=********Di********17246=********8"
OK
+CMQTTCONNECT: 0,32
Description: I'm trying to connect my SIM7600 to Azure IoT over cellular and secure connection is needed for establishing connection with Azure IoT. Because of this requirement I'm trying to use this library to add a secure layer. But I was not able to even make example code work with public broker provided in the example. I only changed the GSM initialization part to make it compatible with my SIM7600G but the code is not working. It's giving "Attempting MQTT connection...[147598] ### Unhandled: +CIPCLOSE: 0,0 failed, rc=-2...try again in 15 seconds" as error.
I have seen the other topic opened up which might have exactly the same issue but the GSM used in that project is different the mine and the solution provided (which is changing the certificate as far as I understood) didn't work for me.
Steps to Reproduce: Connect ESP32 to SIM7600 and upload the following code:
Expected Behavior: Establishing a secure connection to the broker.
Actual Behavior: Connection can't be achieved and following output is produced:
Environment, IDE: Arduino IDE 2.3.2 with esp32 3.0.0 package (switched to 3.0.0 to solve a problem)
Any help would be really appreciated, I'm stuck at connecting my SIM7600G to the Azure IoT for days. And if I manage to make this example work and then make Azure IoT work with this library a huge weight will be lifted on my back.
Note: Been changing the code to try many things so if you see minor "strange" things in the code it's probably a leftover from these tries.