TLeconte / acarsdec

ACARS SDR decoder
329 stars 88 forks source link

How to confirm libacars support? #91

Closed thebaldgeek closed 2 years ago

thebaldgeek commented 2 years ago

After 100,000 messages I have not seen any that includes libacars or AIRNC 622 decoding and am wondering how to confirm acarsdec has that support?

Clean build of Raspberry Pi Bullseye Lite on a Pi3. No other software installed. Here is my build (done as root):

`apt-get update apt-get install -y cmake rtl-sdr git cmake libusb-1.0-0-dev libtool librtlsdr-dev build-essential libglib2.0-dev pkg-config librtlsdr-dev libxml2-dev libzmq3-dev python3-zmq zlib1g-dev libxml2-dev ldconfig

cd /usr/src git clone git://git.osmocom.org/rtl-sdr.git cd rtl-sdr mkdir build cd build cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON make -j3 make install ldconfig cd /usr/src/rtl-sdr cp rtl-sdr.rules /etc/udev/rules.d/

cd /usr/src git clone --depth=1 https://github.com/szpajder/libacars cd libacars mkdir build cd build cmake ../ make -j3 make install ldconfig

cd /usr/src git clone --depth=1 https://github.com/TLeconte/acarsdec.git cd acarsdec mkdir build cd build cmake .. -Drtl=ON make -j3 make install`

Reboot, install dongle and run acarsdec with the following command: acarsdec -v -o 4 -g 42 -j 192.168.1.123:2232 -r 1 129.125 130.025 130.425 130.450 130.825 130.125

Part of my confusion (Other than not seeing any decoded messages) is that the acarsdec readme.md mentions that libacars support will be added if pkg-config can find that package, but on my build, it can not be found: pkg-config --modversion libacars Package libacars was not found in the pkg-config search path. Perhaps you should add the directory containing libacars.pc to the PKG_CONFIG_PATH environment variable No package libacars found But when I do a sudo find / -name libacars.pc there is no file by that name. (That seems like a libacars issue, but felt I should mention it here).

But, when I do a make, it seems to suggest that acarsdec did indeed find it:

`root@acars-kriv:/usr/src/acarsdec/build# cmake ../ -Drtl=ON
-- The C compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2")
-- Checking for module 'libacars-2>=2.0.0'
--   Found libacars-2, version 2.1.4
-- Using libacars
-- Not using MQTT
-- Not using libsndfile
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/src/acarsdec/build`

Other than the make command how can I confirm that acarsdec has libacars support? Does the libacars decoding get added to the JSON output of acarsdec?

Seems like I should have seen at least one message out of 100,000 that should be decoded? I am l using JSON output and in Node-RED and have several filters setup to catch any AIRINC 622 decoded messages.

Thanks for your help.

TLeconte commented 2 years ago

"-- Using libacars" during Cmake tell you that acarsdec will use libacars.

You could use the Linux command ldd to be sure : ldd ./acarsdec it will list all linked lib.

On Fedora, libacars install in /usr/local/lib64, but it's true that libacars installation don't seem to be very automatic.

If libacars decodes something, it will output its dedicated "libacars" entry in the json message. ie : { "timestamp":1656684619.1945369, "station_id":"radio", "channel":0, "freq":131.525, "level":-31.1, "error":0, "mode":"2", "label":"SA", "block_id":"6", "ack":false, "tail":"F-HRBI", "flight":"AF0474", "msgno":"S77A", "text":"0EV141019VSH/", "assstat":"skipped", "libacars":{ "media-adv":{"err":false,"version":0,"current_link":{"code":"V","descr":"VHF ACARS","established":true,"time":{"hour":14,"min":10,"sec":19}},"links_avail":[{"code":"V","descr":"VHF ACARS"},{"code":"S","descr":"Default SATCOM"},{"code":"H","descr":"HF"}]} }, "app":{"name":"acarsdec","ver":"3.5"} }