DumpVDL2: Porovnání verzí

Z Poznámkový blok
Přejít na: navigace, hledání
(systemctl)
(systemctl)
Řádka 33: Řádka 33:
 
  Type=simple
 
  Type=simple
 
  EnvironmentFile=-/etc/default/dumpvdl2
 
  EnvironmentFile=-/etc/default/dumpvdl2
ExecStart=dumpvdl2 \"${OPTS} -g ${GAIN} -p ${PPM} -i ${STATIONID} -${FORMAT} ${SERVER} -r ${DEV} ${FREQ}\"  
+
# ExecStart=dumpvdl2 \"${OPTS} -g ${GAIN} -p ${PPM} -i ${STATIONID} -${FORMAT} ${SERVER} -r ${DEV} ${FREQ}\"  
 +
ExecStart=dumpvdl2 --rtlsdr ${DEV} --gain ${GAIN} --output decoded:${FORMAT}:${PROTOCOL}:address=${SERVER},port=${PORT}  --station-id ${STATIONID} ${FREQ}
 
   
 
   
 
  [Install]
 
  [Install]
Řádka 57: Řádka 58:
 
   
 
   
 
  # Format send dat:
 
  # Format send dat:
  #  - planeplotter compatible format
+
  #  text      - Human readable text
  #  N - acarsdec native format
+
  #  pp_acars - One-line ACARS format accepted by Planeplotter via UDP
  #  - acarsdec json format
+
  #  json      - Javascript object notation
  FORMAT="j"
+
  FORMAT="json"
 
   
 
   
 +
# Output protocol:
 +
#  udp
 +
#  tcp
 +
PROTOCOL="tcp"
 +
 
  # Send acars messages to addr:port via UDP
 
  # Send acars messages to addr:port via UDP
  SERVER="feed.acars.io:5550"
+
  SERVER="feed.airframes.io"
 +
PORT="5553"
 
   
 
   
 
  # Station id used in acarsdec network format (for json output)
 
  # Station id used in acarsdec network format (for json output)
  STATIONID="TT-LKCM1-ACARS"
+
  STATIONID="TT-LKCM1-VDLM2"
 
# VHF frequencies f1 and optionally f2 to f8 in Mhz
 
#FREQ="130.825 130.850 131.525 131.550 131.725 131.825 131.850"
 
FREQ="131.550 131.725 131.825"
 
 
   
 
   
  # Other seting
+
  # VHF frequencies f1 and optionally f2 to f8 in hz
#  -v        : verbose
+
  FREQ="136725000 136775000 136800000 136825000 136875000 136975000
#  -A        : don't display uplink messages (ie : only aircraft messages)
 
#  -o lv      : output format : 0 : no log, 1 : one line by msg, 2 : full (default), 3 : monitor mode, 4 : msg JSON, 5 : route JSON
 
#  -l logfile : append log messages to logfile (Default : stdout).
 
#  -H        : rotate log file once every hour
 
#  -D        : rotate log file once every day
 
  OPTS='-v -o 4'
 
  
 
  sudo chmod 664 /etc/default/dumpvdl2
 
  sudo chmod 664 /etc/default/dumpvdl2

Verze z 10. 12. 2023, 17:51

Úvod

Příprava

sudo apt install build-essential cmake git libglib2.0-dev pkg-config

Nainstalujeme libacars

cd
git clone https://github.com/szpajder/libacars
cd libacars
mkdir build
cd build
cmake ../
make
sudo make install
sudo ldconfig

Test

Spuštění pro test

dumpvdl2 --rtlsdr 0 --gain 48  --correction 50 136725000 136775000 136800000 136825000 136875000

systemctl

Pro automatické spouštění je nutne nastavit službu

sudo systemctl edit --force --full dumpvdl2.service
[Unit]
Description=DumpVDL2
Documentation= https://github.com/szpajder/dumpvdl2
After=network-online.target

[Service]
Type=simple
EnvironmentFile=-/etc/default/dumpvdl2
  1. ExecStart=dumpvdl2 \"${OPTS} -g ${GAIN} -p ${PPM} -i ${STATIONID} -${FORMAT} ${SERVER} -r ${DEV} ${FREQ}\"
ExecStart=dumpvdl2 --rtlsdr ${DEV} --gain ${GAIN} --output decoded:${FORMAT}:${PROTOCOL}:address=${SERVER},port=${PORT}  --station-id ${STATIONID} ${FREQ}

[Install]
WantedBy=multi-user.target
Alias=dumpvdl2.service

Také vytvořit konfigurační soubor. Samozřejmně nezapomeňte přenastavit hodnoty dle vaší lokalizace.

sudo nano /etc/default/dumpvdl2
#!/bin/sh
# Defaul seting for acarsdec
# ==========================

# RTL dongle number or S/N
DEV="0"

# Set rtl ppm frequency correction
PPM="51"

# Set rtl preamp gain in tenth of db (ie -g 90 for +9db)..
# By default use maximum gain
GAIN="480"

# Format send dat:
#  text      - Human readable text
#  pp_acars  - One-line ACARS format accepted by Planeplotter via UDP
#  json      - Javascript object notation
FORMAT="json"

# Output protocol:
#  udp
#  tcp
PROTOCOL="tcp"
# Send acars messages to addr:port via UDP
SERVER="feed.airframes.io"
PORT="5553"

# Station id used in acarsdec network format (for json output)
STATIONID="TT-LKCM1-VDLM2"

# VHF frequencies f1 and optionally f2 to f8 in hz
FREQ="136725000 136775000 136800000 136825000 136875000 136975000
sudo chmod 664 /etc/default/dumpvdl2
sudo ln -s /etc/default/dumpvdl2 ~/dumpvdl2.conf

Nastaveni sluzby pro automaticke spustění po startu a následně spustíme

sudo systemctl enable dumpvdl2.service
sudo systemctl start dumpvdl2.service

Po spuštění služby můžeme sledovat co se dějě ...

journalctl -fe -u dumpvdl2

Odkazy