Getting started with Azure IoT Edge development



hi i'm olivier and this is the internet-of-things show today we'll talk about azure IOT edge and there's going to be a one on one introduction for developers and for that we have John gallant here today hey John how are you good good that's the first time you're on the show and not the last I know that and I see a headlight fantastic stickers on the laptop well I thought would be a nice thing actually and he tell us something about one of the stickers on your laptop all right yeah so I have a seven-year-old boy and he created this strap this red guitar and these are all perler beads and we got him a strap for Christmas yeah these 3d stickers in your thumb oh yes okay that's the first I see that also a Huskies man cool so what do you do for Microsoft I'm on the commercial software engineering team we work directly with customers on latest technology coming out of Asia and then we get feedback into engineering teams to help them approve the developer experience and overall product cool so since we released and before even like it was public you've been working with Asia at the edge with actual customers right absolutely okay so the goal today is actually to look at what from a developer standpoint ith is and how you get started with it right so maybe first like what is I at the edge or a developer the azure IOT edge is a solution that allows you to connect devices that are not internet connected to the Internet as well as do local compute storage so you can do local machine learning and analytics to make real-time decisions on the edge versus versus doing that in the cloud okay okay so basically and actually all that control from the cloud through as your IT hub right so basically set things up there and things happen magically in advice right yeah okay well actually I think a good thing to do to do that one one is to look at at these tutorial that we have and say hey what are the prerequisites what do you need to do as a developer to get started without at the edge and run your first edge device and the first modules and we'll see what that is on that device absolutely all right so let's jump into the tutorial so on the Microsoft Doc's website we have step by step instructions for getting set up with azure IOT edge okay and the the first thing you're gonna need to do is go ahead and install talker okay the edge is based on containers the edge itself is a docker container okay and each of the modules that you create are also containers god okay yes so that's on the device except for that's the edge device that's right okay yeah so you need docker and you need Python the Python script that we have today allows you to start or restart and configure that edge runtime make sense so the first thing we do is do a pip install of that runtime yeah so that's a public package right so anyone can just install on their machine using that peering Slocum and that's just a pip install we do the – you've to update to the latest version so if after you have installed that runtime the runtime is now available on your edge device this is simulating the edge on a Windows machine so we are going to create an IOT hub and an edge device so we've already created the hub so let's go over to the portal and see what the edge device creation experience looks like on the home page of your IOT hub you're going to see a new item called IOT edge you click on that and you click Add IOT edge device this is going to create an edge device in the IOT hub so let's do edge device five so the same way you would be creating a device identity for a regular would say device mighty hub what you're doing right now is you're creating one of this specific capabilities which are edge cap abilities great that's right okay yeah so we've we've created edge device five okay and that gives us connection strings to connect to that vice and will list all the modules deployed in that device okay so now it's a vanilla type of device you have a new connection string so that's basically going to be with you'll be using on the device or in the runtime actually to hook up to right you have any and get your configuration that's right okay we're gonna take that connection string and we're going to pass it in to the IOT edge CTL setup command with a connection string okay cool so I'm going to copy and paste that into my command prompt so this is going to copy all the necessary configuration for the edge runtime okay and now we need to do in a IOT edge CTL start cool so these tools come when you do install the runtime using the PIP package right so all of that is coming in was was your was very install and you're able to do that configuration then starting the the actual runtime right that's right so the first thing it will do is fetch the official agent okay that is responsible for pulling down all the other modules now it's actually running waiting for a module to be sent to it and we do that we can do that through the portal okay let's go back to the portal now we click on the edge device you click set modules and click Add IOT edge module okay you give that module a name in a image URI which is a your right to the docker image which can be on Azure container registry or can be on docker hub or any kind of private registry that you absolutely local one right it could be a local host yes yeah alright so back at the documentation we're gonna copy this here temp sensor to the portal and we're gonna grab this URI here okay so we're we're deploying right now is a module that simulates data from a temperature sensor right that's right okay yep it just generates data on a timer and sends it through the through an edge module to you okay basically a name and a pointer to the registry where these images living that's right not configure a route so when you have multiple modules you're gonna route messages from module a the module B okay and you can configure that here in routes all right now we're just gonna say all messages go to upstream which means send all messages to IOT hub got it okay we're gonna click Submit okay what's happening here so you submit what's happening in I field right now so the submit button actually calls an endpoint called apply configuration okay that apply configuration will through the clouds send a message to the edge agent okay and to it will tell it which modules it should download got it so the basically the edge runtime the device will synchronize and say hey like I'm a new configuration now I have to download and install and run the new modules and also set up the routing right that's right okay cool so now when you refresh your device you'll see that temp sensor is now running on that device okay along with a couple other ones right yes the first one you'll see is edge agent which responsible for setting up configuration pulling modules pulling config in launching other modules and edge hub is responsible for sending messages to IOT M okay and the routing as well right yep all right cool so yeah for now you didn't write a line of code that's right that's right yeah okay so now let's take a look at the messages coming in from the edge device to IOT hub using device explorer we're going to configure that with our connection string then we're gonna go and go into data and select our device we click monitor and from the tool perspective here whether it's a regular device or an edge device that makes no difference right that's correct okay so you can see these messages coming in so what we've done is installed the edge runtime on our Windows machine just to simulate an edge device okay we've deployed a temp sensor simulated module to that device okay and now we're monitoring message is coming from that voice awesome so that's that's good that's a really good introduction to that's the ABC I would say off of IT edge for developers from there the phone will start but there's a great introduction thanks John and that's unit next step is it sounds great thank you you

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *