Skip to content

Instantly share code, notes, and snippets.

@mdkendall
Last active April 14, 2024 02:02
Show Gist options
  • Save mdkendall/06e29787549be47c7da409a61ed39d34 to your computer and use it in GitHub Desktop.
Save mdkendall/06e29787549be47c7da409a61ed39d34 to your computer and use it in GitHub Desktop.
Install AIS-catcher and run as a service.
# AIS-catcher service for systemd
[Unit]
Description=AIS-catcher
Wants=network.target
After=network.target
[Service]
User=ais
RuntimeDirectory=aiscatcher
RuntimeDirectoryMode=0755
ExecStart=/usr/local/bin/AIS-catcher -o 0 -C /usr/share/aiscatcher/aisconf.json
SyslogIdentifier=aiscatcher
Type=simple
Restart=on-failure
RestartSec=30
RestartPreventExitStatus=64
Nice=-5
[Install]
WantedBy=default.target
{
"config":"aiscatcher",
"version":"1",
"serial": "00000001",
"sharing": true,
"sharing_key": "00000000-0000-0000-0000-000000000000",
"input": "rtlsdr",
"rtlsdr":{
"active":true,
"rtlagc":true,
"tuner":"auto",
"bandwidth":"192K",
"sample_rate":"1536K",
"biastee":false,
"buffer_count":2
},
"model":{
"fp_ds":true,
"ps_ema":true
},
"server":{
"active":true,
"port":8100,
"station":"Station Name",
"lat":0.000,
"lon":0.000,
"share_loc":true,
"realtime":true
},
"udp":[
{
"host":"0.0.0.0",
"port":0
}
]
}
#!/bin/bash
# Download, compile and install AIS-catcher
sudo apt install -y git make gcc g++ cmake pkg-config
sudo apt install -y librtlsdr-dev
git clone https://github.com/jvde-github/AIS-catcher.git
cd AIS-catcher
mkdir build
cd build
cmake ..
make
sudo make install
cd ../..
# Create the user to run the service
sudo useradd -r ais
sudo usermod -a -G plugdev ais
# Install AIS-catcher configuration file
sudo mkdir /usr/share/aiscatcher
sudo cp aisconf.json /usr/share/aiscatcher
sudo chown ais:ais -R /usr/share/aiscatcher
sudo chmod 644 /usr/share/aiscatcher/aisconf.json
# Configure AIS-catcher to run as a service and start at boot
sudo cp aiscatcher.service /lib/systemd/system
sudo chmod 644 /lib/systemd/system/aiscatcher.service
sudo systemctl enable aiscatcher
sudo systemctl start aiscatcher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment