Edge Computing Tutorials: Mapping an IoT peripheral device to your container application

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hi there and welcome to this edge computing tutorial in this video I will show you how you can map an IOT sensor to an ant device and to a container application that is running within before doing so I would like to ask you to get familiar with mullah and mullah box there are a few videos on our YouTube channel that you can watch first so make sure you do because we'll make use of those technologies in this video in this tutorial okay so my setup for this tutorial is simply a raspberry pi as my edge device and is running a noogler box inside and there's a webcam attached to it so that's what we will use as our IOT sensor the use case for this tutorial is application that is containerized and is making use of this open source machine learning platform called tensorflow probably we have heard of it it's not very important for the tutorial itself it just so you know that we are using an open source platform to build the application that we'll be deploying in the noodle box in the raspberry pi so it's this order flow based and it's an application that will detect options okay we will use move load at i/o for deals which is our public offering of noodle on and for now we will just login into the platform so once you log in you will find many different options to choose from if you click on dashboard on the left side you will see nothing because we have nothing running at the moment but if we click on the edge panel there you will see one card and that's our new blue box that's our antivirus raspberry pi C from our setup and if you click on it you will get all sorts of monitoring information so the last heartbeat was just a few seconds ago so everything is good we have resource consumption information from CPU users to memory usage and disk usage and on the bottom you also have professor Valparaiso these are these are our IOT sensors and you will see that there is a webcam there it has been reported from the new vlog logs automatically we only net that device there that's the physical device in the file system for dead HD webcam we'll need it for later so we'll come back to this so for now let's just move ahead and check our App Store so when you go to the App Store you will see many apps the first one is the one that we want to use for this tutorial it's basically an object or application based on tensorflow it's quite a simple application it's based on a compose file that points to a docker image that we have built on purpose for this video and if we check the source code for that docker image you will see that in fact we have not developed this application we are just using open source code that we have found here and there from a sort of flow and also from another github repository the links for these references will be in the description of this video if you want to build it yourself as well so feel free to do it and the application is quite simple it's just exposing via HTTP a video feed with object detection based on the models from tensorflow ok and you can see that from the compose and file there that we are exposing the HTTP port from the container to the host to the Raspberry Pi so that we can access it later on when we deploy the application ok so everything is good here we can check that our syntax is fine and we have a compatibility mode on the right side step to swarm that's a default right when we put a compose file in Nouveau the default will be a swarm application so we can just click Launch you'll be given the option to choose money for structure we just have one so let's go ahead now environment variables no files that with image it all good we can just click Launch and move on we'll reach out to the Nouveau box running at the edge is the Raspberry Pi and ask it to deploy this swarm start which pretty much is the composed file that we have described before so when you click on your deployment you get a new page with all sorts of information about it why the state which is not started it just means that we are waiting for the actual application to come back to you and say I'm ready and you have events that have been triggered to execute this appointment you have parameters as well all about disappointment the name what it is running the actual number of instances in replicas and we are just waiting for this green button that is now param talk to appear because that thing means that the endpoint the HTTP service that is running for us to expose the video feed is now ready and can be accessed through this you are out there and you can see that it is not a public IP because if you have watched the previous videos about the Nouveau box these new box exposed to the VPN endpoint which is private and if we click on it you will see that hey something went wrong so even though the application is running you can see there has been started screen something went wrong with Dee the container itself so let's get the logs and we will see that there's an error there on the right side the earth says that my application was not able to make use of the webcam I cannot use that device for some reason ok even though we know it's there that's in our set up is connected it's plugged into the Raspberry Pi our application our container cannot use it and therefore it breaks and we get into this kind of weird state because the container is running but the actual application is not getting the video feed from the webcam so let's just stop this and come back to it a bit later and see how we can fix it so let's first try to understand why this happened if we check our ad back in the old one in our recipe we'll see that we are using a docker image that's the right one and we are doing a port mapping but we are missing something let's check the docks from from docker and we will see that there is an option there called devices that we are not using for our compose file this allows you to map a physical device from the house to the container and that's what we should use that's what we want to use in order to mark the arity sensor to our Raspberry Pi and if we check the edge panel in our noodle box we'll all find the actual path to this device in the filesystem it slash there slash video 0 that's our webcam okay so I just copy that it might be different for you for my case it / there / vu 0 copy that and keep in mind that docker say is hey this option will be ignored by swarm so let's see what happened let's click on our app back in new one let's go to the compose file and let's write these new option devices in the wets map our device slash dev slash video 0 from the host to the container same path want to skip this right and let's save this updated application let's put a commit message there and let's see what happens so now on the right side you can see that there's a new compatibility mode that says docker compose this is because new one will automatically detect it because you have a specific option that is only compliant with docker compose Google run is as a doctor compose application in not a swarm stack okay so everything is good let's try to deploy it again and see what happens same infrastructure the new little box no environment variables no files let's just go for it click Launch and see if this time we get our application running with the endpoint actually being functional so if we click on it this time will be much faster because there there is no swarm service and start being deployed it's purely a container to the dr. Campos but we already have the endpoint there which is good okay all the parameters are set they're all good let's just click go ahead and click on the endpoint on the green button and see if our endpoint is actually working if we can get the video feed from the raspberry drive from the Nouveau box and there we go we are going to the noodle box to the VPN IP we get a web page the video feed let's put something in front of it to remember this is our webcam and if the application is working there it goes there's not it there too teddy bear let's try something else there's my hand human and there's a cut of course this is it the performance is quite well it's a Raspberry Pi but just bear in mind for the sake of the tutorial that you are not using any GPUs so that's what we get and let's remove the cut for example and wait a bit for it and there we go that's pretty much it so we have just deployed a container application from Lula to Inuvik box at the edge and we have mapped and IOT peripheral device into that application but doesn't know if you have any questions you can write it down in the comment below or it can just being as my email check our videos subscribe to our channel and stay tuned for our next tutorial videos take care [Music]
Info
Channel: SixSq
Views: 623
Rating: undefined out of 5
Keywords: docker, containers, docker swarm, iot, edge computing, sixsq, nuvla, nuvlabox, devices, sensors, tensorflow, raspberry pi, object detection
Id: BHzbEDzyfnQ
Channel Id: undefined
Length: 10min 35sec (635 seconds)
Published: Thu Apr 09 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.