Keep Alive function to prevent disassociation from WISP connection

In some situations after a certain period of inactivity a WISP Wifi connection may be terminated by the host requiring to challenge the captive portal again. Is there a setting or option for a “keep alive” functionality in Glinet routers or do you need to delve into OpenWRT for this.
I know of some Engenius devices sending out a ping and trying to download a small graphical file from Google to accomplish this.

Sounds like a really smart idea, I’d love to see this functionality as well!

Maybe just write a script to ping google every 10 or 20 seconds?

Some public wifi network disallows ping, so ping may not work.

But I think you can use nc (need to install netcat if your firmware don’t have this. We added nc in newest firmware) which should be ok.

The following script tries ping, nc (google dns and http) every minute. I don’t know if this works. Need to try.

while [ true ]; do ping -c1 8.8.8.8 nc -z -v -w5 8.8.8.8 53 nc -z -v -w5 google.com 80 sleep 60 done
Some captive portal count the time, for example 1 hour, when you start to use the Internet. So this method may not work.

Just so I understand, is it to prevent the connection disconnecting due to inactivity? I might have a solution in that case.

When I was using SmartDNS, I had a URL that validated my IP every 5 minutes by automatically pinging the URL using the crontab feature.

This was achieved by going to Luci > System > Scheduled tasks and pasting in the script below, you could customise the URL to your liking.

*/5 * * * * root wget http://smartdns.smartydns.com/index.php?smartkey=0…

Perhaps this would work?

Hi here is a URL that explains it a little more, the guide is for DD-Wrt but I believe the command is just the same.

Thank you for the recommendations.
While I prefer to have a simple setting in the UI I will try to get your recommendations working, I m just not very proficient in scripting. I know the concept of Unix type carriage return, naming the file *.sh and chmod -x but don’t know where to put it.
Thanks again.

Jaap

please try @zimo’s recommendations. Cron jobs is a correct way to do this.

@Jaap

Just paste this into scheduled tasks in Luci (go to advanced settings in GLI)

 

*/5 * * * * wget https://www.google.co.uk

Thank you for your help. I will give this a try. I also found http://checkip.dyndns.com/
This will return your IP. According to DYN you are only allowed to check outside a 10 min window in order to mitigate server load

Thanks again

Jaap