schwabe / ics-openvpn

OpenVPN for Android
3.25k stars 1.18k forks source link

Keep Connected All Time #1720

Closed ibahnasy closed 1 week ago

ibahnasy commented 2 months ago

To make issues more manageable, I would appreciate it if you fill out the following details as applicable:

General information

  1. Android Version 12
  2. Android Vendor/Custom ROM Google Pixel ROM
  3. Device Google Pixel 3 XL
  4. Version of the app (version number/play store version/self-built) 0.7.51

Description of the issue

I set this VPN app to be always connected however after locking the screen for a while, it gets disconnected, though it automatically re-connects on wake up.

I also have ping 5 in the configuration file.

schwabe commented 3 weeks ago

Please provide the log from the app itself.

ibahnasy commented 3 weeks ago

vpn.log

schwabe commented 3 weeks ago

The log seems to be truncated. Also when did you turn off the screen in that log?

ibahnasy commented 3 weeks ago

I opened the log window in the app and chose "send to file" and copied the text.

I turned the screen on/off many times during a whole day of usage.

schwabe commented 3 weeks ago

Your ping timeout might be just too aggressive. You have 10s of ping timeout. That is awfully short. Try using something like a minute or two and see if that solves your problem.

ibahnasy commented 2 weeks ago

I increased the timeout to 15 which is higher than the ping-restart time but this behavior is still happening:

ping 5
ping-restart 10
connect-timeout 15

BTW, using the same OpenVPN config on Linux laptop is working fine and never disconnects on it's own.

schwabe commented 2 weeks ago

a laptop does not typically put apps to sleep. connect-timeout also has nothing to do with ping timeout. Please increase the ping-restart to something like 60 or 120 seconds on server and client and see if that makes a different.

ibahnasy commented 1 week ago

Yes this solved the issue, thanks.