Closed pavel808 closed 2 months ago
Hi @mulligan252 , we will close this issue based on the reply from @ericwol-msft , which provides a good example of how to get the result from the provisioning and using the provisioned hub and credential to connect to the Azure IoT Hub. If you have further questions or would like to follow up, please feel free to reopen this issue. Thank you, Azure IoT SDKs Team
I have set up an IoT Hub, DPS and symmetric key enrollment group.
I'm working with the SDK on Debian. Using the provided _prov_dev_clientsample, with a generated device key from the symmetric key, I can successfully provision / enroll my device on the hub.
Now I wish to send data from the device to the hub. I am using the _iothub_lltelemetry sample as a reference.
The only way I can do this is by manually getting device connection string from the hub and using
IoTHubDeviceClient_LL_CreateFromConnectionString(connectionString, protocol)
However, I want my device to be able to connect without manual intervention. For simplicity, my hub name is "test-hub" and my device name is "test-device".
When I try to create a device handle as follows :
IoTHubDeviceClient_LL_CreateFromDeviceAuth("test-hub.azure-devices.net", "test-device", protocol)
I get the following failure which I don't understand:
Alternatively, When I try to create a device handle using
IoTHubDeviceClient_LL_CreateWithTransport(&config)
, by firstly attempting to create a transport handle as follows :TRANSPORT_HANDLE transport_handle = IoTHubTransport_Create(protocol, "test-hub", "azure-devices.net");
I get the following failure, which I don't understand either :I am struggling to understand and solve this. Below is my complete source code that I am using to attempt to connect to an already existing provisioned device. As mentioned, It only works by using the device connection string directly. I would appreciate any help with this. Thanks