PiAware dump1090 no longer loading on 8080 (and easy solution)

I recently noticed that my dump1090/PiAware web ui stopped loading. The unusual thing was that part of the webapp appeared to load but then it would hang with the ‘please wait’ spinner.

Looking in dev tools in Chrome, there’s a bunch of 404s on the data feeds:

A quick search found a couple of useful posts, especially this one, suggesting to first check the logs, with:

sudo journalctl -u dump1090-fa -n50 --no-pager

And here’s what I found:

Apr 22 20:24:02 raspberrypi systemd[1]: dump1090-fa.service holdoff time over, scheduling restart.
Apr 22 20:24:02 raspberrypi systemd[1]: Stopping dump1090 ADS-B receiver (FlightAware customization)…
Apr 22 20:24:02 raspberrypi systemd[1]: Starting dump1090 ADS-B receiver (FlightAware customization)…
Apr 22 20:24:02 raspberrypi systemd[1]: Started dump1090 ADS-B receiver (FlightAware customization).
Apr 22 20:24:02 raspberrypi dump1090-fa[27365]: Wed Apr 22 20:24:02 2020 PDT dump1090-fa 3.5.1 starting up.
Apr 22 20:24:02 raspberrypi dump1090-fa[27365]: rtlsdr: no supported devices found.
Apr 22 20:24:02 raspberrypi systemd[1]: dump1090-fa.service: main process exited, code=exited, status=1/FAILURE
Apr 22 20:24:02 raspberrypi systemd[1]: Unit dump1090-fa.service entered failed state.

Here’s your problem, right here:

dump1090-fa[27365]: rtlsdr: no supported devices found.

Quick fix, pushed the rtl-sdr usb dongle back in (it had come slightly loose) and rebooted, problem solved:

-- Logs begin at Wed 2020-04-22 20:27:02 PDT, end at Wed 2020-04-22 20:27:55 PDT. --
Apr 22 20:27:05 raspberrypi systemd[1]: Starting dump1090 ADS-B receiver (FlightAware customization)…
Apr 22 20:27:05 raspberrypi systemd[1]: Started dump1090 ADS-B receiver (FlightAware customization).
Apr 22 20:27:05 raspberrypi dump1090-fa[571]: Wed Apr 22 20:27:05 2020 PDT dump1090-fa 3.5.1 starting up.
Apr 22 20:27:05 raspberrypi dump1090-fa[571]: rtlsdr: using device #0: Terratec T Stick PLUS (Realtek, RTL2838UHIDIR, SN 00000001)
Apr 22 20:27:05 raspberrypi dump1090-fa[571]: Found Elonics E4000 tuner
Apr 22 20:27:05 raspberrypi dump1090-fa[571]: rtlsdr: enabling tuner AGC

Problem solved – look at that empty sky over Sacramento!

Retrieving ADS-B transponder data from dump1090

dump1090 is probably the goto solution for receiving ADS-B transponder signals from planes flying overhead because

a) it runs with a cheap rtlsdr USB dongle (more info on dongles here)

b) runs on a cheap $35 Raspberry Pi

I’ve always wondered how it would be possible to get data out of dump1090 to use within other apps. It provides a data feed on port 30003 that is relatively easy to capture by using a util like netcat. If you have another app to receive/parse/process the data, this is as easy as:

nc ip-of-pi 30003 | app-to-parse-data

I have a project ‘in-flight’ right now using this approach… more updates later.

Installing rtl-sdr and dump1090 on a Raspberry Pi to receive ADS-B signals

I’ve gone through these steps a couple of times when I’ve set up a new SD card, and had to go to various places to work out all the steps, so in case this is useful for someone else, here’s the steps (assuming installing on Rasbian):

Making and installing rtl-sdr from source

Instructions: http://sdr.osmocom.org/trac/wiki/rtl-sdr

Pre-req steps, if you don’t already have the following:

sudo apt-get install cmake

#usb driver for the rtl dongle
sudo apt-get install libusb-1.0

Get the source:

git clone git://git.osmocom.org/rtl-sdr.git

Build:

cd rtl-sdr/
mkdir build
cd build
cmake ../
make
sudo make install
sudo ldconfig

If you get permissions errors like this when using any of the rtl_* commands:

Using device 0: Terratec T Stick PLUS
usb_open error -3
Please fix the device permissions, e.g. by installing the udev rules file rtl-sdr.rules
Failed to open rtlsdr device #0.

Then you should be able to add a line to

/etc/udev/rules.d/rtl-sdr.rules

 to set up correct permissions for your specific card, which you can find by running lsusb, eg for mine:

Bus 001 Device 004: ID 0ccd:00d7 TerraTec Electronic GmbH

From this I believe you take the id value and insert it into a new line in rtl-sdr.rules like:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00d7", MODE:="0666"

and then restart udev:

sudo service udev restart

… reboot and that should be fixed.  Or you can still run the apps with sudo.

To test, try starting up the rtl_tcp server:

sudo rtl_tcp -a your_ip

and you might see a message about the device already in use by another kernel module:

Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Terratec T Stick PLUS
Kernel driver is active, or device is claimed by second instance of librtlsdr.
In the first case, please either detach or blacklist the kernel module
(dvb_usb_rtl28xxu), or enable automatic detaching at compile time.
usb_claim_interface error -6
Failed to open rtlsdr device #0.

This is saying dvb_usb_rtl28xxu is already using the device. From instructions here, you can temporarily unload this module:

sudo rmmod dvb_usb_rtl28xxu

or permantly remove it with a blacklist entry in /etc/modprobe.d – add a new file here named something like rtl-sdr.conf, add add one line with the name of the above driver:

blacklist dvb_usb_rtl28xxu

Reboot and now you should be good to go with the rtl_* commands.

 

Making and installing dump1090:

From https://github.com/MalcolmRobb/dump1090

git clone https://github.com/MalcolmRobb/dump1090.git
cd dump1090
make

Run in interactive mode:

./dump1090 --interactive

or net mode to enable the webserver (point a browser at you Pi’s IP address and port 8080):

./dump1090 --net