00:04
Good Day. In this video we're going to take
a look at using a serial to USB
00:09
converter on the groov EPIC. By using
this RS-232 to USB converter we're able
00:16
to read in serial data by the groov
EPIC USB port. Now to show how this works
00:22
I'm going to be using this groov EPIC
Learning Center. It's great for learning
00:26
more about groov EPIC or for doing
proof-of-concept projects. You can get
00:31
yours by visiting opto22.com. I'm also
going to be using this GPS device that
00:38
outputs an RS-232 data stream. To get
your device details and the check that it's
00:44
ready to go you first visit the groov
Manage home screen and then click on
00:49
system and then serial devices.
We currently show none,
00:56
but if we plug in the converter we will
see one serial device is added to the
01:04
list. Now what sort of converter can you
use? Well it's important that it's an
01:08
authentic FTDI device. And you can use an
RS-232 RS-422 or an RS-485 converter. And,
01:17
if you need more than just two you can
use a powered USB hub to expand the
01:23
number of converters that you can
connect. Now once you plug the converter
01:27
in make a note of the device name and
port number as we'll need them in a
01:32
moment. What you want to do with your
data will determine your next move. For
01:38
example you could send the serial data
to a cloud service or to an MQTT broker,
01:43
via Node-RED, or you could use the serial
data in a control program like PAC
01:48
Control. Note that with both Node-RED and
PAC control if you change the port the
01:55
adapter is plugged into you will need to
change their configuration. So be sure
01:59
and plug the converter back into the
same USB port if you disconnect it for
02:04
any reason. With that said let's now take
a look at how we set up each option. fFor
02:11
Node-RED
we first create a new flow workspace.
02:14
Then we simply drag in a serial node
into the workspace and to see it's output
02:20
will use a debug node. Double-click on
the serial node to configure it.
02:26
Type in the device name that you got a
moment ago from groov Manage and enter
02:32
the baud rate, parity, and stop bits. For
my GPS device it's going to be 9600, 8 none,
02:40
and one.
Connect the two nodes with a wire. Hit
02:45
deploy and you're done. You can now see
your serial data flowing in the debug
02:51
tab. Where you go from here will be
determined by your application. Now for
02:57
PAC Control we first have to configure
our comm handle so here we are in
03:01
Configure mode and from the strategy
tree right click on communication handle
03:06
and select add. Now you can name the comm
handle anything you like. I'm simply
03:11
going to name it CH for comm handle and
then the name of the device: GPS. Next is
03:17
the string that will set up the
communication properties for the device
03:21
you first need the address of the device
so it's ser; and then the port
03:27
number you noted a moment ago from
groov Manage. After the port number set
03:32
the baud rate and so on. So here in my
case the full initialization string is
03:37
ser; zero,
9600, none, 8, 1 For all
03:46
the parameters that the comm handle can
support check out the PAC Control users
03:50
guide
now here we are looking at data coming
03:53
from the GPS module. When it comes to
programming the flowchart there are lots
04:00
of options and different ways to write
the code depending on your application.
04:03
For more information on how to do this
check out training.opto22.com till next