Hello.
I am using the BX3105 module with firmware version 2.7.2.
I’m trying to use MQTT as TLS in IoT Hub in Microsoft Azure.
- I know I can add root, local and private certificates to a module with AT+KCERTSTORE and AT+KPRIVKSTORE commands.
- And I generated a test certificate with the manual of Microsoft Azure Docs.
(Tutorial - Use Microsoft scripts to create x.509 test certificates for Azure IoT Hub | Microsoft Docs) - I also confirmed that the pfx certificate works normally with the ‘Certificate Authentication Test’ document. A message was detected in IoT Hub. So, the certificate generation seems to be normal.
(Tutorial - Test ability of X.509 certificates to authenticate devices to an Azure IoT Hub | Microsoft Docs) - The device was created in the CertificateAuthority authentication format.
- The following certificate file has been created.
*N_Device_CACerts_1.pfx
*N_Device_CACerts_1-all.pem
*N_Device_CACerts_1-private.pem
*N_Device_CACerts_1-public.pem
*RootCA.cer
*RootCA.pem
*Intermediate1.pem
*Intermediate2.pem
*Intermediate3.pem
Question 1. What should I put in my local certificate?
‘RootCA.cer’ is registered for the root certificate, and ‘N_Device_CACerts_1-private.pem’ is registered for the private certificate. I tried putting ‘N_Device_CACerts_1-public.pem’ as the local certificate, and everything was OK, but it seems that the connection is not normal.
Question 2. Is the MQTT connection command below correct?
AT+KMQTTCFG=1,“AABBCCDD.azure-devices.net”,8883,4,“N_Device_CACerts_1”
or
AT+KMQTTCFG=1,“AABBCCDD.azure-devices.net”,8883,4,“N_Device_CACerts_1”,60,1,1,“devices/N_Device_CACerts_1/messages/%02F”,“off”,0,1,“AABBCCDD.azure-devices.net/N_Device_CACerts_1/Fapi-version=2021-04-12","”
(AABBCCDD is my iot hub name)
No matter how hard I try
+KMQTT_IND: 1,6
+KMQTT_IND: 1,0
is returned.
Help.
Thanks in advance for your reply.