LuCI - Dump1090 (service)

I see that there is a package to configure dump1090 as a service in LuCI (Luci-app-dump1090). Is there any documentation on how to set it up? I wish to get dump1090 running at boot as a service but I can't find any info on how to set it up or get it going, rather than using SSH and leaving PuTTY running on another PC.
There are steps on how to get dump1090 running at boot as a service for the Raspberry Pi's but I don't know if that is the same as the OpenWRT system and I don't want to break the OWRT startup procedure.

It looks like dump1090 is packaged as a standard OpenWrt service-- configure in /etc/config/dump1090 then start with service dump1090 start. Enable to auto-start at boot with service dump1090 enable.

By default /etc/config/dump1090 has an option disabled 1 of course you need to change that.

The LuCI app would give you a GUI to set configuration but it it optional-- doesn't add anything to CLI functionality.

I checked and made the corrections, it still won't load at bootup as a service. :frowning:
I tried to run systemctl but that command isn't found. :thinking:
Checked the system log...
daemon.info procd: Instance dump1090::instance1 s in a crash loop 6 crashes, 0 seconds since last crash
How can I tell what is causing the crash?

1 Like

Well... I got this far. Now why isn't the positions being plotted?


Just to verify, dump1090 IS running.

The setup is that uhttpd shows the web site with the map, and dump1090 is part of the ajax callback to display the aircraft. No dump1090, no aircraft on the map.

I can +1 the issue you are facing with running dump1090 as a service: I also get the same message in the system log. Did you ever resolve the cause of it?

I have a couple of things to add.

As part of trying to debug it, I found a couple of parameters not being searched for:
In /etc/init.d/dump1090, in function start_instance(), I needed to add these:

        append_bool "$cfg" net_beast "--net-beast"
        append_arg "$cfg" net_http_port "--net-http-port"

Additionally, I ended up making a workaround: I hacked together my own init script to run dump1090:

First create file: /etc/init.d/dump1090_custom

#!/bin/sh /etc/rc.common
#
# save as /etc/init.d/dump1090_custom
START=10
STOP=90

PIDFILE=/var/run/dump1090_custom_pid

start() {
    start-stop-daemon -b -S -x /usr/bin/dump1090_custom.sh -m -p $PIDFILE
}

stop() {
    start-stop-daemon -K -p $PIDFILE
}

and set permissions to match the other scripts here.

Then in /usr/bin, a new executable script: dump1090_custom.sh

/usr/bin/dump1090 --quiet --lat XX.XXXX --lon XX.XXXX --raw --mlat --forward-mlat --net --net-beast --net-bo-port 30005 --gain -10 --write-json /var/run/dump1090

Then it starts for me, when the following command is run:

/etc/init.d/dump1090_custom

but does not respawn on a crash, which is not an infrequent event.

TL;DR: Delete the following line from /etc/init.d/dump1090
append_arg "$cfg" html_dir "--html-dir"

A long time coming but I have a fix for this issue...

First a quick suggestion for troubleshooting issues like this try running;
INIT_TRACE=1 /etc/init.d/<service> start

Then you can pull the actual command line out and try running it manually e.g.
+ ubus call service set '{ "name": "dump1090", "script": "\/etc\/init.d\/dump1090", "instances": { "instance1": { "command": [ "\/usr\/bin\/dump1090", "--quiet", "--net", "--html-dir", "\/usr\/share\/dump1090", "--write-json", "\/var\/run\/dump1090", "--write-json-every", "1" ], "respawn": [ "3600", "5", "5" ] } }, "triggers": [ [ "config.change", [ "if", [ "eq", "package", "dump1090" ], [ "run_script", "\/etc\/init.d\/dump1090", "reload" ] ], 1000 ] ], "data": { } }'

Gives;
/usr/bin/dump1090 --quiet --net --html-dir /usr/share/dump1090 --write-json /var/run/dump1090 --write-json-every 1

Which when I run it I get;

/usr/bin/dump1090 --quiet --net --html-dir /usr/share/dump1090 --write-json /var/run/dump1090 --write-json-every 1
Unknown or not enough arguments for option '--html-dir'.

Running dump1090 --help doesn't show an --html-dir flag so it's possible that that flag has been removed from the upstream code.

So the fix is to remove that option from the init script, open /etc/init.d/dump1090 and delete the line;

append_arg "$cfg" html_dir "--html-dir"

Then run 'service dump1090 start' and it should "just work"

There's also a race condition between this package and luci-app-dump1090 wherein if dump1090 hasn't started before you access the configuration section in luci you won't be able to save because /var/run/dump1090 doesn't exist yet, you can fix that by either manually creating the directory (note it'll disappear on reboot) or starting dump1090 before you try to access the luci config.

If I get around to it I'll submit a pull request to fix the errant config line (and if I'm really motivated I'll also update the luci-app-dump1090 package to fix some other stuff I noticed wasn't quite right)

I'd be interested in any update to this package

I have an open PR for the fixes to the service package, it's currently stuck due to a downstream issue though.

If you're so inclined you can pull the source from my repo and build your own copy of the package.

I haven't yet had time to produce the companion PR for luci-app-dump1090, but IIRC it should still work without that but you'll have some extraneous/missing options in the UI.

1 Like