😸

fr24feedが "[FAIL] Receiver: down ... failed!" で起動しない

2023/01/08に公開

はじめに

Flightrader24のBusinessプランに無償アップグレードすべくRaspberry Piにfr24feedをインストールしたのですがエラーで起動できなかったので、対応したことをまとめました。
結果としてはRaspberry Pi OS Liteを利用したからか、ライブラリの整合性が取れてなかったみたいです。

どんなエラーだったか

fr24feed-statusは Receiver: down ... failed! とエラーになっていました。

$ fr24feed-status

FR24 Feeder/Decoder Process: running.
FR24 Stats Timestamp:.
FR24 Link: unknown ... failed!
Receiver: down ... failed!
FR24 MLAT: not running ... failed!

インストール時のログを確認したところ、fr24feed.serviceがタイムアウトになっていました。

Settings saved, please run "sudo systemctl restart fr24feed" to use new configuration.
Job for fr24feed.service failed because a timeout was exceeded.
See "systemctl status fr24feed.service" and "journalctl -xe" for details.

fr24feed.serviceのステータスを確認すると install_dump1090.sh が status=100 となっています。

$ sudo systemctl status fr24feed.service

● fr24feed.service - Flightradar24 Decoder & Feeder
     Loaded: loaded (/etc/systemd/system/fr24feed.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2023-01-03 18:04:13 JST; 4min 9s ago
    Process: 1739 ExecStartPre=/usr/lib/fr24/install_dump1090.sh (code=exited, status=100)
    Process: 1924 ExecStartPre=/usr/lib/fr24/unregister_kernel_modules.sh (code=exited, status=0/SUCCESS)
    Process: 1928 ExecStartPre=/usr/lib/fr24/create_missing_directories.sh (code=exited, status=0/SUCCESS)
   Main PID: 1931 (fr24feed)
      Tasks: 21 (limit: 1596)
	CPU: 10.293s
     CGroup: /system.slice/fr24feed.service
	     mq1931 /usr/bin/fr24feed

どのように解決できたか

まずは install_dump1090.sh を直接実行してエラーの内容を確認します。

$ sudo /usr/lib/fr24/install_dump1090.sh

dump1090 is not found, downloading dump1090-mutability...
info: Trying to set 'dump1090-mutability/auto-start' [boolean] to 'false'
info: Loading answer for 'dump1090-mutability/auto-start'
Hit:1 http://repo.feed.flightradar24.com flightradar24 InRelease
Hit:2 http://archive.raspberrypi.org/debian bullseye InRelease
Hit:3 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Reading package lists...
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 

最後の行に表示されているように sudo dpkg --configure -a を手動実行しました。

$ sudo dpkg --configure -a

Setting up lighttpd (1.4.59-1+deb11u2) ...
Enabling unconfigured: ok
Run "service lighttpd force-reload" to enable changes
Created symlink /etc/systemd/system/multi-user.target.wants/lighttpd.service → /lib/systemd/system/lighttpd.service.
Setting up libpython2.7-minimal:armhf (2.7.18-8) ...
Setting up python2.7-minimal (2.7.18-8) ...
Linking and byte-compiling packages for runtime python2.7...
Setting up python2-minimal (2.7.18-3) ...
Processing triggers for man-db (2.9.4-2) ...

もう一度 install_dump1090.sh を実行するとエラーなく終了します。

/usr/lib/fr24/install_dump1090.sh 
実行結果
dump1090 is not found, downloading dump1090-mutability...
info: Trying to set 'dump1090-mutability/auto-start' [boolean] to 'false'
info: Loading answer for 'dump1090-mutability/auto-start'
Hit:1 http://repo.feed.flightradar24.com flightradar24 InRelease
Hit:2 http://archive.raspberrypi.org/debian bullseye InRelease
Hit:3 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
dirmngr is already the newest version (2.2.27-2+deb11u2).
libusb-1.0-0 is already the newest version (2:1.0.24-3).
lighttpd is already the newest version (1.4.59-1+deb11u2).
wget is already the newest version (1.21-1+deb11u1).
The following additional packages will be installed:
  javascript-common libjs-excanvas libjs-jquery libjs-jquery-ui
  libjs-jquery-ui-theme-smoothness libpython2-stdlib libpython2.7-stdlib
  python-is-python2 python2 python2.7
Suggested packages:
  libjs-jquery-ui-docs python2-doc python-tk python2.7-doc
The following NEW packages will be installed:
  dump1090-mutability javascript-common libjs-excanvas libjs-jquery
  libjs-jquery-ui libjs-jquery-ui-theme-smoothness libpython2-stdlib
  librtlsdr0 python-is-python2 python2 python2.7
The following packages will be upgraded:
  libpython2.7-stdlib
apt-listchanges: Reading changelogs...
Preconfiguring packages ...
1 upgraded, 11 newly installed, 0 to remove and 54 not upgraded.
1 not fully installed or removed.
Need to get 0 B/3,341 kB of archives.
After this operation, 15.3 MB of additional disk space will be used.
(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 43783 files and directories currently installed.)
Preparing to unpack .../00-libpython2.7-stdlib_2.7.18-8_armhf.deb ...
Unpacking libpython2.7-stdlib:armhf (2.7.18-8) over (2.7.18-8) ...
Selecting previously unselected package python2.7.
Preparing to unpack .../01-python2.7_2.7.18-8_armhf.deb ...
Unpacking python2.7 (2.7.18-8) ...
Selecting previously unselected package libpython2-stdlib:armhf.
Preparing to unpack .../02-libpython2-stdlib_2.7.18-3_armhf.deb ...
Unpacking libpython2-stdlib:armhf (2.7.18-3) ...
Selecting previously unselected package python2.
Preparing to unpack .../03-python2_2.7.18-3_armhf.deb ...
Unpacking python2 (2.7.18-3) ...
Selecting previously unselected package libjs-excanvas.
Preparing to unpack .../04-libjs-excanvas_0.r4~git20090427.0000000-4_all.deb ...
Unpacking libjs-excanvas (0.r4~git20090427.0000000-4) ...
Selecting previously unselected package libjs-jquery.
Preparing to unpack .../05-libjs-jquery_3.5.1+dfsg+~3.5.5-7_all.deb ...
Unpacking libjs-jquery (3.5.1+dfsg+~3.5.5-7) ...
Selecting previously unselected package libjs-jquery-ui.
Preparing to unpack .../06-libjs-jquery-ui_1.12.1+dfsg-8+deb11u1_all.deb ...
Unpacking libjs-jquery-ui (1.12.1+dfsg-8+deb11u1) ...
Selecting previously unselected package libjs-jquery-ui-theme-smoothness.
Preparing to unpack .../07-libjs-jquery-ui-theme-smoothness_1.12.1+dfsg-1_all.deb ...
Unpacking libjs-jquery-ui-theme-smoothness (1.12.1+dfsg-1) ...
Selecting previously unselected package librtlsdr0:armhf.
Preparing to unpack .../08-librtlsdr0_0.6.0-3_armhf.deb ...
Unpacking librtlsdr0:armhf (0.6.0-3) ...
Selecting previously unselected package dump1090-mutability.
Preparing to unpack .../09-dump1090-mutability_1.15~20180310.4a16df3+dfsg-8_armhf.deb ...
Unpacking dump1090-mutability (1.15~20180310.4a16df3+dfsg-8) ...
Selecting previously unselected package javascript-common.
Preparing to unpack .../10-javascript-common_11+nmu1_all.deb ...
Unpacking javascript-common (11+nmu1) ...
Selecting previously unselected package python-is-python2.
Preparing to unpack .../11-python-is-python2_2.7.18-9_all.deb ...
Unpacking python-is-python2 (2.7.18-9) ...
Setting up javascript-common (11+nmu1) ...
Setting up libjs-excanvas (0.r4~git20090427.0000000-4) ...
Setting up libpython2.7-stdlib:armhf (2.7.18-8) ...
Setting up librtlsdr0:armhf (0.6.0-3) ...
Setting up libjs-jquery-ui-theme-smoothness (1.12.1+dfsg-1) ...
Setting up libjs-jquery (3.5.1+dfsg+~3.5.5-7) ...
Setting up python2.7 (2.7.18-8) ...
Setting up libpython2-stdlib:armhf (2.7.18-3) ...
Setting up python2 (2.7.18-3) ...
Setting up libjs-jquery-ui (1.12.1+dfsg-8+deb11u1) ...
Setting up python-is-python2 (2.7.18-9) ...
Setting up dump1090-mutability (1.15~20180310.4a16df3+dfsg-8) ...
Enabling lighttpd integration..
Enabling dump1090: ok
Run "service lighttpd force-reload" to enable changes
Restarting lighttpd..
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for mailcap (3.69) ...
Processing triggers for libc-bin (2.31-13+rpt2+rpi1+deb11u4) ...
already enabled
Run "service lighttpd force-reload" to enable changes
Synchronizing state of lighttpd.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable lighttpd
dump1090-mutability is installed. You can always override it in /etc/fr24feed.ini with any other supported driver.
Web server (aircraft map) at http://YOUR_DEVICE_IP/dump1090 is enabled by default.

fr24feed.service を再起動します。

$ sudo systemctl restart fr24feed.service
$ sudo sysstemctl status fr24feed.service

● fr24feed.service - Flightradar24 Decoder & Feeder
     Loaded: loaded (/etc/systemd/system/fr24feed.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2023-01-03 18:12:21 JST; 3s ago
    Process: 3415 ExecStartPre=/usr/lib/fr24/install_dump1090.sh (code=exited, status=0/SUCCESS)
    Process: 3420 ExecStartPre=/usr/lib/fr24/unregister_kernel_modules.sh (code=exited, status=0/SUCCESS)
    Process: 3424 ExecStartPre=/usr/lib/fr24/create_missing_directories.sh (code=exited, status=0/SUCCESS)
   Main PID: 3427 (fr24feed)
      Tasks: 21 (limit: 1596)
        CPU: 1.158s
     CGroup: /system.slice/fr24feed.service
             tq3427 /usr/bin/fr24feed
             mq3457 /usr/bin/dump1090-mutability --raw --mlat --write-json /run/dump1090-mutability/

fr24feed-statusも正常になり、データを取得できています。

FR24 Feeder/Decoder Process: running.
FR24 Stats Timestamp: 2023-01-03 18:14:08.
FR24 Link: connected [UDP].
FR24 Radar: T-XXXXXXX.
FR24 Tracked AC: 8.
Receiver: connected (1340641 MSGS/0 SYNC).
FR24 MLAT: ok [UDP].
FR24 MLAT AC seen: 8.

補足

fr24feed-statusで FR24 MLAT がエラーになる場合はサービスの起動順序を調整するといいそうです。

$ fr24feed-status

FR24 Feeder/Decoder Process: running.
FR24 Stats Timestamp: 2023-01-07 14:02:07.
FR24 Link: connected [UDP].
FR24 Radar: T-XXXXXXX.
FR24 Tracked AC: 0.
Receiver: connected ( MSGS/ SYNC).
FR24 MLAT: not running ... failed!

私はこちらのサイトを参考にさせていただきました。
https://intaa.net/archives/21762

Discussion