Skip to content

Sample C# console application for solution Tajgo on how to send data and receive data to Azure IoT Hub, kicking off Azure Stream Analytics Service to perform data management on the received data.

License

Notifications You must be signed in to change notification settings

bojanv/tajgosimulatorsample

Repository files navigation

TajGo Azure IoT Hub Simulator Sample

This is a sample on how to send / receive data with Azure IoT Hub and then kicking off Azure Stream Analytics Service to perform data management on the received data.

It consist out of 2 projects:

  • Tajgo.Client.Simulator - it purpose is to send simulated data to the Azure IoT Hub
  • Tajgo.Client.Receiver - it purpose is to get data from Azure IoT Hub to check, if sending data was a success

After data is received, Azure Stream Analytics kicks in and perform data management.

{
"SystemPressure":0,
"SplittingCilinderPressure":0
"SawPressure":0,
"OilTemperature":0,
"LogLength":0,
"LogDiameter":0,
"TotalQuantity":0,
"CurrentQuantity":0,
"CurrentLogProduction":0,
"MaksimumPullForce":0,
"ShaftTurns":0,
"TotalWorkingHours":0,
"IntervalWorkingHours":0,
"CorrectionFactor":0
}

Query in Azure Stream Analytics get's the data from Azure IoT Hub and then saves data to Azure Table Storage for raw log processing. Other data is saved into Sql Azure. Other services are added to for additional data management possibilities (like PowerBI for creating rich visualizations, etc.).

The result is then entries in the database with following structure. Data is then be pulled out of database for data analysis and preview on website (other database tables ommited).

Database

You can download SQL script for creating the upper structure here.

Sample instructions for code to work

In order to use the sample, you will need to create Azure IoT Hub. You can create it via Azure Portal. Follow this tutorial to create IoT Hub.

After you created service, you need to change settings in Settings.cs file.

IoT Hub Host Name is the name of your IoT hub. Click on the Overview information in your Azure IoT Hub and copy the name. Replace the [IotHubhostName].

Now you only need to enter the connection string. It can be obtained in the Settings blade. Click on the Settings option, choose Shared access policies, select policy (in our case iothubowner) and copy** Connection String** (primary key).

If you have any questions, feel free to contact me.

About

Sample C# console application for solution Tajgo on how to send data and receive data to Azure IoT Hub, kicking off Azure Stream Analytics Service to perform data management on the received data.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages