How to send simulated data from a device to an Azure IoT Edge device - azure-iot-edge

I have worked with sending data using a c# code to send simulated data from a device to an IoT Hub, but I am not able to find documentation on how to do the same i.e send data to an on premise IoT Edge device.
Any guidancewould be greatly appreciated.

Once you set up IoT Edge as a transparent gateway(https://learn.microsoft.com/en-us/azure/iot-edge/how-to-create-transparent-gateway); and update your connection string used in your C# code to append "GatewayHostName="; your c# code should work and messages will route to Edge Hub and then IoT Hub.

Related

How I can view Raw Data (Binary sensor data) which i have published to Azure IoT Hub?

I am implementing custom device based on ESP32 Wi-Fi Microcontroller. I was able to successfully connect this device to Azure IoT Hub.When I transfer telemetry data in json format and I can view the data using azure cli (az iot hub monitor-events --hub-name {hub}).
But when I published telemetry raw data (ex: uint8_t data[]={0x12,0x3F,0x01,0xF1,0x01,0x02,0xD3,0x00};) I am not able to view through azure cli (az iot hub monitor-events) although mqtt publish is success from ESP32 side. Some time "az iot hub monitor-events" crash.(see the image)
Is there an alternative way to do this? or does Azure IoT hub not support Raw telemetry data? Any help or advice would be highly appreciated! Thank you.
initial part - success in displaying json data, Crash when send raw data

connect securely to IoT Edge devices

I want to secure the connection between the devices and the IoT Edge Device to the secure for example my app running on the iPad access the IoT Edge Device at http://: but I want to access it over https. I am new to IoT, How can I achieve it?
You could run a proxy module like outlined here: https://github.com/Azure/iotedge/tree/master/edge-modules/edgehub-proxy

How to handle multiple device clients provisioned through DPS(Group Symmetric key) to IoT Central from a gateway device

We have a gateway device(not running IoT edge runtime). We want to connect multiple BLE or Zigbee sensors to the gateway and provision/register them through our gateway device to IoT Central as different devices using group symmetric key approach.
We have seen multiple sample codes for the provisioning and registering the devices using group symmetric key to generate device-specific SAS key. But these don't have an approach for handling multiple device clients after registering and connecting to IoT Central
python sdk provisioning with group symmetric key
iot_central_python_sample
After connecting the device we need to use device client of the SDK to send telemetry and receive commands to/from IoT Central.
Consider if we want to use the same code for multiple sensors, we need to have multiple device clients(threads) running.
Please suggest a better approach to handle multiple devices for sending telemetry and receiving commands to/from IoT Central
This might help with your use case: https://github.com/Larouex/IoTCNanoBLE33

How can i get the connection string for IoT hub in Azure Digital Twin

Resource only return following object and not connection string which I need to call Direct methods on device.
[{"id":"585302d5-f4c9-4248-bb50-482657c028ba","spaceId":"b27f5aa2-ba06-4ffa-9750-b4a3655a6096","type":"IotHub","isExternallyCreated":false,"status":"Running","lastUpdatedUtc":"2019-02-21T10:22:00.0456407","properties":{"iothubUrl":"ih-46de7654-b8c5-4ddc-9e50-b455d36d4146-1.azure-devices.net"},"instanceNum":1}]
The connectionString can only be retrieved from the devices endpoint.
GET https://{{instanceName}}.{{regionName}}.azuresmartspaces.net/management/api/v1.0/devices?includes=ConnectionString
In the early preview version of Digital Twins Command and Control is not available.
Currently Azure Digital Twins doesn't support command & control to devices. You can get the device connection string but you cannot get the IoT Hub's connection string to issue commands (or device twins).
Moving forward we have heard a lot of feedback from customers that they want/need to send commands and in the next set of updates to Digital Twins we are looking at how to enable this. Stay tuned as we will have updates later in 2019. Thanks for the interest & question.

How can I push the data collected from IoT devices to Microsoft Azure IoT hub?

I need to connect my cell phone to the IoT sensors (Say BLEs) and collect the data which needs to be sent or stored into Azure.How can I do that? Is there any App (preferably mobile App) through which I can handle my IoT devices and push the data to MS Azure using any gateways? If yes, how can I do that? Links of any articles or materials and videos related to this will be helpful. Thanks.
Currently there is no such out of box mobile app to use.
If you like to develop an app by yourself you need connect to sensors and collect data and connect mobile device to Azure IoT Hub and send Device-To-Cloud message.
Also here is a Azure IoT and Mobile sample application: MyDriving. It is a typical Internet of Things (IoT) solution that gathers telemetry from devices, processes that data in the cloud. You can customize for your deployment.

Resources