How to automatically reboot in case no data are sent

My raspberry with flightaware usally works very smoothly, nevertheless I have from time to time issues that the connection to the dvb-t-stick is lost an no data are submitted. Basically the raspberry is still online and connected, network is istablished.

Is there a way of automatically detect that no data are submitted an initiate a reboot? I know, thats just a workaround and doesnt fix the problem, but I cant determine the cause of the issue, and a quick workaround would be ok for me too…

How did you identfy that?
Any service not running any longer? Then it would be easy.

For network traffic it might be more difficult.
In case the logs to your feeding site does contain an indication you can filter on that too.

Within the stats-site of my receiver I can see the received per hour. You can see a long period during saturday, where no messages have been received. I noticed it with the outage-mail I receive after 12 hours. The pi was up and running, I could log-in via ssh, piware was running, but no connection to the stick therefore no messages could be processed.

The question should be more why the connection to the stick got lost.
Please verify the logs for traces about it.

does the stick also disappear for the OS itself? This could be a weak USB connection.
In case it is disconnect and you are able to use ssh, check the output of lsusb.

will do, when the next outages appears… Thx for your support so far!

You can check the logs already if it’s not too far in the past.

I am using Monit on my devices. With this you can check different conditions (even file existence or content) and perform different actions

Most probably a soft PSU (they don’t age gracefully).

Try a new PSU and see how you go.

lsusb shows that the usb-dongle is missing:

Output with feeder outage:
Bus 001 Device 005: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

output after reboot:
Bus 001 Device 004: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
Bus 001 Device 005: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

so I basically need a script that regularly checks the existing of the device and if not initiates a reboot.

How i would do it:

  • write the output of lsusb every five minutes into a file, filtered on “RTL2838”
  • Reboot device if file size is zero

But that’s quick and dirty from me with not that many skills. Others might have better ideas.

Basically i would rather find the root cause than fixing the symptoms only.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.