Simulator Development
XOJO Simulator
The XOJO Serial Data Simulator is a desktop application that was built using XOJO whose source code is located in BitBucket. You select a text file and say "go". It reads a line from the text file and pushes through the serial port. Right now, it's running on RichNUC3 and attaches to Windows COM ports. 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. Goal was originally to individually diagnose messages and parsing, but now it can be set up so that when connected to the rack of serial ports, it can simulate more than one.
Python Simulator
In 2023, there was an effort to develop a linux based simulator that would not need a GUI to start each time. The idea was this could be set up to just run at boot and send simulated data to serial ports every time it was booted.
Currently the code for the Python simulator is located in BitBucket here
Python Simulator Dev Environment
This setup is to provide a smaller environment where we can work on development of the simulators themselves. It consists of a Geekom Intel NUC named 'packard-dev-ubuntu-22.shore.mbari.org', and an 8 Port Moxa. The Moxa has ports that are looped by physically so you can connect to the serial port and monitor what is coming out. For example, in the diagram below, there is an NMEA simulator running that is pushing out NMEA strings to the local virtual serial port /dev/ttyr00. These are then routed over the network, to the Moxa device and are pushed out Port 1 on the Moxa. Port 1 is then null-modem wired to Port 2 on the Moxa which is then routed back over the network to the /dev/ttyr01 virtual serial port on the simulator machine. If you were to run screen /dev/ttyr01 in a terminal window on the development machine, you would see the NMEA strings streaming.
In order to configure the Moxa connection, I used Firefox to download the Linux driver and then ran:
tar -xvf moxa-real-tty-linux-kernel-6.x-driver-v6.0.tgz
cd moxa/
sudo ./mxinst
cd /usr/lib/npreal2/driver
sudo ./mxaddsvr 134.89.11.94 8
This then created the serial ports /dev/ttyr00 -> /dev/ttyr07.
Then, I cloned the simulator code to ~/CoreNav using
git clone git@bitbucket.org:mbari/corenav-simulators.git
I edited the simulator_config.json file and pointed the NMEA simulator to /dev/ttyr01 and then ran the simulator. I could then see the output from the loopback by running
screen /dev/ttyr03