Azure / azure-iot-sdk-c

A C99 SDK for connecting devices to Microsoft Azure IoT services
https://azure.github.io/azure-iot-sdk-c
Other
587 stars 739 forks source link

Unable to Register the Device with DPS #2492

Closed sayajiraow closed 1 year ago

sayajiraow commented 1 year ago

Hello, Using azure-iot-sdk-c I have implemented a client application. This Application first registers the device with DPS using the method Prov_Device_Register_Device(); I am using global_prov_uri= "global.azure-devices-provisioning.net" , ID_SCOPE = "0ne0090D6E4" and using MQTT Transport. I am using Self Signed Certificate and its Private Key for Authentication. The RegisterDeviceCallback() method gets called with the status code PROV_DEVICE_RESULT_TRANSPORT. IotHub_url and Device ID are NULL in this case.

How do I resolve this issue?

Please Help asap. Thanks sayajirao

ericwolz commented 1 year ago

The usual issue to cause the error you are mentioning is if you have a connection issue (like loss of internet connection, dns resolution failure, etc) with the remote service, in this case the DPS service. You can enable verbose logs from the device provisioning client to verify when you have connection issues.

Please see here: https://github.com/Azure/azure-iot-sdk-c/blob/4c4db6f9c55626be761934facb39596bae98ac79/provisioning_client/samples/prov_dev_client_sample/prov_dev_client_sample.c#L153