MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.3k stars 21.47k forks source link

How to achieve device registration without SDK #40106

Closed BhupalPatil closed 5 years ago

BhupalPatil commented 5 years ago

This document talks about how the data packet format in case of device to iot hub connection (without sdk) however if device is registered with DPS (using X509 cert) is there any reference for how to achieve device registration without SDK?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Alberto-Vega commented 5 years ago

@BhupalPatil Thanks for the feedback! The SDK is the recommended way, do you have a requirement to not use it? With that said let me investigate and I will get back to you.

rezasherafat commented 5 years ago

@BhupalPatil, can you clarify if you are asking about device registration itself with DPS, or subsequent device connecting to IoT Hub?

BhupalPatil commented 5 years ago

@rezasherafat, I cannot use C or C# SDK and trying to build our own library that will do device registration via DPS using X509 certificate and carry out device to IOT hub comunication... so trying to explore how to achieve this with C#/.net and C language using.

if I'm using MQTT net library then can I get some pointers what should I connect to in case of DPS for device registration and IOT hub to send message and file upload. what will be the endpoint for DSP and IOT Hub? what inputs shall be included in request in order to DPS and IOT hub work seamlessly.

Thanks Bhupal

rezasherafat commented 5 years ago

@nberdy for DPS help

robinsh commented 5 years ago

Thanks @Alberto-Vega-MSFT . We have a better chance of getting help from @nberdy or @rezasherafat than from myself. Nicole, can you help?

Alberto-Vega commented 5 years ago

@BhupalPatil Can you share what is the constraint you have so you can't use the SDK? Also have you seen the DPS REST API documentation? These docs have a Try it button where you can play with the API, plus you can look into the implementation on the C# SDK https://github.com/Azure/azure-iot-sdk-csharp/tree/master/provisioning/service/samples

BhupalPatil commented 5 years ago

@Alberto-Vega-MSFT Our devices software is on C language platform (Ingenico Telium 2 OS), considering the C SDK for IOT implementation we cannot use it because the Azure C SDK uses dynamic memory allocation and pthread which we dont support in our application. the dynamic memory allocation leads to memory fragmentation in our devices.

I'm looking for doing this using MQTT client not with REST API.. mainly we want to do this in C Language but as I didnt get any pointers in C yet I'm trying to do this in C# first and if successful I will replicate same on C platform.

Thanks, Bhupal

BhupalPatil commented 5 years ago

@Alberto-Vega-MSFT just to add on top of it, if we cannot achieve device registration at all n you confirm if we can send the message and upload files using paho Mqtt library directly? I gont thru the steps HERE and managed to connect device using paho mqtt .net library however unable to send message as well as upload files to device. appreciate if we can get some working reference on the same documentation page?

Alberto-Vega commented 5 years ago

@BhupalPatil To get you unblock we will need to connect you with a support engineer. Can you please file a support request @ https://aka.ms/azsupt? If you do not have access to a support plan, please reach out @ AZCommunity@microsoft.com with a link to this Doc/Issue as well as your subscription ID and I can help to get you a one time free support ticket opened for this issue.

Also StackOverflow is a good source that can move fast, we have a good community of developers there. https://stackoverflow.com/questions/51045360/publish-message-to-iot-hub-eclypse-paho-mqtt/51740814

Since the main objective of these issues is to make doc improvements, I will keep this issue open as doc enhancement to evaluate your suggestion to add code samples: specifically for device to cloud message.

BhupalPatil commented 5 years ago

Thanks @Alberto-Vega-MSFT , I have sent mail to AZCommunity@microsoft.com, I have also raised same query on StackOverflow.

Thanks, Bhupal

rajeevmv commented 5 years ago

@BhupalPatil If it helps, you will find the DPS C# MQTT device client implementation here.

A document describing this in detail does not exist yet.

Alberto-Vega commented 5 years ago

Closing this issue since customer is getting help from support.