Keep Alive
-
I have a device that falls off the network if there is no activity after about 30 minutes. It has to be reboot or locally activated to wake up and be accessible through the LAN via web GUI. This is a known issue of the device. Is there a way to run a keep alive command on the pfsense to keep the connection open?
-
What sort of activity is needed? If a ping is good enough, then a simple shell script should do it. Here's one I've used to test for problems. Adjust to taste.
#! /bin/sh
while [ 1 ]
do
ping <device address> -c 1 || date >> ~/log;sleep 50
doneYou probably don't need the logging part, so it can be omitted.
-
@jknott Thank you for the suggestion. How do you run a shell script from the pfsense GUI?
-
You don't. You run it from the command prompt, though you may be able to have it start automatically on boot up.
-
@jknott Thanks! I see now there is a Shellcmd Configuration package that can be installed and used to run it. Will see how it goes.
-
That may do it. Also, that script is set for 50 seconds per cycle. You can adjust that as needed.
-
@jknott Well the command works but it didn't keep the device connected. Not sure what other commands I can use since pinging it every minute didn't work.
-
Do you know what's required to keep is alive? If all else fails, you can use my script to test for failure and send a wake on LAN frame.
-
@jknott No its a timeclock and the company provides no instruction. Already contact them and they know its an issue that they have not corrected...... https://www.icontime.com. I added your ping script through the GUI shell package. Not sure how to send wake on LAN frame.
-
@biggreydog alright I added the cron package and added a WOL command every hour on the hour.. not let's see this thing work now!
-
You could probably just run fetch against it to establish a connection periodically. Assuming it has an http interface.
You might find WoL does nothing. Until it's actually gone off at least.
Steve
-
There's no point in running WoL until it fails to respond to my script.
-
@stephenw10 It has an http interface. I'm not familiar with fetch. What command would I use?
-
Just pull a page from it, so maybe:
fetch http://<timeclock_IP>/index.html > /dev/null
Steve