00:00
Once you've powered up your groov RIO for the  first time and logged in with your new admin  
00:04
account there are a couple of additional tasks  you'll want to take care of to get the most out  
00:08
of your device one of those is installing and  configuring the groov i o nodes and starting  
00:13
to use node-red so we'll start by going to our  node-red menu and enabling the node-red runtime  
00:19
and then i'll go ahead and use this video to  show you how to install the groov RIO nodes  
00:23
how to configure them and how  to do some of the very basics
00:32
now here we can see i've enabled the node red  runtime and we can see that the cpu usage has  
00:37
calmed down you don't want to launch it right away  since node-red won't be ready but now that we can  
00:41
see that it's just running in the background  i can go ahead and open the node red editor  
00:46
right away we can see it opens a new  tab and i have this flow workspace here  
00:50
my node palette on the left hand side and my  info and debug panes here on the right hand side  
00:56
the next thing i wanted to do is add  the groove i o nodes to this palette  
01:01
so to do that i'll come up to the main menu in  the top right here and select manage palette  
01:06
here we can see all the nodes that are already  installed including the pre-installed core nodes  
01:10
that come with node-red right out of the box to  add a new node i will need an internet connection  
01:16
and once i have that i can just come over to this  install tab and search for anything i want to add  
01:21
so here i'll just type in groov io and  we can see the node right here so to  
01:26
add it i just click install confirm the  installation and wait for it to come down  
01:31
i shouldn't take on any extra tasks while it's  doing this since it's busy in the background but  
01:36
i can keep up with its progress by just selecting  view log right here and we'll see that it's coming  
01:40
down now we might see some warnings here pop up as  the node is installing but many of these are just  
01:46
precautionary and as long as the node comes down  they're not a problem so we'll just sit wait for  
01:52
the process to complete and we'll be able to use  our nodes without any problems so there we go we  
01:57
can see that the packages have been added and we  have a return code of zero meaning there were no  
02:02
errors we can also see this green pop-up saying  all the nodes that are added to our palette and  
02:07
if we close the node palette manager we can just  scroll down right here on the node palette and see  
02:11
that all the nodes were in fact successfully  added without needing to restart node red  
02:16
so let's drag one in starting at the top and begin  to configure it you can see as soon as you drag  
02:21
one in there's this red triangle at the top there  that means that there is no configuration yet so  
02:27
we'll go ahead and double click it and we can  see that we need to add a new groov i o device  
02:32
so i'll just select this pencil icon here and  we can see that we are brought to the default  
02:37
of localhost since node-red is running on the  rio that i want to read and write from right now  
02:43
i can't leave that as localhost but i could  communicate with other groov io devices as well  
02:48
now i just need to put in my api key this  application programming interface key essentially  
02:54
gives node-red permission to access the i o even  though they're running on the same device it's  
02:59
still a secure application and our io is actually  secure so we need to go ahead and put this api  
03:05
key in to find that i'll just go back to groov  manage go to the home screen and select accounts  
03:11
i could add an extra account here for node-red  specifically that way i could manage things  
03:16
separately but i'll just go ahead and use the  system-wide administrator key so now i just come  
03:22
down here highlight the entire api key and copy  it to my clipboard if this key ever does become  
03:28
insecure or leaked or anything like that i can go  ahead and generate a new key and any application  
03:34
that's using this will need to have that key  put in again so this is a good security option  
03:40
but keep in mind where you put the key before  you generate a new one since it will need to  
03:44
be replaced so now that i have that key copied  to my clipboard i'll just go back to node-red  
03:50
paste that into my api key and click add now we  can see i have my localhost device configured and  
03:57
i just need to figure out the data type module  index and channel index now if you know exactly  
04:02
what you want to read in you can probably end the  video here but i'm going to go ahead and check  
04:06
what options i have available and we'll see how  to configure this so i'll go back to groov manage  
04:11
leave the account selection screen and go into i  o channels here we can see i already have some i  
04:17
o channels configured and i'm going to go ahead  and select this top button digital input you can  
04:22
see that it's on channel 0 and we are on module  0 since it's a groov rio with only one module  
04:29
so this button is going to be what i want  to read in so i'll go back to node red i'll  
04:34
leave it as digital state change since  i'm reading in a digital button press  
04:38
i'll put in the module 0 the channel number of  zero and i'll give this a name like read button  
04:44
so now i can just click done and we'll see that  red triangle disappeared we just have the blue  
04:49
circle meaning we haven't deployed yet now i want  to be able to see this output so i'll go ahead and  
04:54
push and hold left ctrl left click on my workspace  and that'll show this quick add menu where i can  
04:59
just drop in a debug node and wire that in right  away now i just click deploy and we'll see right  
05:06
away in our debug we have a notification that the  button is off if i go ahead and press the button  
05:11
we'll get the value true and if i disable it again  we get the value false so it's working right away  
05:17
now there are more options besides just this input  node that scans the value and lets us know when it  
05:23
is updated i can also read the value whenever i  want and you'll notice as soon as i drag this in  
05:28
i again do get that red triangle but if i double  click this node and drop down the device groov io  
05:35
device we can see that the local host is saved  this configuration will work between all groov  
05:40
i o nodes i bring in we only have to do the api  key that one time if you want to see where that  
05:46
configuration is saved or make any changes to  it go ahead and come up to the top right menu  
05:50
and select configuration nodes you can see here  is my groov RIO device it is used on two nodes  
05:56
denoted by the number two there and if i select  it we can go ahead and see all of the nodes that  
06:01
are using it if i want to make any changes to it  i just double click it and we'll see this is the  
06:06
standard pop-up here where i could replace the  api key or make any other changes i need to do  
06:11
so i'll just go ahead and close  this and we'll see how to use this  
06:14
groov io read node this one rather than regularly  scanning the output requires input in order to  
06:21
read what value we're looking for so i'll go  back to my i o channels and we'll read in this  
06:27
analog input on channel 3. we can see this  is a temperature reading and that's what i  
06:31
want to pull in but only when i specifically  inject into the flow that i want to read it  
06:36
so i'll go back to node-red select my  digital channel and i'll change that  
06:42
to analog channel since i want to read in that  analog temperature value i'll put in my module  
06:47
number of zero my channel number of three and  we'll make this something like read temperature
06:55
so now when i click done we'll also have to add  an input node on this so this time i'll scroll  
07:01
up to the top drag in an injector node wire that  in drag in a debug node and wire that in as well  
07:09
so now when i click deploy and switch back to my  debug pane i'll just clear that up so i can see  
07:14
this clearly we'll see that i'm not seeing the  temperature at all but when i inject there we  
07:19
go that's the current temperature and now that  it's in node red i can use it however i want  
07:25
now as well as reading data in and  just showing it in the debug pane  
07:28
or moving around between different nodes  i can also write to different outputs so  
07:32
i'll also bring in a groove io write node and  let's select a channel that we can write to  
07:38
now we'll just go back and we'll use this blue  ring led digital output on channel 4 in order  
07:44
to demonstrate this writing so i'll drag that  off to the side we'll double click my groov i  
07:49
o write node and we'll select our localhost  configuration and we do want to leave it as  
07:55
the digital output channel state since that's what  we want to write at this point i'll go ahead and  
08:00
put in my module index of 0 my channel index of  4 and we'll make this something like toggle light  
08:08
so now that that's all filled in i'll just click  done and we'll need to inject something here as  
08:12
well so i'll make a copy of this inject node and  of this debug node but this time we don't want  
08:18
to inject something random like a timestamp  we want to inject the value we want to write  
08:23
in this case we can just go ahead and click done  select the groov write node we can come over  
08:29
to the info tab and here we can see the values  that it's expecting here we can see to turn on  
08:33
the channel we need to send either true or on and  to turn it off we need to send false or off so oh  
08:41
that's exactly what i'll do i'll make a copy of  this node here and we'll switch that from instead  
08:45
of sending the timestamp we'll switch it to the  boolean value true and we'll switch the other one  
08:51
to the boolean value of false so we'll just use  this drop down here select false and wire these in  
08:59
so now our toggle light will be controlled by  these true and false injector nodes and we'll  
09:03
be able to confirm it with this message payload  output here in this debug node so now i can  
09:10
go ahead and click deploy and when i bring in my  value here we can see that it's turned off right  
09:17
now we'll toggle it true and we can see that  the state has turned to true and we'll toggle  
09:21
up false and we can see our state has changed to  false so now i can bring in any other groov i o  
09:28
nodes use that same configuration i don't have  to put my api key in again and i'm easily able  
09:33
to read and write different i o points on the  groov RIO from node red right out of the box