Connecting Arduino uno rev2 with IoT central application

70 views Asked by At

I am following this git repo to establish a connection between Arduino Rev2 with a wifi chip and the Azure IoT central application https://github.com/firedog1024/arduino-uno-wifi-iotc

I am having difficulty establishing a connection and obtaining a connection string at the configuration step where I am required to provide scope id, device id, and primary key. I have obtained all of those values from a device I have created in the IoT central application. I received the following error message after entering these values.

.Error: Time:Fri Nov 10 19:54:33 2023 File:/Users/gonzo/Github/azure-iot-sdk-c/provisioning_client/src/prov_device_ll_client.c Func:prov_transport_process_json_reply Line:300 failure retrieving json auth key value Error: Time:Fri Nov 10 19:54:33 2023 File:/Users/gonzo/Github/azure-iot-sdk-c/provisioning_client/src/prov_transport_mqtt_common.c Func:prov_transport_common_mqtt_dowork Line:944 Unable to process registration reply. Error: Time:Fri Nov 10 19:54:33 2023 File:/Users/gonzo/Github/azure-iot-sdk-c/provisioning_client/src/prov_device_ll_client.c Func:on_transport_registration_data Line:510 Failure retrieving data from the provisioning service Failure encountered on registration PROV_DEVICE_RESULT_PARSING error: registration failed!

Could someone guide me in the right direction? Thank you

I have tried using Chat GPT to find a work around but it did not work.

It should give a connection string at the end so that it can be used in the configuration file.

1

There are 1 answers

1
LeelaRajesh_Sayana On

The approach you are trying uses repository Azure IoT DPS Symmetric Key Generator for generating the connection string. The tool responsible for fetching the connection string has deprecated a long time back as mentioned in the repository. Please find the below statement.

User's image

The only functionality available in the tool is the ability to generate individual device keys from your IoT Central applications group SAS key. This is the reason why the code sample fails to fetch the connection string.

I have found an alternative approach in the EPS8266 samples which uses Azure IoT SDK C to establish the connection with IoT Central using the same parameters without relying on the connection string. You can find the underlying implementation for the connection process in the file iotc.cpp. Since this sample is built for Arduino and using Azure SDK for C, I believe this can be extended to Arduino Uno as well.

You may want to refer Azure Arduino for C SDK samples and see how you can use and embed the SDK library into the device using Arduino IDE.