Automatic restarts of dump1090 due to inactivity - can I modify the default threshold?

During the wee hours of the morning a few times a week dump1090-fa automatically restarts as no data has been sent for a while. It is simply due to there just being no aircraft in my view. I get that this feature is useful to keep feeders dropping offline for long periods, but I find my restarts annoyingly useless. It seems to have a threshold around about an hour (3600 seconds). Is there a way for a user to modify this value to say two hours? Thanks.

Jan 24 02:46:09 piaware piaware[553]: no new messages received in 3897 seconds, it might just be that there haven't been any aircraft nearby but I'm going to try to restart everything, just in case...
1 Like

Hi dvsvejk,

A dump190-fa heartbeat might be enough to keep piaware happy. This might, or might not work, but it very easy to test.

You are right about the 3600 second (60 minute) zero activity timer. The code for that is in the piaware config.tcl code shown below:


how many seconds with no messages received from the ADS-B receiver before

we will attempt to restart dump1090

set noMessageActionIntervalSeconds 3600

No need to look, but here is the full file if curious:

There does not seem to be a user option to change that, but there might be an easy option to test.

Dump1090-fa and most of the dump1090 variants have an option as below:


–net-heartbeat TCP heartbeat rate in seconds
(default: 60 sec; 0 to disable)

By using “–net-heartbeat 60”, it will send out a TCP packet every 60 seconds, which will keep most of the receiving software happy and lets the software know that the TCP connection has been lost. We use this on the PlanePlotter side, because otherwise PlanePlotter will assume a TCP connection has been lost after 5 minutes of no activity and reconnect to dump1090. The reconnection does no harm, but does increase logging activity, just like you noticed in the piaware logs. Yes, the “60” is the default value and does not need to be entered, but I like to show even default values to make it easier to read later. Note that if you do not list “–net-heartbeat” at all, there will be no heartbeat at all.

The heartbeat is not really aircraft traffic, but just a packet to keep the TCP connection alive. I am not positive, but the way piaware described it above as “how many seconds with no messages received from the ADS-B receiver before we will attempt to restart dump1090”, that might be enough to keep piaware alive and stop your dump1090-fa restarts.

I am currently running piaware from a package install. I have placed the heartbeat in the file as below:


file = /etc/default/dump1090-fa

Additional options can be added here:

EXTRA_OPTIONS=“–net-heartbeat 60”

If the heartbeat does not keep piaware alive, there are probably several other options available, but this would definitely be the easiest. I have always used a heartbeat. It helps PlanePlotter, and probably some of the other feeders I use as well.

Good luck,
-Dan

2 Likes

@MC130E Thanks a lot! I’ve been blundering around the piaware code for a few days trying to find some suitable file to edit. That is definitely not my core skill set. I bumped the time interval up to 7200 in config.tcl and rebooted. We’ll see how that goes.

@dvsvejk whare it the. Tcl file as I tried looking last night but can’t find it.

@Jonseyt23 /usr/lib/piaware/config.tcl

I’m sure any changes will revert to default values on applying future updates. I add this to my offline list of mods I’ve made to my system so I don’t forget what I did in the past.

1 Like

Hi dvsvejk,

No. I suspect any change to the .tcl would only be used if you compiled the programs locally.

Suggest you try the heartbeat option I suggested and see if that keeps it alive.

Good luck,
-Dan

Hi dvsvejk,

Correction: It looks like editing the config.tcl does actually work. Instead of testing for no traffic, I just did a quick test and changed the normal 5-minute (300 second) check interval to 60 seconds. Restarting Piaware showed that it was then checking every 60 seconds. Yes, I changed it back to 300.

Your test of 3600 to 7200 should work as expected. As you said, you will probably need to manually edit the file each time you do a FA software update.

Regards,
-Dan

1 Like

Last night I had 12 consecutive feeder check-ins (5 minute interval) with 0 messages, so that is at least 3600 seconds with no data. There was no restart, but I don’t consider this an acid test. A comb through my old piaware logs shows restarts happening between 3611 and 3897 seconds of inactivity, Kinda weird how the value fluctuates. I’ll need to see a week or two of data before I will call it a success. Again, many thanks for your valuable assistance.

Hi dvsvejk,

Just a guess, but the 3600 second (60 minute) no traffic test is ONLY done when the 300 second (5 minute) interval checks are done. That is probably why all your no traffic values appear to be random and between 3600-3900. If you want a quick “acid test”, you could test with a shorter no traffic time which would trigger sooner.

If you’re really curious, you could also try the EXTRA_OPTIONS=“–net-heartbeat 60”. That would likely survive a FA software update.

Thanks. I learned something in the process too, which is always a good thing!

-Dan

Well, I got my acid test but not as I expected. I had two consecutive hours with no aircraft (very rare for me) and the modified config.tcl acted as expected.

Jan 28 02:24:17 piaware piaware[553]: no new messages received in 7493 seconds, it might just be that there haven't been any aircraft nearby but I'm going to try to restart everything, just 
in case...

1 Like

I got this done but it was more annoying.

In order to put this into the piaware configuration file, you have to make it a valid config option first, then trigger the generating code to output the correct extra options to dump1090.

Here’s the process that worked for me on piaware 8.2.

  • Edit /usr/lib/piaware_packages/fa_piaware_config.tcl
  • Around line 1075 add this code: {"dump1090-net-heartbeat" -type integer -default 60}
  • Save
  • Edit /usr/lib/piaware-support/generate-receiver-config
  • Just above SLOW_CPU add this code
        if {[$config get dump1090-net-heartbeat]} {
                set heartbeat [$config get dump1090-net-heartbeat]
                dict lappend opts EXTRA_OPTIONS "--net-heartbeat" $heartbeat
        }
  • Edit /boot/piaware-config.txt
  • Add this at the end of the file: dump1090-net-heartbeat 60
  • Run sudo systemctl restart dump1090-fa

If you try to add it to /etc/default/dump1090-fa it will be overwritten every time you restart, as piaware 8.2 overwrites the config on restart or even just startup.

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