Using GRV-CSERI ports from a program

We are integrating a device using a RS-485 connection, and we have installed a GRV-CSERI to do this.

I have some questions:

There are some operations that we want to perform on this device when the strategy is not running.

From the shell account, I can see the that devices /dev/ttySerMod0.0 – /dev/ttySerMod0.3 have been defined.

  1. Can I write a linux program to directly write to these devices?

  2. If a strategy has been loaded, are that strategy’s I/O settings used to specify the # wires, termination, and bias settings for the device. If not, how can this be done? (I have looked at this forum post: Configure Epic Serial Module GRV-CSERI-4 but I do not see this question addressed in that post).

  3. Also, the GRV-CSERI requires that a termination mode and a bias setting by specified as part of the configuration. I have read this blog post:
    that describe what termination and bias are. It is somewhat helpful. If we selected the “Termination” option, is this the equivalent of adding a 120 ohm resistor to the communication lines?

  1. Great question. I don’t know. Will try and see what I can find out.

  2. If a strategy has been loaded, the module will use those config settings. If a strategy has not been loaded, then you can configure the port type via groov Manage.

    It mentions in there that the termination option is 120 ohms.

I found a few things out and from that have inferred the answer is ‘should be possible’.

Here you can see the shell program ‘minicom’ receiving data from a GPS receiver sitting on my desk (it was the only serial device I could quickly put my hands on).

You can see I have set the baud rate to 9600, 8 data bits, No parity and 1 stop bit.
I did this from within Minicom. Since I can do it there, I am inferring that you should be able to set the comm port parameters from the Linux program.
Note that I still used groov Manage to set the serial port type (in my GPS case, RS-232).

Note also that /dev/ttySerModx.x is symbolically linked to ttyUSBx
If you do an ‘ls -la’ on the /dev directory, you can see that link. (This took me a hot minute to figure out why the ‘SerMod’ device was not working as expected. EDIT-Found out it was a typo, it works as expected using either the module or the mapped device).

(Note that my groov Serial I/O module is in position 3 on the rack).

EDIT. Found the ‘stty’ command.
This would be the way to change via a program the serial port settings.

IMPORTANT EDIT. I have found that if you run Node-RED and PAC Control with serial commands addressing the same serial port, you get undesired results. I would expect the same would happen if you tried to use another program to access the serial port at the same time as either of these two methods… In short, pick one method and use it exclusively.

1 Like

Thank you – I will try this out.

I am pulling my hair out with Modbus RTU and the GRV serial module via RS485

I got “somehwere” using the pac control modbus toolkit but not what I wanted. So I started playing with node red. Do the serial module TX and RX lights still light up when accessing the serial module from Node Red?

Another thing, I see the GROOV IO READ node does not support the serial module? Any reason for that?

Yes. The LED’s are hardware, they don’t care which software is addressing them.

The groov IO nodes are primary for talking directly to the IO points on EPIC or even more so RIO.
The serial module is already well supported with the Node-RED serial node which is the correct node to use in this case.
Install the node and click on add new, then click on the search;

The serial module will be found and you can configure the baud rate etc.

1 Like