azure-iot-hub

IoT Hub message routing with DeviceLifecycleEvents source does not work

好久不见. 提交于 2021-02-16 05:32:30
问题 I am already using an IoT Hub and have configured message routing to route TwinChangeEvents to an Event Hub. An Azure function with an EventHubTrigger processes the messages. This works perfectly fine. Now, I wanted to configure message routing to route DeviceLifecycleEvents to another Event Hub. Again, another Azure function with an EventHubTrigger should process the messages. However, the function is not triggered when I connect or disconnect devices. When I change the data source of the

How to disable Enable connection to IoT Hub?

烂漫一生 提交于 2021-02-11 12:23:09
问题 I am rehistering succesfully a device in a Azure IoT hub via device provisioning service, but i want to disable the property Enable connection to IoT Hub to disable for every registered device. Is there any way to do this from the code. 回答1: You can use the REST API that allows to create or update enrollments (either group enrollments or single enrollments), in particular the provisioningStatus flag. (there is a similar API for individual enrollments). Next time your device tries to use DPS

azure iothub device status

。_饼干妹妹 提交于 2021-02-10 06:29:32
问题 getConnectionState() as connected /disconnected depending on the device .if it is sending message i should see connected and if it not sending i should get disconnected .But each time i run the below java Program i am getting status as disconnected irrespective of device is sending messages or not RegistryManager registryManager = RegistryManager.createFromConnectionString(connectionString); System.out.println(registryManager.getDevices(new Integer(1000))); while(true){ ArrayList<Device>

Azure IoT Edge ModuleClient invoke direct method in another module

ε祈祈猫儿з 提交于 2021-02-08 10:12:50
问题 I'm using the Azure IoT Edge runtime running Linux containers on a Windows host OS. I have two modules, ModuleA and ModuleB. ModuleA have a registered direct method called "MethodA" and ModuleB have a registered direct method called "MethodB". When I invoke MethodA I want the method to invoke MethodB located in another module (but running in the same IoT Edge runtime). I'm using the Azure IoT SDK for c# and in the Init() function of ModuleA I have: await ioTHubModuleClient

Delete Device using rest API of Azure device provisioning service?

寵の児 提交于 2021-01-29 12:27:29
问题 What is the format of the url needed to delete an already registered device in azure IoT hub using device provisioning service... I read this article but it throws me 404 https://docs.microsoft.com/en-us/rest/api/iot-dps/deletedeviceregistrationstate/deletedeviceregistrationstate In the request header I added If-Match tag but do I need to add Authorization tag with the SaS token and if I need the SaS token will be the one which I used for registering device using Device Provisioning Service

IOTHubMessage.forEach is not a function?

狂风中的少年 提交于 2021-01-29 08:04:17
问题 Can anyone tell me how to parse this problem? I have an thrown error message that when i create azure cosmossDB, my cosmosDB output binding thrown message that IOTHubMessage.forEach is not a function; module.exports = function (context, IoTHubMessages) { context.log(`JavaScript eventhub trigger function called for message array: ${IoTHubMessages}`); var count = 0; var totalTemperature = 0.0; var totalHumidity = 0.0; var deviceId = "*****"; IoTHubMessages.forEach(message => { context.log(

How to generate an Azure SAS token via Javascript (node.js)

 ̄綄美尐妖づ 提交于 2021-01-28 08:06:34
问题 I am trying to generate a valid SAS token (shared access signatures) to connect to the Azure IoT Hub, but I keep getting the error Connection refused: Not authorized when using the token. I know the way I am connecting is working because when using a SAS token generated with the Microsoft Device Explorer (https://github.com/Azure/azure-iot-sdk-csharp/tree/master/tools/DeviceExplorer) it works as expected. To write the Javascript code I started from this documentation https://docs.microsoft

Get all devices from IoT Azure Hub

萝らか妹 提交于 2021-01-28 04:20:23
问题 I would like to obtain all devices into my Azure IoT Hub system (connected, not connected, it doesn't matter). I've read the documentation about the system itself with no result but Get a list of devices from Azure IoT Hub has become obsolete. Is there any kind of query which let retrieve all devices associated to my system? 回答1: You can use the REST API Service - Query Iot Hub Payload: { "query": "SELECT deviceId FROM devices" } 来源: https://stackoverflow.com/questions/56965855/get-all

Azure IoTHub DeviceMessage structure and route query

本秂侑毒 提交于 2021-01-27 18:20:54
问题 I used the python example from https://docs.microsoft.com/de-de/azure/iot-hub/quickstart-send-telemetry-python to send telemetry data to the IoTHub. Now I try to forward only the messages from the device "test-device" into a blob storage via a custom endpoint and a route. With the query string "true" all messages from all devices are pushed to the storage. However, I don't get the query to select only the messages from the deviceId "test-device". I search in the documentation but didn't find

Device Twin: how to read/write properties in c#

前提是你 提交于 2021-01-07 06:06:43
问题 I have registered the devices in IoT and the client application (device) can read/update reported twin properties. The properties are the wollowing : "EbbyVersion": { "Major": 2, "Minor": 1, "Revision": 0 }, "Telemetry": { "CachingInterval": 60, "SendingInterval": 480, "UploadTimeout": 10 }, "Power": { "MaximumAvailable": 3500, "Thresholds": { "Low": 2500, "Medium": 3000, "High": 3500 } }, "Lighting": { "R": 32, "G": 64, "B": 128, "W": 255 }, I write the following code to connect to IoT