Cannot connect Arduino MKR 1010 WiFi to Azure IoT Hub via X509 CA Signed certificate

Viewed 63

I am facing some issues connecting my Arduino MKR 1010 to Azure IoT Hub. So, what I did is:

  1. 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
  2. Then, generated leaf certificate for my IoT Hub Device, again using the CACertificates scripts.
  3. I create IoT Hub where I created a device with authentication type: X509 CA Signed certificate.
  4. Afterwards, I created the Device Provisioning Service that is connect to the create IoT Hub.
  5. I added the Root certificate that was generated in the first step.
  6. 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
  7. 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.

0 Answers
Related