For Beginners 3: Node-Red IoT Data on WebSocket

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
we have had two sessions of not read introduction the first session we load a IOT simulator so the device get the temperature and humidity and display to the screen in the second session we make the connection we made their device connect to the IOT platform and here you go so now after we deploy and set up the time interval to every three seconds you can see that data has come to the debug in this session I would like to introduce how can we represent this data presenting this data to the websites there is a problem so this is in for the server-side nodejs a server-side program and then how can we get another process to pick it up and the data app and remember the data is continuous and the small-sized IOT data the typical way to do this is using the WebSocket and to get this can here is data let's see how do we do that in the there is a very nice with example from the website this website so let's take a look how do they do coffee control I control V input okay we got it here now we also get that time interval a little bit small and shut down the debug okay let's deploy application Klein is not connected that's fine so we are going to connect to the HTTP gap okay we can see the website is coming and then that the timestamp is keep going let's see how do they write the code okay there are two part one part is they are doing the WebSockets two different kind of notes this is web talk is out which is sending the data to the client side and this one is yes except data is that we have studying and in this pile of code is the very simple HTTP GET and with a template node and this node is kind of the front end a javascript including the HTML and also javascript so in here it's reflecting the webpage you know they get the gap did you know two things one thing is a get the data from the winds that stock it out and also they push a button in and then standard the comments back to here so this is a perfectly use case for the internet of things if you click this button and then the data is going to stay in the back stay in the back to here so we can connect to back to the device and then this is command sent to device and the data is send sending incoming to the IOT platform now we change this code a little bit to make it to our usage we delete this one and a connect to let's knock the energy lid for this one please so in this way we get the instead of gather the x time data we will get or IOT data okay and when do the click in the name to hear so we also can add the IOT node so that it can send it back to the device send back to the device and we can using the bluemix and we can get the device ID and get the device type it is command and this is data is data the format is string okay we can stand up the data back let's take a look all right successfully deployed let's see if we can okay there's everything has been connected let's take a look of the website okay it's already changed see it's already changed to the JSON fire we get and if we click this and to see if the click is come back and it's coming here and it also it come back to to the oh we don't have an input file input yet so we need it to have our input and to get all right so device ID automatic okay at all we get to deploy okay we get the object come back so but anyway we are did a little bit changes we can take advantage of this very simple WebSocket examples
Info
Channel: Forest Lin
Views: 7,284
Rating: 4.0967741 out of 5
Keywords: WebSocket, Node-Red, IoT
Id: IYNFFSvT2p4
Channel Id: undefined
Length: 7min 52sec (472 seconds)
Published: Sun Sep 30 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.