Looking for script to monitor fadump1090 and restart as need

SUbject pretty much sums it up. Every once in a while fadump1090 will fail and I have to ssh in to the pi and issue a restart command.

Any of you nix guys have a script written that monitors the fadump1090 process and issue a restart command if it stops?

Right now it stops 1 to 2 times a day. Yes, I have a nice fat 2 amp wall wort powering it up.

As a side note: I love playing with this. Sitting back and thinking about the tech that makes this happen and going back 10 to 15 years ago and trying to replicate this.

Thanks guys.

There is a new version of piaware due in the next week or so. It make fix your issue.

What do the log files say?

A script isn’t needed. You’ve got a problem with your system. I would check the logs and dmesg when it happens again.

I will check the logs and see. I didn’t even think of that…

I can’t seem to find where the log files are. Can someone help please?

lsusb
dmesg
cat /var/log/messages
cat /tmp/piaware.out or /var/log/piaware.log
cat /var/log/dump1090.log

some may require sudo

Thank you sir. I’m reviewing them now.

So here is the only relevant data I could find in piaware.out.yesterday log file. You can see it working fine then…

07/12/2016 06:15:47 185394 msgs recv’d from dump1090 (52 in last 5m); 184930 msgs sent to FlightAware
07/12/2016 06:20:47 185405 msgs recv’d from dump1090 (11 in last 5m); 184941 msgs sent to FlightAware
07/12/2016 06:25:47 185438 msgs recv’d from dump1090 (33 in last 5m); 184974 msgs sent to FlightAware
07/12/2016 06:25:58 mlat(2435): Beast-format results connection with localhost:30104: connection lost
07/12/2016 06:25:58 mlat(2435): Lost connection to localhost:30005
07/12/2016 06:25:58 mlat(2435): Reconnecting in 30.0 seconds
07/12/2016 06:25:58 lost connection to dump1090 via faup1090
07/12/2016 06:25:58 reconnecting to dump1090
07/12/2016 06:25:58 no ADS-B data program seen listening on port 30005 for 0 seconds, next check in 60s
07/12/2016 06:26:29 mlat(2435): Connection to localhost:30005 lost: [Errno 111] Connection refused
07/12/2016 06:26:29 mlat(2435): Reconnecting in 30.0 seconds
07/12/2016 06:26:29 mlat(2435): Beast-format results connection with localhost:30104: [Errno 111] Connection refused
07/12/2016 06:26:59 no ADS-B data program seen listening on port 30005 for 61 seconds, next check in 60s
07/12/2016 06:26:59 mlat(2435): Connection to localhost:30005 lost: [Errno 111] Connection refused
07/12/2016 06:26:59 mlat(2435): Reconnecting in 30.0 seconds

Within the lines you can see it attempting to restart:
07/12/2016 06:31:32 mlat(2435): Beast-format results connection with localhost:30104: [Errno 111] Connection refused
07/12/2016 06:31:59 no ADS-B data program seen listening on port 30005 for 361 seconds, trying to start it…
07/12/2016 06:31:59 attempting to start fadump1090.sh using ‘invoke-rc.d fadump1090.sh start’…
07/12/2016 06:31:59 dump1090 start appears to have been successful
07/12/2016 06:32:02 mlat(2435): Connection to localhost:30005 lost: [Errno 111] Connection refused
07/12/2016 06:32:02 mlat(2435): Reconnecting in 30.0 seconds
07/12/2016 06:32:02 mlat(2435): Beast-format results connection with localhost:30104: [Errno 111] Connection refused

Later on when I manually restarted fadump1090:
07/12/2016 12:56:23 mlat(2435): Beast-format results connection with localhost:30104: [Errno 111] Connection refused
07/12/2016 12:56:54 ADS-B data program ‘dump1090’ is listening on port 30005, so far so good
07/12/2016 12:56:54 Starting faup1090: /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr localhost --net-bo-port 30005 --stdout --lat 30.418 --lon -95.339
07/12/2016 12:56:54 Started faup1090 (pid 9062) to connect to dump1090
07/12/2016 12:56:54 mlat(2435): Input connected to localhost:30005
07/12/2016 12:56:54 mlat(2435): Beast-format results connection with localhost:30104: connection established
07/12/2016 12:57:59 mlat(2435): Receiver status: connected
07/12/2016 12:57:59 mlat(2435): Server status: not synchronized with any nearby receivers
07/12/2016 12:57:59 mlat(2435): Receiver: 11.3 msg/s received 0.2kB/s from receiver
07/12/2016 12:57:59 mlat(2435): Server: 0.0 kB/s from server 0.0kB/s TCP to server 0.0kB/s UDP to server
07/12/2016 12:57:59 mlat(2435): Results: 8.1 positions/minute
07/12/2016 12:57:59 mlat(2435): Aircraft: 20 of 44 Mode S, 11 of 20 ADS-B used

So if anyone has any ideas??

Are you forwarding port 8080 to the internet? Don’t do that.