DumpVDL2: Porovnání verzí
Z Poznámkový blok
(→Úvod) |
(→Test) |
||
Řádka 20: | Řádka 20: | ||
Spuštění pro test | Spuštění pro test | ||
dumpvdl2 --rtlsdr 0 --gain 48 --correction 50 136725000 136775000 136800000 136825000 136875000 | 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 acarsdec.service | ||
+ | |||
+ | [Unit] | ||
+ | Description=ACARS | ||
+ | Documentation=https://github.com/TLeconte/acarsdec | ||
+ | After=network-online.target | ||
+ | |||
+ | [Service] | ||
+ | Type=simple | ||
+ | EnvironmentFile=-/etc/default/acarsdec | ||
+ | ExecStart=acarsdec \"${OPTS} -g ${GAIN} -p ${PPM} -i ${STATIONID} -${FORMAT} ${SERVER} -r ${DEV} ${FREQ}\" | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | Alias=acarsdec.service | ||
+ | |||
+ | Také vytvořit konfigurační soubor. Samozřejmně nezapomeňte přenastavit hodnoty dle vaší lokalizace. | ||
+ | sudo nano /etc/default/acarsdec | ||
+ | |||
+ | #!/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: | ||
+ | # n - planeplotter compatible format | ||
+ | # N - acarsdec native format | ||
+ | # j - acarsdec json format | ||
+ | FORMAT="j" | ||
+ | |||
+ | # Send acars messages to addr:port via UDP | ||
+ | SERVER="feed.acars.io:5550" | ||
+ | |||
+ | # Station id used in acarsdec network format (for json output) | ||
+ | STATIONID="TT-LKCM1-ACARS" | ||
+ | |||
+ | # 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 | ||
+ | # -v : verbose | ||
+ | # -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/acarsdec | ||
+ | sudo chown pi /etc/default/acarsdec | ||
+ | sudo ln -s /etc/default/acarsdec /home/pi/acarsdec.conf | ||
+ | |||
+ | Nastaveni sluzby pro automaticke spustění po startu a následně spustíme | ||
+ | sudo systemctl enable acarsdec.service | ||
+ | sudo systemctl start acarsdec.service | ||
+ | |||
+ | Po spuštění služby můžeme sledovat co se dějě ... | ||
+ | journalctl -fe -u acarsdec | ||
== Odkazy == | == Odkazy == | ||
* [[Raspberry#Projekty | Zpět na projekty Raspberry Pi]] | * [[Raspberry#Projekty | Zpět na projekty Raspberry Pi]] | ||
* [[ ACARS_/_VDL_mode_2#VDL_mode_2 | Zpět na ACARS / VDL mode 2 ]] | * [[ ACARS_/_VDL_mode_2#VDL_mode_2 | Zpět na ACARS / VDL mode 2 ]] |
Verze z 10. 12. 2023, 16:27
Úvod
- Odkaz na vlastní projekt https://github.com/szpajder/dumpvdl2
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 acarsdec.service
[Unit] Description=ACARS Documentation=https://github.com/TLeconte/acarsdec After=network-online.target [Service] Type=simple EnvironmentFile=-/etc/default/acarsdec ExecStart=acarsdec \"${OPTS} -g ${GAIN} -p ${PPM} -i ${STATIONID} -${FORMAT} ${SERVER} -r ${DEV} ${FREQ}\" [Install] WantedBy=multi-user.target Alias=acarsdec.service
Také vytvořit konfigurační soubor. Samozřejmně nezapomeňte přenastavit hodnoty dle vaší lokalizace.
sudo nano /etc/default/acarsdec
#!/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: # n - planeplotter compatible format # N - acarsdec native format # j - acarsdec json format FORMAT="j" # Send acars messages to addr:port via UDP SERVER="feed.acars.io:5550" # Station id used in acarsdec network format (for json output) STATIONID="TT-LKCM1-ACARS" # 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 # -v : verbose # -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/acarsdec sudo chown pi /etc/default/acarsdec sudo ln -s /etc/default/acarsdec /home/pi/acarsdec.conf
Nastaveni sluzby pro automaticke spustění po startu a následně spustíme
sudo systemctl enable acarsdec.service sudo systemctl start acarsdec.service
Po spuštění služby můžeme sledovat co se dějě ...
journalctl -fe -u acarsdec