azure-iot-hub

Using Tpm on Raspberry pi - error when compiling to native

风流意气都作罢 提交于 2019-12-12 04:16:05
问题 I'm using Microsoft.Devices.Tpm, and it's been difficult to debug the issues. When I add the package Microsoft.Devices.Tpm and trying to compile to native or build the package, I get the following errors: 1> Starting .NET Native compilation 1> Processing application code 1>...\Resources.System.Linq.Expressions.rd.xml(35): warning : ILTransform_0027: Method 'CreateLambda' within 'System.Linq.Expressions.Expression' could not be found. 1>...\Resources.System.Linq.Expressions.rd.xml(91): warning

Transient Error Occurer, deviceclient.sendmessage

試著忘記壹切 提交于 2019-12-12 03:12:13
问题 I have the following code which reads a temperature from a sensor on a raspberry pi. The code is asynchronous, and if I remove ONLY the last line of the code, the one that sends the message, I never get the exception. I meant this line: await deviceClient.SendEventAsync(message); private async void InitializeSensors() { string calibrationData; //_periodicTimer.Dispose(); // Inicializar el sensor bmp180 try { _bmp180 = new Bmp180Sensor(); await _bmp180.InitializeAsync(); calibrationData =

Azure IoT Hub Operations Monitoring

六眼飞鱼酱① 提交于 2019-12-12 01:49:56
问题 I have an Azure IoT hub that I connect devices to. I want to enable monitoring to monitor devices connecting and disconnecting from the hub. I've enabled Verbose on Connections in the monitoring categories for my Iot hub: My devices connect to my Hub and show in Device Explorer: I then have an Azure Function set to log my data from the Operations Monitoring to an Azure SQL db: using System; using System.Configuration; using System.Data.SqlClient; using Newtonsoft.Json; public static void Run

Azure IoTHub DeviceMessage and route filter

只愿长相守 提交于 2019-12-11 21:47:24
问题 I use python and paho.mqtt for sending messages to cloud I set up endpoint and route. When I set query string to true , everything works fine messageDict = {} systemPropertiesDict = {"contentType": "application/json", "contentEncoding": "utf-8", "iothub-message-source": "deviceMessages", "iothub-enqueuedtime": "2017-05-08T18:55:31.8514657Z"} messageDict = {"systemProperties": systemPropertiesDict} messageDict["appProperties"] = {} body = '{id:1}' messageDict["body"] = body root = {"message"

Azure IoT Hub - Send message (C2D) to one device on 2 topics instead of devicebound/#

醉酒当歌 提交于 2019-12-11 17:59:46
问题 As a MQTT client (device), I am using devices/{deviceid}/messages/devicebound/# topic to receive Cloud to Device messages. This device is a gateway for me and there are 3 devices attached to it. I want to send 3 different commands to 1 gateway on 3 different topics, like devices/{deviceid}/messages/devicebound/device1 devices/{deviceid}/messages/devicebound/device2 devices/{deviceid}/messages/devicebound/device3 My gateway is registered in iot-hub and I use it at {deviceid} . Is it possible?

How to use Node.js code in React Native App

三世轮回 提交于 2019-12-11 17:31:28
问题 I have a Node.js code that connects to Azure's IoT Hub and sends messages to the hub. Here is the code: 'use strict'; var connectionString = 'connectionString'; // Using the Node.js Device SDK for IoT Hub: // https://github.com/Azure/azure-iot-sdk-node // The sample connects to a device-specific MQTT endpoint on your IoT Hub. var Mqtt = require('azure-iot-device-mqtt').Mqtt; var DeviceClient = require('azure-iot-device').Client var Message = require('azure-iot-device').Message; var client =

Application hangs when sending from MVC Web Application to Azure IoT Hub Device

人盡茶涼 提交于 2019-12-11 17:14:58
问题 This is a controller code of an Azure Web App that handles a device notification logic. What I'm doing is invoking the code shown below from a ASP MVC Controller. But when I run it I get an ever-pending request from the browser(it hangs). I have a button on view, when clicked, it invokes Wakeup method in the controller. The code is not different from the one on MSDN for a console application. What am I missing? using System.Text; using Microsoft.Azure.Devices; public class

How to get deviceid of message in Azure function that is triggered by IOThub message

て烟熏妆下的殇ゞ 提交于 2019-12-11 17:03:10
问题 I have an Azure function that is triggered by IOThub. So in the Azure function, I have public static async Task Run(EventData myIoTHubMessage1, TraceWriter log) How do I get the device id from the Event Data. I tried log.Info("devid="+myIoTHubMessage1.SystemProperties["ConnectionDeviceId"]); It gave an error saying The given key was not present in the dictionary. the following document says that https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-messages-construct

How can I enroll a device to a group enrollment in Azure IOT hub?

拥有回忆 提交于 2019-12-11 15:38:14
问题 I have seen code for individual enrollment but I can't find any for group enrollment. I need to bulk enroll a thousand devices to Azure IOT Hub and was thinking of group enrollment.Any sample code will be appreciated. 回答1: It should be possible both with group enrollment and bulk individual enrollments. From the samples related to How to manage device enrollments with Azure Device Provisioning Service SDKs: Bulk Individual Enrollments public async Task<List<IndividualEnrollment>>

How to implement Routes functionality for Twin Change in Azure Iot-hub?

北城以北 提交于 2019-12-11 10:40:36
问题 I have set Routes for update twin and select endpoint as events(default) supported by Iot hub but it is not working. Here is in screenshot Am i doing anything wrong or something is missing ? Any advice or references to other material would be appreciated. 回答1: Your Routes setup is correct. I am guessing the problem is on the consumer side of the Azure IoT Hub events (default endpoint). You can use for test purpose a Device Explorer tool. The following screen snippet shows my example: other