Timeout for PktLog and SysLog

24 views
Skip to first unread message

David Rose

unread,
Jan 22, 2026, 4:12:45 PMJan 22
to DigiPi
I like to have PktLog, SysLog and the Direwatch.php view of the Screen open on my computer to monitor the system.

The Screen seems to stay connected, but PktLog and SysLog disconnect at some point and a Return does not Reconnect. 

Is there a setting to keep them on as long as the system is up?

David

Craig

unread,
Jan 22, 2026, 4:34:54 PMJan 22
to David Rose, DigiPi
Hi David, I've seen this too, and I haven't characterized the problem just yet.  I think
it has to do with sketchy wifi (don't see it when hard-wired).

In any event, I use ssh (aka putty) on my pc to run "direlog.sh", which is the PktLog.
You can tail the SysLog with "journalctl -f".

if it helps,
-craig
KM6LYW
--
You received this message because you are subscribed to the Google Groups "DigiPi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to digipi+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/digipi/17a2ad77-370d-4776-a602-b839aa14b365n%40googlegroups.com.

mikel...@gmail.com

unread,
Jan 23, 2026, 8:26:43 AM (14 days ago) Jan 23
to Craig, David Rose, DigiPi
I see this even hardwired. 

—Mike

Michael Lord-Imaizumi
mikel...@gmail.com
619-840-4715
N5MCL EL09wr



On Jan 22, 2026, at 3:34 PM, Craig <km6...@gmail.com> wrote:

 Hi David, I've seen this too, and I haven't characterized the problem just yet.  I think

Craig

unread,
Jan 23, 2026, 9:31:56 AM (14 days ago) Jan 23
to mikel...@gmail.com, David Rose, DigiPi
The ttyd bug is here,

https://github.com/tsl0922/ttyd/issues/664

Possibly something to do with browser closing unused websocket connection, possibly
workaround by setting pings more frequently.

best,
-craig
KM6LYW

Craig

unread,
Jan 23, 2026, 10:10:08 AM (14 days ago) Jan 23
to mikel...@gmail.com, David Rose, DigiPi
Let's try adding a more frequent ping to keep syslog/pktlog/linpac alive, so the
browser doesn't close idle web sockets,


/var/www/html/log.php  add "-P 19" to give it a try, let us know, so far so good here,


<?php
     $output = shell_exec("pgrep -f 'ttyd -W -p 7682' 2> /dev/null ");
     if ( ! empty($output) ) {
        exec("pkill -f 'ttyd -W -p 7682' > /dev/null 2>&1");
        sleep(1);
     }
     exec("/usr/bin/ttyd -W -P 19 -p 7682 -t fontSize=20 -o -s SIGTERM /usr/local/bin/direlog.sh > /dev/null 2> /dev/null &" );
     sleep(1);
?>




for linpac, for example,


#craiger added -P19 to keep connection alive?
if (isset($_POST["linpac"])) {
     exec("export HOME=/home/pi/; sudo su -c \"/usr/bin/ttyd -W -P 19 -p 7687 -t fontSize=16 -o  -s SIGTERM /home/pi/linpac.sh  > /dev/null 2> /dev/null &\" pi
 " );



On 1/23/26 05:26, mikel...@gmail.com wrote:

mikel...@gmail.com

unread,
Jan 25, 2026, 10:32:17 AM (12 days ago) Jan 25
to Craig, David Rose, DigiPi
thanks. I’ll give it a try when I have a chance. 

73

—Mike

Michael Lord-Imaizumi
mikel...@gmail.com
619-840-4715
N5MCL EL09wr



On Jan 23, 2026, at 9:10 AM, Craig <km6...@gmail.com> wrote:

 Let's try adding a more frequent ping to keep syslog/pktlog/linpac alive, so the
Message has been deleted

David Rose

unread,
Jan 27, 2026, 11:24:34 AM (10 days ago) Jan 27
to DigiPi
I've been testing with two devices. One with the P 19 code added and the other without. 
I launched PktLog on both devices and displayed on my screen. My computer screen went to sleep, but the computer is set to stay running. 

/var/www/html/log.php  add "-P 19


<?php
     $output = shell_exec("pgrep -f 'ttyd -W -p 7682' 2> /dev/null ");
     if ( ! empty($output) ) {
        exec("pkill -f 'ttyd -W -p 7682' > /dev/null 2>&1");
        sleep(1);
     }
     exec("/usr/bin/ttyd -W -P 19 -p 7682 -t fontSize=20 -o -s SIGTERM /usr/local/bin/direlog.sh > /dev/null 2> /dev/null &" );
     sleep(1);
?>



I don't have a specific time, but I just came home after 4 hours and found the one without P 19 timed out with a Press to Reconnect. The other is still going. 

There are a lot of factors, but this was a good sign. I didn't have SysLog running, but LinPac was and they were both timed out, but I didn't change any code for LinPac. I didn't understand the instructions on what to possibly change for LinPac.



David

Craig

unread,
Jan 27, 2026, 11:33:29 AM (10 days ago) Jan 27
to David Rose, DigiPi
Thanks for the observations, I'm happy(er) with the more frequent pings to keep
the browser from closing the websocket.   I'll be adding -P 19 to all of the ttyd
commands in the next release, but you can edit these lines now if it helps,


pi@cool:/var/www/html $ grep "ttyd -W" *php | grep exec
alsa.php:      $output = shell_exec("pgrep -f 'ttyd -W -p 7690' 2> /dev/null ");
alsa.php:         exec("pkill -f 'ttyd -W -p 7690' > /dev/null 2>&1");
alsa.php:      exec("/usr/bin/ttyd -W -p 7690 -t fontSize=14 -t 'theme={ \"foreground\": \"white\", \"background\": \"black\" }' -o  -s SIGTERM  sudo alsamixer > /dev/null 2> /dev/null &" );
axcall.php:      exec("/usr/bin/ttyd -W -p 7685 -t fontSize=20 -o  -s SIGTERM telnet localhost 4444   > /dev/null 2> /dev/null &" );
axcall.php:      exec("export HOME=/home/pi/; sudo su -c \"/usr/bin/ttyd -W -P 19 -p 7687 -t fontSize=16 -o  -s SIGTERM /home/pi/linpac.sh  > /dev/null 2> /dev/null &\" pi  " );
axcall.php:#      exec("export HOME=/home/pi/; sudo su -c \"/usr/bin/ttyd -W -p 7688 -t fontSize=16 -o  -s SIGTERM /home/pi/paracon.sh  > /dev/null 2> /dev/null &\" pi  " );
axcall.php:      exec("export HOME=/home/pi/; cd /home/pi/.config; /home/pi/paracon_setup.sh; sudo su -c \"/usr/bin/ttyd -W -p 7688 -t fontSize=16 -o -s SIGTERM /usr/local/bin/paracon.pyz  > /dev/null 2> /dev/null &\" pi  " );
axcall.php:         #exec("/usr/bin/ttyd -W -p 7686 -t fontSize=20 -o  -s SIGTERM axcall -r radio $target          > /dev/null 2> /dev/null &" );
axcall.php:         exec("/usr/bin/ttyd -W -p 7686 -t fontSize=20 -o  -s SIGTERM /home/pi/axcall.sh -r radio $target          > /dev/null 2> /dev/null &" );
axcall.php:         #exec("/usr/bin/ttyd -W -p 7686 -t fontSize=20 -o  -s SIGTERM axcall -r radio $target via $via > /dev/null 2> /dev/null &" );
axcall.php:         exec("/usr/bin/ttyd -W -p 7686 -t fontSize=20 -o  -s SIGTERM /home/pi/axcall.sh -r radio $target via $via > /dev/null 2> /dev/null &" );
gps.php:      $output = shell_exec("pgrep -f 'ttyd -W -p 7689' 2> /dev/null ");
gps.php:         exec("pkill -f 'ttyd -W -p 7689' > /dev/null 2>&1");
gps.php:      exec("/usr/bin/ttyd -W -p 7689 -t fontSize=14 -t 'theme={ \"foreground\": \"black\", \"background\": \"#eeeeee\" }' -o -s SIGTERM /usr/bin/cgps --silent > /dev/null 2> /dev/null &" );
log.php:      $output = shell_exec("pgrep -f 'ttyd -W -p 7682' 2> /dev/null ");
log.php:         exec("pkill -f 'ttyd -W -p 7682' > /dev/null 2>&1");
log.php:      exec("/usr/bin/ttyd -W -p 7682 -t fontSize=20 -o -s SIGTERM /usr/local/bin/direlog.sh > /dev/null 2> /dev/null &" );
shell.php:      exec("kill `ps ax | grep 'ttyd -W -p 7681' | grep -v grep | cut -f 1 -d\  ` >/dev/null 2>/dev/null ");
shell.php:      exec("/usr/bin/ttyd -W -p 7681 -t fontSize=20 -o  -s SIGTERM sudo /bin/login > /dev/null 2> /dev/null &" );
syslog.php:      $output = shell_exec("pgrep -f 'ttyd -W -p 7683' 2> /dev/null ");
syslog.php:         exec("pkill -f 'ttyd -W -p 7683' > /dev/null 2>&1");
syslog.php:      exec("/usr/bin/ttyd -W -p 7683 -t fontSize=20 -o  -s SIGTERM  sudo tail -f /var/log/syslog > /dev/null 2> /dev/null &" );
Reply all
Reply to author
Forward
0 new messages