Azure IoT Tutorial : How To Send Data To Azure IoT Cloud Using MQTT

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys in this video I'm going to show you how to send data to a GRT hub from a standalone MQTT client so if you're new to this channel i'm cuz i and a regularly publish Internet of Things and industry 4.0 tutorials on this channel so make sure to subscribe to get them as they come out now the IGRT hub is not a generic MQTT broker so in this instance i'll be showing you how to set up your mqtt client to be able to send mqtt messages to the azure IOT hub as it would any other broker so to do that I'll be using my groov epic industrial controller to read temperature sensor data and use node-red to create an mqtt client to send the temperature data to azure IOT hub so here i've got my groove epic controller with a temperature probe connected to its analog ink module on the right here okay so to register my crew epic controller our log into the azure portal and then I will select my RT app and then under my RT hub I'll scroll down to the RT devices click on it ok so as you can see here I've got two devices already registered under my RT hub which is my raspberry pi in my eye i OT call box now to add my crew epoch controller I'll click on the new button and then I'll give it a name which is my groov epoch controller and then I'll leave the authentication type is symmetric key and also our let a GRT auto-generate to the keys and then I'll make sure that the connect this device to an IT app is enabled and then I'll click serve okay so I've successfully registered my epic controller device now to start sending data to this IOT hub using a standalone MTT client I first need to generate an authentication token to do that I'll go to shared access policies here and then I will select the IOT hub owner policy which allows me to read and write to the RT hub and then here I'll copy the primary key connection string now to generate the authentication token I must use the device Explorer utility so I will pull it up and then I'll paste my primary key connection string here and then here I'll call under the management tab so as you can see we have got three devices registered under this RT hub so I'll select my epic controller and then I'll click on SAS token and then I'll click on the generate button and then I'll copy this SS token up to here and then I'll paste it here now the next thing that we need to do is to access the node-red editor running on my groov epic controller and to do that i'm going to type in the IP address of my crew epoch controller slash not read so the first thing that I'll do is out drag and inject no idea and then here I'll set to the interval for reading the temperature data to 5 seconds click done and then I'll scroll down here and drag a note that would allow me to read the temperature of my growth epoch controller module double click on it to edit its properties and then I'll add new pet device then here I'll put localhost since node-red is running locally and then I'll click Add and then I'll select the data type that I want to read which is an analog input and then I'll specified the tag name of the temperature which is panel underscore temperature and then I'll enter the display name here and then I'll click done okay and then I'll connect the two okay so our temperature is currently in degrees Fahrenheit so I need to convert that to degrees Celsius to do that I'm going to use a function block I'll drag it onto the canvas and then I'll double click on it and then here I'll put this equation that converts degrees Fahrenheit to decrease OSHA's and then I'll enter the name for my note then I'll click down and connect the two now the next thing that I'm going to do is to drag this MQTT note which effectively makes our device and mqtt client so click on the empty TT not to edit its properties and then I'll click on the edit button okay so first of all our ERT app broke our port number is triple 83 and then under server here I'll add the a GRT up broker address so as you can see here the azure RTR Broca uses SSL authentication the name of my RT r dot r your device's dotnet and then the client ID here is the name of my device which is maha peak controller and then let's go to the Security tab to enter our security details and then I'll enter the username here which is the name of my RT app dot other devices dotnet slash the device name which is my epic controller and then for the password here we need to use the authentication token that we generated earlier so I'll copy that and test it here and then we go back to our connection tab here we click enable SSL and then we add new TSL configurations to click Add ok and then we click update now here under topic our RT hub uses a specific topic structure which is devices slash the name of your device which is my epic controller slash messages slash events and then you can go on to extend it from there which I'm going to do by putting temp data here and then here are my display name for my Lord and then click done and then I'll connect the tune okay so we have successfully created an empty TT client that reads the temperature data who publishes that to the IOT hub so I'm going to go ahead and deploy this okay so as you can see was successfully connected and sending data but how do we verify that the data is actually getting to the IGRT app to do that we need to use the device Explorer utility so I'm going to open my device Explorer and then our pit we'll go back to my ad reporter and then here I'll copy the primary key for my connection string then I'll paste it here and then if we go under the management tab here you can see these three devices that are currently configured under our IRT hub now to see if the data is currently being published to the LT hub under the mitre peak controller device you go to the data tab select my epic controller and then click monitor so as you can see here we're receiving our temperature data and the temperature is currently at 16 degrees Celsius so if you found this video useful please press the like button and don't forget to subscribe to our YouTube channel to get more irt videos like this as they come out
Info
Channel: Industry40tv
Views: 27,364
Rating: undefined out of 5
Keywords: Azure IoT Tutorial, iot cloud useing mqtt, azure iot hub, iot cloud using mqtt, internet of things, iot hub in azure, iot hub tutorial, azure iot hub mqtt, azure iot raspberry pi, microsoft azure tutorial, azure iot hub tutorial, iot hub message routing, iot hub azure tutorial, Azure iot hub demo
Id: k3Gvk1cjwhI
Channel Id: undefined
Length: 10min 47sec (647 seconds)
Published: Mon Feb 10 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.