Looking for a script that checks status of dump1090


#1

Dump1090 at my raspberry stops working from time to time.
Is there any script that regularly as cronjob can check the status of dump1090 and restart it if not running correctly?


#2

Describe what you mean by “stops working”. You should probably fix the underlying problem rather than wallpapering over the cracks.


#3

problem is, that the dump1090 crashes from time to time. Sometimes 2 days everything is ok, sometimes twice a day it crashes. Restarting dump1090 fixes the problem.
I cant tell what the reson behind this is.


#4

Does the process stop running entirely or just stop producing output? What do the logs say? Do you see USB problems in dmesg output?

I’d bet that it is power problems.


#5

Yeah, I’d second power problems. If you’re not familiar with dmesg, ssh into your pi and run this command:


dmesg -T

You might see your dongle disconnecting and reconnecting coinciding with when dump1090 stops working. I saw this, and like you I had previously thought about scripting the solution to my problem. I settled temporarily on a while loop that restarted dump1090, waited 10 minutes, and continued until I told it to stop or rebooted. This was kludgy, and drastically reduced the number of messages, especially MLAT messages sent to flightaware.

I decided the most likely issue was a USB/Power issue to the dongle, so first I replaced the el-cheapo powered hub my dongle was connected through (for some reason, I could never get it to run straight off the Pi. Maybe I have an inadequate power supply to the Pi.

In any event, I replaced the hub with a quality powered hub and now dump1090 and the pi are both rock-solid - and my message upload rate is way up!

I bought this hub. Yes, 3.0 is way overkill for this application, but I wanted the mounting screw holes. It’s been rock solid.
http://www.amazon.com/gp/product/B00TFY12V8?psc=1&redirect=true&ref_=oh_aui_detailpage_o02_s00


#6

dmesg -T delivers the following:

device descriptior read/64, error -71
new high-speed USB device number
unable to enumerate USB Device

Any ideas?


#7

Your dongle is not connecting reliably, probably because it’s not getting a stable enough power supply. As mentioned above, try putting it on a powered USB hub, so the pi is not powering it directly. I found that an RTL dongle and a wifi adapter were too much to power directly from the raspberry pi to be stable. I moved both to a hub and now it’s reliable.


#8

Thanks! I’ll try and report my experiences with a changed hardware-setting (active USB-Hub)


#9

Somewhere I read that error -71 is a power problem… Not sure how accurate that is, but someone on the internet said it, so it must be true!

Is this dongle connected directly to the Pi, or via a hub? Maybe try connecting it directly, or, as suggested above, a powered hub. I would be tempted to try another/better power supply to the Pi. Mine is connected directly to a Pi2, along with a WiFi adapter, and I have had no problems.

I checked dmesg -T on my system and there is no sign of similar error messages.


#10

I have a very good an reliable power supply, this shouldnt be the problem. Only usb devices are a wifi dongle and the dvd-t stick.
I am using a 2.5m of usb-extension for the dvb-t stick. I think this might be the problem. Will try to connect the stick temporarily dirctly to the pi


#11

If piaware loses the connection to dump1090, it will try to start it back up for you. Do you see something like this in your piaware log?

04/08/2015 14:31:50 no ADS-B producer program seen for 600 seconds, trying to start it…
04/08/2015 14:31:50 attempting to start dump1090 using ‘/etc/init.d/fadump1090.sh start’…


#12

I’ve had problems powering the RTL from the Pi. Even using the straight 5vdc rail of a ATX power supply (a theoretical 20a available).

Good powered hub. Can’t suggest it enough, if stability is what you’re after.

But yes I’d wager that extension is probably exacerbating if not causing your problem. 2.5M is a pretty long USB extension - depending on the quality of the cable - enough resistance that the RTL probably isn’t getting exactly 5v anymore 8)

I doubt voltage drop is significant across that length, but you could have any number of issues affecting the protocol at that point.

i still suggest GOOD powered hub and GOOD cables.


#13

pi’s have current limiting components on the usb ports, if the tolerance of components doing the limiting are on the mean side for current protection you’ll have problems, so powering from a powered hub is probably the best way to test that.


#14

quick feedback: I replaced the usb extension cable and pluged the dvb-t stick diretly into the pi. Now ist working stable, even without active USB-Hub. Thanks for alle the suggestions. Great support!


#15

you can do that:

CODE:

sudo nano checkdump1090.sh (or any file name you want)

on the file copy e paste that:

#!/bin/bash

Check if dump1090 is running

if pgrep “dump1090” > /dev/null
then
echo "Running"
else
echo "Stopped"
fi

click ctrl+O for save and ctrl+x for close file

now : sudo chmod +x dump1090.sh (or other name the you give)

now: ./dump1090.sh

output should be: Running

you can add to cron tab and upload data to a google spreadsheat and send sms to you afther data colected or dropbox or any other cloud.

cheers