DumpVDL2: Porovnání verzí
Z Poznámkový blok
(→Odkazy) |
(→systemctl) |
||
(Není zobrazeno 10 mezilehlých verzí od stejného uživatele.) | |||
Řádka 1: | Řádka 1: | ||
+ | == Ú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 == | == Test == | ||
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 dumpvdl2.service | ||
+ | |||
+ | [Unit] | ||
+ | Description=DumpVDL2 | ||
+ | Documentation= https://github.com/szpajder/dumpvdl2 | ||
+ | After=network-online.target | ||
+ | |||
+ | [Service] | ||
+ | Type=simple | ||
+ | EnvironmentFile=-/etc/default/dumpvdl2 | ||
+ | ExecStart=dumpvdl2 --rtlsdr ${DEV} --gain ${GAIN} --correction ${PPM} --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="udp" | ||
+ | |||
+ | # 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 == | == 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 ]] |
Aktuální verze z 10. 12. 2023, 17:08
Ú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 dumpvdl2.service
[Unit] Description=DumpVDL2 Documentation= https://github.com/szpajder/dumpvdl2 After=network-online.target [Service] Type=simple EnvironmentFile=-/etc/default/dumpvdl2 ExecStart=dumpvdl2 --rtlsdr ${DEV} --gain ${GAIN} --correction ${PPM} --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="udp" # 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