Rachel Carson Installation
This section describes the installation process of the Core Nav and Core Logging systems on our ships.
Wiring
The first step in setting up this system is to wire all the various serial data streams to the terminal server panel on the boat.
Schematics
Below are images of the paper copies of the wiring guides that Rich Schramm put together while installing the system on the Rachel Carson (click on them for larger versions).
Serial Port Panels
And below are some pictures that were taken of the connections at the time of this writing (click on them for larger versions).
Serial Converters
Serial Broadcasters
The manuals for these serial broadcasting devices can be found here(PDF)
Configuration Documents
Installing Digi ConnectPort Terminal Servers
These instructions are for installing the software that will be used on the Core Nav/Logging machine to read from the serial ports that are connected through a Digi ConnectPort TS16 terminal server. Manuals for the servers can be found here(PDF)
Preliminary
Instructions to configure, install and test Digi ConnectPort TS16 for navprocs with Ubuntu “18.04 LTS” (64-bit). (From a new clean UBUNTU installation)
Warning
Record the mac address on the bottom of the digiport TS-16 before mounting in the rack !!!!
Below are the hostname and static IP’s etc as of 21Dec2017
| Name | Static IP | SubnetMask | Gateway | PrimaryDNS |
|---|---|---|---|---|
| wftermservera | 134.89.21.17 | 255.255.255.0 | 134.89.20.1 | 134.89.20.12 134.89.20.26 |
| wftermserverb | 134.89.21.18 | " | " | " |
| rctermserva | 134.89.22.61 | 255.255.255.0 | 134.89.22.1 | 134.89.22.28 134.89.22.43 |
| rctermservb | 134.89.22.62 | " | " | " |
| On-shore nonameA |
134.89.10.99 | |||
| On-shore nonameB |
134.89.10.100 |
If not previously installed during Ubuntu OS installation:
sudo apt-get install libncurses5-dev libncursesw5-dev
Reference: https://www.cyberciti.biz/faq/linux-install-ncurses-library-headers-on-debian-ubuntu-centos-fedora/
sudo apt-get install openssl
sudo apt-get install default-jre
Discover the Digi Connectport TS using its MAC Address
Download the stand alone Java application which runs under Linux and Windows from ftp://ftp1.digi.com/support/utilities/addpclient.zip to your ~/Downloads folder (if user=tiburon then /home/tiburon/Downloads)
cd ~/Downloads
gunzip AddpClient.zip
java –jar AddpClient.jar
Find the discovered unit by matching the mac address on the bottom of the digiport TS-16

- Click the 'Configure network settings' menu item.

- Set the desired static IP
- Click ‘Okay’
- Pick restart device
- Pick the ‘Open Web Interface’ menu item
- Log in with root (consult engineering for password)
- Choose 'Network'
- Choose 'Advanced Network Settings'
- Set DNS settings for WesternFlyer (or whichever network you are on).
- 'Apply’ changes

Download, Build and Patch the Digi Serial Port Drivers
- In browser – go to: http://www.digi.com/support/cpts8
- Navigate to ‘”Drivers”
- Choose to download “Realport Drver for Linux ver. 1.936, tgz version”
- Save to file in ~Downloads like (the default name is 81000137_X.tgz)
cd ~/Downloads
tar -xzf 81000137_X.tgz
cd ~/Downloads/dgrp-1.9
sudo make clean
Note
On 21Dec2017 installing on rcnavproc1 the above said said “No rule to make clean Stop.targets” . I just ignored and continued on…. -rschramm
sudo ./configure
sudo make all
sudo make install
sudo make postinstall
Before use, we need to patch a file to make port numbers come out 1-16 instead of 0-15
sudo vi /usr/bin/dgrp_udev
After line:
TMPPORT=`echo $STRING1 | /usr/bin/awk '{print $4}'`
Add the line: note carefully we are using the backwards single quote!
TMPPORT=`expr $TMPPORT + 1`
Warning
The spaces before and after the ‘+’ above are vital !!!
- Now save it.
Configure serial ports
We map two banks of serial ports using the IP number determined above (either ‘a’ or ‘b’ for terminal server bank 1 or 2):
sudo dgrp_cfg_node init -v -e never a 134.89.xx.xxx 16
sudo dgrp_cfg_node init -v -e never b 134.89.yy.yyy 16
Install the dinc terminal program and test a port
Note
21-Dec-2017 while installing on rcnavproc1: steps 1 thru 7 were not needed.. there was already a ‘dinc’ in /usr/bin. Probably because dgrp 1.9 make earlier built it for the HP proliants. Try ‘which dinc’ first and only do 1-7 if no dinc found. -rschramm
- Obtain copy of the dinc tar file and put in
/home/tiburon/Downloads(look in mbari cvs repo on moonjelly in/tiburon2/miscor just see rich for the file) sudo cp ~/Downloads/dinc.tar.gz /usr/local/sharecd /usr/local/sharesudo tar –zxvf dinc.tar.gzcd dincsudo makesudo ln –s /usr/local/share/dinc/dinc /usr/bin/dinc- install a loopback DB9 on first port of the FIRST moxa and run dinc
sudo dinc /dev/ttya16(sudo likely needed because haven’t set port permissions yet…)- type some chars to test and finally exit dinc with
~x - move the loopback DB9 to first port of the SECOND moxa and run dinc
sudo dinc /dev/ttyb16(sudo likely needed because haven’t set port permissions yet…)- type some chars to test and finally exit dinc with
~x
Make serial ports and permissions persist thru reboot
- First edit the file /etc/udev/rules.d/10-dgrp.rules
sudo vi /etc/udev/rules.d/10-dgrp.rules
- add the GROUP, MODE and OPTIONS tags to the tty_dgrp line
- comment out the other two.
KERNEL=="tty_dgrp*", PROGRAM="/usr/bin/dgrp_udev %k", SYMLINK+="%c", TAG="systemd", GROUP="dialout", MODE="0666”, OPTIONS="last_rule"
#KERNEL=="cu_dgrp*", PROGRAM="/usr/bin/dgrp_udev %k", SYMLINK+="%c", TAG="systemd"
#KERNEL=="pr_dgrp*", PROGRAM="/usr/bin/dgrp_udev %k", SYMLINK+="%c", TAG="systemd"
- Next we will use the SysVinit style start service model to restart the ports at linux runlevel 3 during boot:
cd /etc/rc3.d
sudo ln -s ../init.d/dgrp_daemon S95dgrp_daemon
- Reboot and retest that ports survive and have right permissions
sudo shutdown –r now
repeat loopback testing with dinc and a loopback WITHOUT SUDO this time!!
Misc. Notes
Useful doc at: http://www.ing.iac.es/~docs/external/realport/rp-linux-conf-managing-portservers-with-dgrp-config-node.html
/usr/bin/dgrp/config/file_locations
contains:
tiburon@navproc1:/etc/init.d$ more /usr/bin/dgrp/config/file_locations
DGRP_STORE="/etc/dgrp.backing.store"
DGRP_CFG="/usr/bin/dgrp/config/dgrp_cfg_node"
DGRP_PROCCONFIG="/proc/dgrp/config"
DGRP_DITTYCMDS="/usr/bin/dgrp/config/ditty.commands"
Note
~31Jan2017 When moved to ship (Western Flyer):
- Did not find a dhcp IP. So, I:
- Ran the jar app
- From with the jar app
- Did a ‘refresh’ and it found IPS on the 169.254.xxx.xxx range
- Select unit by mac address
- “configure Network Settings”
- Static
- Set the static IP, Subnet (255.255.255.0) and Gateway (134.89.20.1) (for western flyer)
- "Reset Device"
Managing PortServers with dgrp_cfg_node
Useful doc from: http://www.ing.iac.es/~docs/external/realport/rp-linux-conf-managing-portservers-with-dgrp-config-node.html
The dgrp_cfg_node tool is a command-line based configuration program designed to automate a number of steps which are required in order to enable the serial ports on a PortServer for general use. The path to the dgrp_cfg_node executable is /usr/bin/dgrp/config.
The dgrp_cfg_node tool has four modes of operation:
| Operation | Description |
|---|---|
| init operation | This operation can be used to add or reinitialize a PortServer in Linux. |
| uninit operation | This operation removes a PortServer from Linux. |
| stop operation | This operation stops a RealPort daemon. |
| start operation | This operation attempts to start a RealPort daemon. |
About the RealPort ID
The RealPort tools refer to individual PortServers with an ID. You must choose the ID to use for each PortServer, and this ID must be unique within your system. The dgrp_cfg_node init operation allows you to assign an ID to a PortServer.
A RealPort ID consists of one or two alphanumeric characters. The underscore character may be used in the ID.
Once an ID is assigned, the device files in the /dev directory which are created by the package will encode the ID into the device name. This allows one, by inspection, to determine which PortServer a particular device is associated with. For more information on the device naming, see About RealPort Devices.
The init Operation
The init operation has the following effects:
- If necessary, it will attempt to load the driver module.
- It will determine whether a daemon is already running for the specified node. If it is not running, it will start the daemon.
- It will create all necessary device files in the /dev directory. If a device file exists, the ownership and permissions are preserved.
The standard usage requires a command like:
dgrp_cfg_node init ID IPaddr ports
The parameters are defined as follows:
| Parameter | Definition |
|---|---|
| init | Indicates the operation being requested |
| ID | Assigns the supplied ID to the PortServer. A RealPort ID consists of one or two alphanumeric characters. The underscore character may be used in the ID. |
| IPaddr | Either an IP address or an IP name may be assigned to the daemon via this parameter. |
| nports | This parameter indicates the number of device files which should be created for this particular PortServer. This does not have to match the physical number of ports, but physical ports beyond the ports value specified will be unavailable. The maximum number of ports supported by the tool is 64. |
For further details, see the dgrp_cfg_node man page, which is installed with this package.
The uninit Operation
The uninit operation has the following effects:
- It will determine whether a daemon is running for the specified PortServer, and if so, will kill it.
- It will erase all information about this PortServer from its internal database (this distinguishes the behavior from that of stop; please see below).
The standard usage requires a command like:
dgrp_cfg_node uninit ID
The parameters are defined as follows:
| Parameter | Definition |
|---|---|
| uninit | Indicates the operation being requested |
| ID | Specifies which PortServer to unconfigure. |
Note
The command will fail if any ports are in use. Be sure to kill all applications using the Digi PortServer ports before uninitialization.
Note
Even if you have removed all of the PortServers you have previously registered with the driver, the dgrp_cfg_node utility will not unload the driver module.
For further details, see the dgrp_cfg_node man page, which is installed with this package.
The stop operation
The stop operation has the following effect:
- It will determine whether a daemon is running for the specified PortServer, and if so, will kill it.
- The RealPort software retains the information associated with this ID, so that the daemon can be restarted with a minimum of information.
The simplest usage requires one to execute a command with a form similar to:
dgrp_cfg_node stop ID
The parameters are defined as follows:
| Parameter | Definition |
|---|---|
| stop | Indicates the operation being requested |
| ID | Specifies which PortServer's daemon to stop. |
One might stop a daemon in order to change the daemon's parameters, like the IP address (i.e. stop, then restart with new parameters). For further details, please see the dgrp_cfg_node man page, which is installed with this package.
The Start Operation
The start operation determines whether a daemon is running for the specified node, and if not, will attempt to execute a daemon based on the supplied parameters.
The simplest usage requires one to execute a command with a form similar to:
dgrp_cfg_node start ID IPaddr
The parameters are defined as follows:
| Parameter | Definition |
|---|---|
| start | Indicates the operation being requested |
| ID | Specifies which PortServer's daemon to start. |
| IPaddr | The (possibly new) IP address or IP name to use when referring to the PortServer with the specified ID. |
For further details, see the dgrp_cfg_node man page, which is installed with this package.
Nav Proc
Navproc installation notes are kept in the BitBucket Repo here. Note that this installation needs to be performed before any of the subsequent installs can be performed.
logr Installation
The logr executable is actually part of the navproc-process repository that should already be checked out into the /home/ops/CoreNav directory. The build for logr is not done when the navproc-process build happens and is managed separately. These steps assume that navproc-common and navproc-process have already been cloned into the /home/ops/CoreNav directory.
-
clone the navproc-logger repository into the /home/ops/CoreNav directory using
cd /home/ops/CoreNav git clone https://username@bitbucket.org/mbari/navproc-logger.git -
This will create a navproc-logger directory
- Change into the correct directory using
cd navproc-logger/src/datalogger - Now build the logr executable by running
make cleanfollowed bymakewhich will create the logr executable in the same directory - Before install the new logr executable, you need to make sure all logr instances have stopped. They are normally started by cron, so edit the crontab to make sure the restarts of the logr executables is disabled. Then use 'ps -ef' to find the process id's of the logrs that are currently running and kill them. If the logrs are running, there is a good chance that the 'corelogging' software has already been installed and you can run the
/home/ops/corelogging/{platform}/scripts/stopLoggerscommand. - Once there are no logr instances running, you can run
sudo make install - If you disabled the logr startups in cron, you shoudl re-enable them now.
Core Logging
In order to install the core logging part of the data system, there are two repositories that are involved, the bcserver repository and the corelogging repository. This example is for the Rachel Carson and all this was done under the 'ops' account.
bcserver Installation
The first component to install for the logging side of the data system is something called 'bcserver'. It reads in UDP messages from the logr processes and caches the latest messages. It then provides a UDP server that clients can send messages to looking for data from the system. To install the bcserver:
- ssh into the Ubuntu server where this software will run.
- Make sure you are in the home directory (/home/ops)
- clone the bcserver repository into this directory (will give you a bcserver directory)
- cd into the bcserver directory.
- run
make clean - run
make - make sure the crontab won't try to start any bcservers if it's already installed
- use
ps -efto find the process id's for any bcserver processes and then kill them - run
sudo make installwhich copies the bcserver to the /usr/local/bin directory - enable cron jobs if you want to auto start them
corelogging Installation
Next, we need to install the 'corelogging' repository which contains all of the necessary scripts that are used to manage the logr, bcserver, ship position grabber and data pusher processes. To install this:
- ssh into the Ubuntu server where this software will run
- in the home directory (/home/ops), clone the corelogging repository using
git clone https://username@bitbucket.org/mbari/corelogging.git. This will create the '/home/ops/corelogging' directory. -
The core Ubuntu install should already include Python 3 (3.8.10 on corenav-sim, rcnavproc1/spare, and 3.5.2 on wfnavproc1). For the ship position grabber and data pusher, we need to also install the capability of running python processes in a python virtual environment. That means we need to install virtualenv using
sudo pip install virtualenv. In order to install virtualenv, it's likely that you will need to install pip. To install both run:sudo apt install python3-pip sudo pip3 install virtualenv -
Next, we need to create a virtualenv with the proper libraries in the corelogging checkout by running:
cd /home/ops mkdir venvs cd venvs mkdir corelogging cd corelogging virtualenv . source ./bin/activate pip install pika deactivate -
Next, you need to create a /home/ops/.netrc file (or copy from another machine) and put in the name of the RabbitMQ server along with the username and base64 encoded password. It would look something like this:
machine amqp_hostname login amqp_username password xxxxxxxxxxxxx -
Once you have created this file, you need to run
chmod og-rw /home/ops/.netrc -
Next, a Perl module needs to be installed manually that is required by the ship to shore FTP script. To install this:
cd /home/ops/corelogging/common/Net-Ping-External perl Makefile.PL make make test sudo make install -
You can then cd into the
/home/ops/corelogging/[rc|sim|wf]/scriptsdirectory and runperl pingtest.perlto make sure it can see the FTP server OK. - Now, cd into the
/home/ops/corelogging/common/dm-to-amqpdirectory. - Copy the correct config.json.X template for the machine you are configuring this for and name the new file config.json.
- Edit the config.json file and add the username and password for the RabbitMQ server where messages will be published and double-check the rest of the settings.
- Now you need to cd into the
/home/ops/corelogging/[rc|sim|wf]/scriptsdirectory depending on which one you are configuring - Most everything with corelogging is managed through the crontab. In order to kick everything off, you need to enable the crontab by running
crontab my_cron_with_logging. This will set up all the proper cronjobs that start all the appropriate processes.
Test
It's a good idea to test out the ship position grabber once everything else is up and running. To run a quick test, you can run:
cd ~
/home/ops/corelogging/common/shippositiongrabber/runShipPositionGrabber ship-position-grabber.py messaging.shore.mbari.org trackingvhost test_ship /home/ops/corelogging/sim/logs rcnavproc1.rc.mbari.org 54003
You can verify the locations made it through to the tracking database by running the following:
ssh odssadm@normandy8.mbari.org
odssadm@normandy8.mbari.org's password:
[odssadm@normandy8 ~]$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
abf34b3c4b0f docker.io/mbari/odss:1.0.3 2 months ago Up 4 weeks ago 0.0.0.0:3000->3000/tcp odss-server
ecb4f462b0a7 docker.io/mbari/tracking:1.0.4 /bin/sh -c /run.s... 2 months ago Up 3 weeks ago 0.0.0.0:8081->80/tcp tracking-clients
644bf5e657ef localhost/mbari/odss-mongodb:latest mongod 2 months ago Up 4 weeks ago 0.0.0.0:27017->27017/tcp mongodb
b852c1858e15 localhost/mbari/mbari-tracking:latest postgres 2 months ago Up 3 weeks ago 0.0.0.0:5432->5432/tcp mbaritracking
e85fbff9d270 localhost/mbari/odss-mapserver:latest /usr/local/bin/st... 2 months ago Up 4 weeks ago 0.0.0.0:8080->80/tcp mapserver
9d25a6a0426d docker.io/unidata/thredds-docker:4.6.15 catalina.sh run 2 months ago Up 4 weeks ago 0.0.0.0:8180->8080/tcp thredds
708f54b2e614 localhost/mbari/odss-erddap:latest catalina.sh run 2 months ago Up 4 weeks ago 0.0.0.0:8280->8080/tcp erddap
[odssadm@normandy8 ~]$ podman exec -it ecb4f462b0a7 /bin/bash
[root@ecb4f462b0a7 /]# cd /data/logs
[root@ecb4f462b0a7 logs]# ll
total 479641
-rwxrwxrwx 1 root 65534 365127582 Feb 17 18:40 amqp-consumer-ais.log
-rwxrwxrwx 1 root 65534 207356 Feb 17 18:35 amqp-consumer-auvs.log
-rwxrwxrwx 1 root 65534 653612 Feb 17 18:38 amqp-consumer-drifters.log
-rwxrwxrwx 1 root 65534 5737767 Feb 17 18:36 amqp-consumer-gliders.log
-rwxrwxrwx 1 root 65534 203764 Feb 17 17:43 amqp-consumer-moorings.log
-rwxrwxrwx 1 root 65534 18217923 Feb 17 18:40 amqp-consumer-ships.log
tail -f amqp-consumer-ships.log
consumer.persist_message(): ship,R_CARSON,1613587083.57,36.802177,-121.787199,grabUDPShipPosition.py,,,2021-02-17T18:38:03Z
consumer.persist_message(): ship,W_FLYER2,1613587085.42,36.802402,-121.787055,grabUDPShipPosition.py,,,2021-02-17T18:38:05Z
consumer.persist_message(): ship,W_FLYER,1613587086.13,36.802402,-121.787055,grabUDPShipPosition.py,,,2021-02-17T18:38:06Z
consumer.persist_message(): ship,paragon,1613587088.82,36.793095,-121.863785,grabAISpositions.py,338186132,,2021-02-17T18:38:08Z
consumer.persist_message(): ship,paragon,1613587177.56,36.793545,-121.863235,grabAISpositions.py,338186132,,2021-02-17T18:39:37Z
consumer.persist_message(): ship,R_CARSON,1613587203.90,36.802181,-121.787199,grabUDPShipPosition.py,,,2021-02-17T18:40:03Z
consumer.persist_message(): ship,W_FLYER,1613587205.52,36.802402,-121.787055,grabUDPShipPosition.py,,,2021-02-17T18:40:05Z
consumer.persist_message(): ship,W_FLYER2,1613587205.82,36.802402,-121.787055,grabUDPShipPosition.py,,,2021-02-17T18:40:05Z
consumer.persist_message(): ship,paragon,1613587208.17,36.793713,-121.862442,grabAISpositions.py,338186132,,2021-02-17T18:40:08Z
consumer.persist_message(): ship,paragon,1613587238.04,36.794037,-121.861755,grabAISpositions.py,338186132,,2021-02-17T18:40:38Z

















