Skip to main content

Posts

Showing posts from 2020

Modbus data conversion to different data types

Recently I was writing code to read Int64 numbers from Modbus devices in dotnet C#. The data coming from Modbus was all in array of bytes. But how to decode it and transform that to some meaningful numbers? 

One line command to instal chocolatey on Windows 10 command line

One line command to install choco on Windows 10 using the command line.

Azure IoT Edge device data on the Power BI dashboard

I wanted to present the IoT sensor data on the Power BI dashboard as near real time as possible. And it was not as easy as I thought initially. I will compare two methods of doing this with Azure and how that affects the latency. I'm using Azure IoT Hub and Azure SaaS as much as possible with as little bespoke code as possible. So I would like to show the sensor status on the Power BI dashboard as close to real time as it could be done. In my scenario I have a bespoke IoT Edge module that collects data from a custom built motion sensor. The data then is sent to the $upstream and available in IoT Hub. The structure of the data is simple it either sends information that there is motion detected or that there is no motion detected - the val field. And the time when it happened. { "val": 1, timeCreated:"2020/03/31 19:20"} Two methods I've found two methods to do it. One with Stream Analytics and another one with Azure Function and Power BI da

Last sensors readings in Power BI

If you want to show all sensors and only their last reading value on a Power Bi dashboard then you're reading the right page. It is not as trivial as it looks to be. So lets imagine we have a streaming dataset with our IoT sensor data. The data structure is as follows by this example data coming from IoT sensors { "Id": "sensor1", "Val": 11, "DateTime": "2020-05-06 10:11:05.222} { "Id": "sensor2", "Val": 5,   "DateTime": "2020-05-06 10:11:05.111} { "Id": "sensor1", "Val": 10.5, "DateTime": "2020-05-06 10:01:05.333} { "Id": "sensor2", "Val": 4.5,   "DateTime": "2020-05-06 10:01:06.334} { "Id": "sensor1", "Val": 10, "DateTime": "2020-05-05 10:11:05.122} { "Id": "sensor2", "Val": 4,   "DateTime": "2020-05-05 10:1