Rachel Carson Navproc-Logr Simulator
First, let's look at a high level diagram of the simulator for the Rachel Carson. There are basically four main hardware components in the simulator. They are:
- Intel NUC computer running Windows 10 and some simulation software that pushes generated signals to the local COM (serial) ports
- Moxa NPort 16 Port RS-232 Serial Device Server that is connected to the NUC mentioned above via Windows drivers.
- Digi Connect TS16 that takes in physical connections from the outputs of the Moxa NPort.
- Intel NUC computer running navproc/logr software that has the TS16 port mounted virtually as /dev/tty devices
The physical simulator hardware setup looks like the following:

Intel NUC Signal Generator
The first component is an Intel NUC computer running Windows 10 that is named richnuc3.shore.mbari.org. On this computer, there is one application built with Visual C++ that is generating Octans simulation data. The serial port configuration for the Octans simulation is in a file named imbat_sim in the C:\Program Files\octansSim\octansWrite folder. There are other processes that are reading from example data files and sending that data over COM ports using an application built with XOJO. The XOJO Serial Data Simulator is a desktop application that was built using the source code located here in BitBucket. Essentially, you select a text file and say "go". It reads a line from the text file and pushes through the serial port. It's only one direction and sends messages out like many instruments do. When it gets to the end of the file it starts back at the top.
In order to get to this computer, you will use Microsoft's Remote Desktop and there is a local 'ops' account so that more than one person can manage these simulation processes. Please check with Mike Risi or Kevin Gomes for the login information.
Moxa NPort 16
In order to provide support for multiple serial ports on the richnuc3 machine, we use a Moxa NPort 5610 which can then provide virtual COM ports. On the Windows machine, you install the NPort Driver Manager software which allows you to register the Moxa's serial ports via IP address to different COM ports on the Windows machine. The simulator processes can then write to them like they are local serial ports.
You can find the NPort web page here
Digi TS 16
The next in line is a Digi TS 16 terminal server. The serial cables from the Moxa are routed to the terminal server which is then virtually mounted on the computer that is running the navproc and logr code.
The webpage for the Digi TS 16 terminal server can be found here.
Intel NUC Corenav-sim
The last component is an Intel NUC machine that is running Ubuntu 20.04. As part of the setup process (see below), drivers are installed in Ubuntu that configure the TS 16 ports to show up as /dev/ttyXX ports that can then be read from. The navproc processes are then configured to read the data streams from those ports.
Signal Connections
Signal Details
| Simulated Device | RichNUC3 Process | Protocol/COM Port | Baud Rate | Data Bits | Stop Bits | Parity | Moxa IP Address | Moxa Port | Notes |
|---|---|---|---|---|---|---|---|---|---|
| IMBat | imbatSim.exe | COM 1 | 9600 | ? | ? | ? | 134.89.10.246 | 1 | The executable is located in C:\Program Files\octansSim\octansWrite and there is a file named imbat_sim.ini where the communication parameters can be set |
| GPS | XOJO Serial Data Simulator | COM 2 | 9600 | 8 | 1 | None | 134.89.10.246 | 2 | This simulator is reading lines from the file C:\Program Files\SerialDataSimulator\testdata\nmeaGPS.dat |
| Seabird CTD | XOJO Serial Data Simulator | COM 3 | 9600 | 8 | 1 | None | 134.89.10.246 | 3 | This simulator is reading lines from the file C:\Program Files\SerialDataSimulator\testdata\newdigiq.2950_3600.dat |
| COM 4 | 134.89.10.246 | 4 | |||||||
| COM 5 | 134.89.10.246 | 5 | |||||||
| COM 6 | 134.89.10.246 | 6 | |||||||
| COM 7 | 134.89.10.246 | 7 | |||||||
| COM 8 | 134.89.10.246 | 8 | |||||||
| COM 9 | 134.89.10.246 | 9 | |||||||
| COM 10 | 134.89.10.246 | 10 | |||||||
| COM 11 | 134.89.10.246 | 11 | |||||||
| Digiquartz | XOJO Serial Data Simulator | COM 12 | 9600 | 8 | 1 | None | 134.89.10.246 | 12 | This simulator is reading lines from the file C:\Program Files\SerialDataSimulator\testdata\seabirdCTD.txt |
| Winfrog | XOJO Serial Data Simulator | COM 13 | 9600 | 8 | 1 | None | 134.89.10.246 | 13 | This simulator is reading lines from the file C:\Program Files\SerialDataSimulator\testdata\winfrog.txt |
| Ship Gyro | XOJO Serial Data Simulator | COM 14 | 9600 | 8 | 1 | None | 134.89.10.246 | 14 | This simulator is reading lines from the file C:\Program Files\SerialDataSimulator\testdata\recentRCSN_SHIPGYRO.txt |
| Ventana CSP | XOJO Serial Data Simulator | COM 15 | 9600 | 8 | 1 | None | 134.89.10.246 | 15 | This simulator is reading lines from the file C:\Program Files\SerialDataSimulator\testdata\recentCSPMessages.txt |
| COM 16 | 134.89.10.246 | 16 |
Corenav-sim Setup
To setup an Intel based NUC to run the navproc and logr processes for the Rachel Carson simulator, the following steps were taken.
- Obtain an Intel based NUC (we used model NUC8i7BEH)
- First, boot to the NUC BIOS and set everything to factory defaults and disable Secure Boot
- We installed Ubuntu 20.04 using a USB stick with the
ubuntu-20.04.1-desktop-amd64.isofile on it. - Do a standard install
- Download updates after installing ubuntu to make sure everything is up to date
- Install any third-party drivers for graphics and WiFi
-
Install the following packages using
sudo apt-get install-
SSH Server: to allow incoming ssh connections
sudo apt-get install openssh-server -
Diff GUI: to get the meld diff GUI
sudo apt-get install meld -
CVS source control: to get CVS source control
sudo apt-get install cvs -
ZMQ development libraries: to support sending ZMQ messages
sudo apt-get install libzmq3-dev -
GIT source control: to check out and deal with source code repositories
sudo apt-get install git -
MODBUS development libraries
sudo apt-get install libmodbus-dev -
Standard GNU development tools to get make, gcc, g++ etc.
sudo apt-get install build-essential -
Install glib 2 for procman/botproc
sudo apt-get install libglib2.0-dev -
CMake build process software
sudo apt-get install cmake -
Windowing Shell: support for Digi RealPort GUI dgrp_gui
sudo apt-get install wish -
Lib ncurses: support for Digi RealPort driver build
sudo apt-get install libncurses5-dev libncursesw5-dev -
NcFTP file transfer: for the nightly xfer of data to shore
sudo apt-get install ncftp -
Net Tools network diagnostic utils to check port conflicts between applications
apt-get install net-tools -
Install the Python 2 development libraries
sudo apt-get install python2-dev -
Configure Python alternatives
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1 sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2 -
Choose python2 as default
sudo update-alternatives --config python
-
-
Next, we need to add ops to dialout group and update ~/.profile
-
Open the /etc/group file and add the ops user to the dialout group
proxy:x:13: kmem:x:15: dialout:x:20:ops fax:x:21: voice:x:22: -
Add the following environment setting to ~/.profile
# User specific environment and startup programs # add navproc bin path PATH="$PATH:/home/ops/CoreNav/navproc-process/bin/sim" # The LCM URL is only set in the navproc-process *.ini # file and used by all processes and loggers at startup export LCM_DEFAULT_URL=NOT_SET alias gh='history | grep' alias ge='env | grep' alias gp='ps ax | grep' alias goback='cd $OLDPWD'
-
Note
it's necessary in Terminal to check, Run command as login shell under Preferences -> Profiles -> [profile name] -> Command
- Configure More Settings
- Open the gnome-control-center also called Settings in the Application Menu and set the default user 'ops' to automatic login
- In the Settings -> Power, disable Blank Screen, Wi-Fi and Bluetooth
- Set update policy
- If deploying on a sea going vessel open the
Software and Updatesapp and configure the Updates Tab to more restrictive manual settings. This will reduce network traffic and stop automatic updates from interrupting logging. We do this on the simulators as well to make sure we are as close as possible to the ship configuration.
- If deploying on a sea going vessel open the
-
Set up time synchronization (if you need more details, consult the systemd-timesyncd.service man page
-
Display status of timesyncd
systemctl status systemd-timesyncd -
Stop the timesyncd
systemctl stop systemd-timesyncd -
Start timesyncd
systemctl start systemd-timesyncd -
Add the following lines to /etc/systemd/timesyncd.conf
[Time] # <https://mww.mbari.org/is/howto/network/timesynch> # Shore NTP=time-sh1.shore.mbari.org time-sh2.shore.mbari.org time-sh3.shore.mbari.org # Rachel Carson #NTP=time-rc1.rc.mbari.org time-rc2.rc.mbari.org # Western Flyer #NTP=time-wf1.wf.mbari.org time-wf2.wf.mbari.org time-wf3.wf.mbari.org FallbackNTP=ntp.ubuntu.com
-
Note
Comment out the time servers that don't apply to the deployment platform. For example comment out Rachel Carson and Western Flyer if your system will be used on Shore.
- Configure Screen Sharing if remote desktop using VNC is desired
- Enable screen sharing in settings
- Disable encryption for VNC connections using gsettings
gsettings set org.gnome.Vino require-encryption false
Note
while the authentication credentials are encrypted the subsequent data exchange of the session is not encrypted and may be intercepted by third parties.
- Install AdoptOpenJDK 8
Warning
lcm-spy does not work well with openjdk-8-jdk. It hangs and has issues with refreshing the graphics. AdoptOpenJDK's version adoptopenjdk-8-hotspot seems to resolve these issues.
- The installation instructions can be found here
-
The install was performed with apt-get
sudo apt-get install adoptopenjdk-8-hotspot -
Check the installs after by running
java -version javac -version -
To switch between installed java or javac use update-alternatives
sudo update-alternatives --config java sudo update-alternatives --config javac -
Next, install LCM (build instruction are located here)
- Grab the source code
- Put the source code in the
~/Libsdirectory. - Change into the source code directory
- Create
builddirectory in lcm-X.Y.Z source dir by runningmkdir build - Change into the build directory
- Run
cmake .. - Then run
make clean - Followed by
make - Then, run
sudo make install - And finally run,
sudo ldconfig
- Next, install libbot2
- Checkout the navproc-packages repository.
-
Install GTK 2 using
sudo apt-get install ./python-gtk2_2.24.0-6_amd64.deb -
Clone thet libbot2 repo into the
~/Libsdirectorygit clone https://github.com/libbot2/libbot2.git -
Edit the tobuild.txt file and comment out the following lines:
#bot2-vis #bot2-lcmgl #bot2-param #bot2-frames -
Build and install to
/usr/localby runningsudo make BUILD_PREFIX=/usr/local -
Some additional notes:
make uninstallshould uninstall /usr/local version-
Starting with lcm-1.4.0 the support jars for lcm-spy are not packaged inside lcm.jar they are located in /usr/local/share/java. The bot-spy script file needs the following line added for compatibility,
CLASSPATH=$CLASSPATH:/usr/local/share/java/jchart2d-3.2.2.jar: \ /usr/local/share/java/xmlgraphics-commons-1.3.1.jar: \ /usr/local/share/java/jide-oss-2.9.7.jar -
The original bot-spy script was copied to /usr/local/bin/bot-spy.org
-
To connect the Digi TS 16 Terminal Server, you will need to do these steps to set it up:
- Download the standalone Java application which runs under Linux/Windows using
curl ftp://ftp1.digi.com/support/utilities/addpclient.zip - Unzip the file using
unzip addpclient.zipwhich will create the`AddpClient.jarfile. - Start the application by running
java -jar AddpClient.jarwhich sill open a UI which should find any TS 16's that are on the network
- Click on the row for the TS 16 you will be connecting to the navproc machine and then click
Configure network settings
- Now configure the TS 16 network in the way that is appropriate. For this case, we used a static IP address, but on the boats I believe we will use DHCP and just use the name of the device.
- If you made changes to the device, click on
Restart Deviceand wait for the TS 16 to restart. - Once restarted and/or ready, click on the TS 16 in the UI, then click on
Open web interface - This will open a web browser and login using the
rootaccount (consult engineering/operations for the password) - Click on
Network - Click on
Advanced Network Settingsand assign a hostname for the terminal server and set the DNS server IP addresses (consult with I.S.), then clickApply
- Download the standalone Java application which runs under Linux/Windows using
- Now, it was time to install the RealPort drivers that will connect to the terminal server and mount the 16 serial ports as
/dev/ttydevices.- In a browser windows, go to https://www.digi.com/support/cpts8
- Scroll down and click on
RealPort Driver - In the dropdown box, select
Linux - Click on
downloadbelow the .tgz version which will download a .tgz file to your computer - Open a terminal window and unpack the downloaded file by running
tar -xzf 40002086_AB.tgzwhich will create adgrp-1.9directory. - I moved the dgrp-1.9 directory from the Downloads folder to the ~/Libs directory and then cd'd into that directory.
- Once in that directory I ran
./configure - Then run
make all - Then run
sudo make install - Then run
sudo make postinstall
- Now, it is time to configure the serial ports. We do this by mapping the ports using
sudo dgrp_cfg_node init -v -e never a 134.89.10.99 16 -
After this, the ports should show up under /dev. Here is the listing for this installation
lrwxrwxrwx 1 root root 12 Oct 24 17:05 ttya00 -> tty_dgrp_a_0 lrwxrwxrwx 1 root root 12 Oct 24 17:05 ttya01 -> tty_dgrp_a_1 lrwxrwxrwx 1 root root 12 Oct 24 17:05 ttya02 -> tty_dgrp_a_2 lrwxrwxrwx 1 root root 12 Oct 24 17:05 ttya03 -> tty_dgrp_a_3 lrwxrwxrwx 1 root root 12 Oct 24 17:05 ttya04 -> tty_dgrp_a_4 lrwxrwxrwx 1 root root 12 Oct 24 17:05 ttya05 -> tty_dgrp_a_5 lrwxrwxrwx 1 root root 12 Oct 24 17:05 ttya06 -> tty_dgrp_a_6 lrwxrwxrwx 1 root root 12 Oct 24 17:05 ttya07 -> tty_dgrp_a_7 lrwxrwxrwx 1 root root 12 Oct 24 17:05 ttya08 -> tty_dgrp_a_8 lrwxrwxrwx 1 root root 12 Oct 24 17:05 ttya09 -> tty_dgrp_a_9 lrwxrwxrwx 1 root root 13 Oct 24 17:05 ttya10 -> tty_dgrp_a_10 lrwxrwxrwx 1 root root 13 Oct 24 17:05 ttya11 -> tty_dgrp_a_11 lrwxrwxrwx 1 root root 13 Oct 24 17:05 ttya12 -> tty_dgrp_a_12 lrwxrwxrwx 1 root root 13 Oct 24 17:05 ttya13 -> tty_dgrp_a_13 lrwxrwxrwx 1 root root 13 Oct 24 17:05 ttya14 -> tty_dgrp_a_14 lrwxrwxrwx 1 root root 13 Oct 24 17:05 ttya15 -> tty_dgrp_a_15 crw------- 1 root root 235, 0 Oct 24 17:05 tty_dgrp_a_0 crw------- 1 root root 235, 1 Oct 24 17:05 tty_dgrp_a_1 crw------- 1 root root 235, 10 Oct 24 17:05 tty_dgrp_a_10 crw------- 1 root root 235, 11 Oct 24 17:05 tty_dgrp_a_11 crw------- 1 root root 235, 12 Oct 24 17:05 tty_dgrp_a_12 crw------- 1 root root 235, 13 Oct 24 17:05 tty_dgrp_a_13 crw------- 1 root root 235, 14 Oct 24 17:05 tty_dgrp_a_14 crw------- 1 root root 235, 15 Oct 24 17:05 tty_dgrp_a_15 crw------- 1 root root 235, 2 Oct 24 17:05 tty_dgrp_a_2 crw------- 1 root root 235, 3 Oct 24 17:05 tty_dgrp_a_3 crw------- 1 root root 235, 4 Oct 24 17:05 tty_dgrp_a_4 crw------- 1 root root 235, 5 Oct 24 17:05 tty_dgrp_a_5 crw------- 1 root root 235, 6 Oct 24 17:05 tty_dgrp_a_6 crw------- 1 root root 235, 7 Oct 24 17:05 tty_dgrp_a_7 crw------- 1 root root 235, 8 Oct 24 17:05 tty_dgrp_a_8 crw------- 1 root root 235, 9 Oct 24 17:05 tty_dgrp_a_9 -
Once you have some data coming into one of these ports, you can verify the data by using the
dincutility. For example, we have NMEA GPS data coming into port 2 so if you runsudo dinc /dev/ttya01(you can use~xto exit dinc)ops@corenav-sim:dev$ sudo dinc /dev/ttya01 ------ DINC --- port=/dev/ttya01 ------ 9600 BAUD 8 NONE 1 SWFC=ON HWFC=OFF CAR=OFF DTR=ON RTS=ON CTS=ON DSR=OFF Type ~? for help. $GPBOD,,T,,M,,*47 $GPVTG,328.5,T,313.7,M,0.0,N,0.0,K,A*29 $HCHDG,75.4,,,14.8,E*22 $GPRTE,1,1,c,*37 $GPRMC,172521,A,3648.01,,24.9$GPGGA,172403,3648.0987,N,12147.3019,W,1,08,1.0,2.5,M,-29.2,M,,*7C $GPGSA,A,3,03,,09,11,14,18,19,21,,,31,,0.0,1.0,1.0*3D $GPGSV,3,1,12,03,35,238,19,06,37,223,26,09,17,052,36,11,13,313,00*77 $GPGSV,3,2,12,14,72,184,20,18,33,065,34,19,39,287,17,21,25,125,22*72 $GPGSV,3,3,12,22,67,014,17,27,06,034,17,31,02,170,19,32,07,265,00*73 $GPGLL,3648.0987,N,12147.3019,W,172403,A,A*53 $GPBOD,,T,,M,,*47 -
In order to make sure the ports and permissions survive reboots we need to first edit the
/etc/udev/rules.d/10-dgrp.rulesfile by runningsudo vi /etc/udev/rules.d/10-dgrp.rulesso that looks like the following: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"Note
Not that
, GROUP="dialout", MODE="0666", OPTIONS="last_rule"was added to the first line and the next two lines were commented out. -
Next, we will use the SysVinit style start service model to restart the ports at linux run level 3 during boot. First, change to the correct directory by running
cd /etc/rc3.d. - Then create a link to run the daemon at level 3 by running
sudo ln -s ../init.d/dgrp_daemon S95dgrp_daemon - Then reboot using
sudo shutdown -r nowand once the machine comes back up, you should be able to run the samedinccommand without sudo privs. - Now that the serial ports are configured, it's time to move on to installing the navproc and logr software.
- Change into the top level directory.
- One thing to note is that when this was all done on the simulator, ssh keys were not used. A direct login was used using the BitBucket account
mrisiMBARI@bitbucket.org. Moving forward, this should be done with ssh keys and is documented in the David Packard Simulator Setup Instruction. - Back in terminal, I changed back to the home directory using
cdand then created a new directory by runningmkdir CoreNav. -
I cd'd into the CoreNav directory and then checked out the repositories I needed by running the following
git clone git@bitbucket.org:mbari/navproc-common.git git clone git@bitbucket.org:mbari/navproc-logger.git git clone git@bitbucket.org:mbari/navproc-process.git git clone git@bitbucket.org:mbari/navproc-packages.git -
Now that we have the correct branch checked out, we can build the navproc software by running the following
cd navproc-process make cd .. cd navproc-logger/src/datalogger make -
Everything is now installed and ready to go, you just have to choose the correct 'bin' directory to run the command from. For the Rachel Carson simulator, you will want to run the commands from the
~/CoreNav/navproc-process/bin/simdirectory. - To start the navproc processes and the loggers, just run
./navproc_start - To monitor the processes with a GUI, run
./navproc_gui - To stop the navproc and logger processes, run
./navproc_kill