I am facing some issues connecting my Arduino MKR 1010 to Azure IoT Hub. So, what I did is:
- Create CA signed certificate, using ECC algorithm for signing, following this guide - https://github.com/Azure/azure-iot-sdk-c/blob/main/tools/CACertificates/CACertificateOverview.md
- Then, generated leaf certificate for my IoT Hub Device, again using the CACertificates scripts.
- I create IoT Hub where I created a device with authentication type: X509 CA Signed certificate.
- Afterwards, I created the Device Provisioning Service that is connect to the create IoT Hub.
- I added the Root certificate that was generated in the first step.
- Then, I used the following code: https://github.com/Vitomir2/Digital-Twins-Azure-IoT-Hub/blob/main/source/auth-x509-certs-arduino-sketches/authentication-x509-certificates-2/authentication-x509-certificates-2.ino
- After uploading the code on the board, it returns me: Connect Error: -2. I know this error comes from the MQTT and not exactly from the Azure.
This is in preparation to take some measurements when I've connected successfully to the IoT Hub device.