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}
 
  ExecStart=dumpvdl2 --rtlsdr ${DEV} --gain ${GAIN} --output decoded:${FORMAT}:${PROTOCOL}:address=${SERVER},port=${PORT}  --station-id ${STATIONID} ${FREQ}
 
   
 
   

Verze z 10. 12. 2023, 16:52

Ú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
# 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