Azure IoT Hub Python SDK on ESP32 - azure-iot-hub

Despite not tested or supported as mentioned here, can Azure IoT Python SDK be deployed on ESP32? Or I need to use MQTT Protocol directly to connect with Azure IoT Hub?

Related

Is there a way to connect the data present in Azure IOT hub to IOT Central smart meter application

I have published data to the Azure Iot Hub devices from my hardware devices. Now I want to perform some analysis using the IOT Central's application 'Smart Meter Monitoring' the link to the website is this https://apps.azureiotcentral.com/build/energy.To be more concise, I'm trying to consume the data present in the azure iot hub devices using the the IOT Central's application 'Smart Meter Monitoring' so that i can build dashboards on the data that is consumed. I Have browsed many websites and I am not having any progress in trying to connect azure IOT HUB and the 'Smart Meter Monitoring' application of IOT central. I am beginner in this field want to understand how this integration is made any tutorial or blog will be helpful
You could use this repo https://github.com/IOTD-Americas/iothub-bridge-function in order to re-send all telemetry from IoT Hub to IoT Central using an Azure Function in real time

Azure IoT Hub Device Identity requirements

I need to connect some sensors to an Azure IoT Edge Runtime via MQTT.
I read here:How an IoT Edge device can be used as a gateway , that in the "Transparent" Pattern, devices who hold their own IoT Hub device identity can communicate directly with Azure IoT Edge via MQTT.
I am still in the planning phase and don't have the sensors (or Iot Hub devices) at the moment so I couldn't really start testing directly. I wanted to know if all devices/sensors can hold their IoT Hub device identity and if there are any hardware requirements in order to do so?
Thank you very much in advance!
In the transparent gateway case, the requirements for devices / sensors are the same as if the device would connect directly to an IOTHub using its identity. That is, if the device or sensor supports to Azure IOTHub via MQTT, it should work through the transparent gateway. When configuring the device, instead of using a connection string for the Azure IOTHub itself, you'd use a connection string that references the local Edge gateway.
There are 3 basic steps to take in the transparent gateway scenario - the article you linked steps into them, but I'll add in some color for 2 and 3.
Set up the gateway for connectivity from the downstream devices & routing to the upstream IOTHub. This article has good details.
For each device, create an identity in Azure IOTHub, using the device's unique ID (for example, device EUI for a lorawan sensor) as the IOTHub DeviceId, and set up auth per this article. This step is where you determine the Edge gateway connection string.
Connect the downstream device to the gateway device and start sending messages. That's this article. This is obviously dependent on the device itself and the operating code/configs (whether a 3rd party black box type device or something running your own code).

Get Azure IOT Hub connection string from UWP app on provisioned device

I have a Raspberry Pi running Windows IOT Core, which has been provisioned to an Azure IOT Hub. I'm writing a UWP app and I want to send messages to the IOT Hub, which I think I need Microsoft.Azure.Devices.Client.DeviceClient to do. DeviceClient needs a connection string, which I can hardcode in the app for testing.
How do I:
Check if the device the app is running on is provisioned to an IOT Hub?
Get the connection string for the IOT Hub?
I can't know this information at compile time, and I don't want to rebuild my application for every device/deployment.
Microsoft.Azure.Devices.Client.DeviceClient is IoT Hub Device SDKs. It is used to send telemetry to your IoT hub, and optionally receive messages, job, method, or twin updates from your IoT hub. But if you want to get the connection string for the IoT Hub and check if the device is provisioned to an IoT Hub, you need to use IoT Hub Service SDKs. It enables you to build backend applications to manage your IoT hub, and optionally send messages, schedule jobs, invoke direct methods, or send desired property updates to your IoT devices or modules. But you also need to set the DeviceId and iot hub connection string in your app.
It is not recommended to generated the connection string in device client end. The sdk supports UWP app to run on Windows IoT Core.
I think you might want to try to check out the UWP Bridge. It is a WinRT library that can be used to connect to the Device Agent and read the connection string from the TPM.
You can build the DMBridgeComponent library from the azure-client-tools repo on GitHub (https://github.com/ms-iot/azure-client-tools) and then reference it from your UWP app.
Then, to read your connection string you just need the following code:
using DMBridgeComponent;
...
var tpm = new TpmBridge();
// Get connection string from TPM
var slotNumberValue = 0;
var connectionString = tpm.GetConnectionString(slotNumberValue, 36000);
Set the slotNumberValue to whatever slot you used when you provisioned your device. It is usually 0 by default.
There is more information here (https://github.com/ms-iot/azure-client-tools/blob/master/docs/device-agent/uwp-bridge.md). That's where I found the sample code.

How to connect non-programmable (no SDK) devices to IoT Hub

I am building an IoT solution based on devices that are not programmable (3rd party devices).
I can just configure the server they must connect to and I have the messaging (sending messages and receiving commands).
What is the best way to integrate them in an Azure IoT Solution (IoT Hub) ?
It looks like we can use Azure IoT Edge as Gateway (https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/iot-edge/iot-edge-as-gateway.md) in a "Identity translation" pattern, but I still not figure out how to do it.
I also find Azure IoT Protocol Gateway (https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-protocol-gateway) that seems to do the job but it is not sufficiently clear for me what to do.
Thanks in advance for your help.
The question is which protocols your devices support and how configurable your devices are. For instance you might be able to talk MQTT directly to the IoT Hub without using the SDK: https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-mqtt-support#using-the-mqtt-protocol-directly-as-a-device
Same is possible for HTTP using the REST API directly: https://learn.microsoft.com/en-us/rest/api/iothub/device
If neither is an option then yes, you need some kind of gateway - like in the examples which you linked.

Why Azure IoTHub is defined as Platform as Service?

I see Azure IoTHub described as Cloud Platform as a Service? could anyone explain why IoTHub is PAAS?
https://azure.microsoft.com/en-in/services/iot-hub/
From the documentation:
Connect, monitor and manage billions of IoT assets—Use Azure IoT Hub to securely connect, monitor and manage billions of devices to develop Internet of Things (IoT) applications. IoT Hub is an open and flexible cloud platform as a service that supports open-source SDKs and multiple protocols.
To provide some context, the following article gives a high level overview of the various Azure IoT services, both PaaS and SaaS: Internet of Things (IoT) technologies and solutions: PaaS and SaaS