wgtunnel icon indicating copy to clipboard operation
wgtunnel copied to clipboard

[BUG] - Auto tunnelling does not switch on the tunnel

Open etofi opened this issue 1 year ago • 24 comments

Describe the bug When I leave my house and the trusted WiFi, Auto Tunnelling does not switch the tunnel on. Only when I open the app. I have set everything correctly, allowed permanent location access and switched off battery optimisation.

Smartphone (please complete the following information):

  • Device: Motorola Edge 20
  • Android Version: Android 13
  • App Version 3.3.5

To Reproduce Steps to reproduce the behavior:

  1. Leave trusted WIFI

Expected behavior Auto tunnelling should switch on the tunnel when you leave the trusted WiFi even without having to open the app.

Screenshots (Only if necessary)

Additional context

etofi avatar Feb 27 '24 07:02 etofi

Hello! Do you have tunnel on mobile data enabled?

zaneschepke avatar Mar 01 '24 02:03 zaneschepke

Yes Screenshot_20240301-063024

etofi avatar Mar 01 '24 05:03 etofi

Thank you for the screenshot! A few more follow up questions..

Does this happen every time you close the app or just sometimes?

Is the auto tunnel service in paused state on the main screen?

Could you try starting auto tunneling, closing the app, turning off your wifi on your phone, and then see if it auto tunnels?

Basically, I am trying to determine if this failure only happens after the auto tunnel service has been running for a while (maybe the system killed it) or if it happens consistently every time you test.

zaneschepke avatar Mar 01 '24 05:03 zaneschepke

Does this happen every time you close the app or just sometimes?

Just sometimes.

Is the auto tunnel service in paused state on the main screen?

State is active

Could you try starting auto tunneling, closing the app, turning off your wifi on your phone, and then see if it auto tunnels?

In the moment it works. But sometimes not. I can not reproduce it.

Basically, I am trying to determine if this failure only happens after the auto tunnel service has been running for a while (maybe the system killed it) or if it happens consistently every time you test.

I think it is a "run for a while" problem

etofi avatar Mar 03 '24 06:03 etofi

Screenshot_20240303-163111 So today is the day again. The tunnel is not switched on even though I've been travelling for over 3 hours now... Status is active. The tunnel is activated immediately when the app is opened

etofi avatar Mar 03 '24 19:03 etofi

I have the same issue using the Play store version, with a Pixel 8.

The auto-tunnel will not connect the tunnel when I disconnecte from wifi or when I leave wifi coverage. If I open the application the connection is established quickly. And the auto-connection also works for some time after that.

Is there a way to enable some logging to understand what is going on ?

slubman avatar Mar 15 '24 06:03 slubman

I have the same issue using the Play store version, with a Pixel 8.

The auto-tunnel will not connect the tunnel when I disconnecte from wifi or when I leave wifi coverage. If I open the application the connection is established quickly. And the auto-connection also works for some time after that.

Is there a way to enable some logging to understand what is going on ?

Hello! Thank you for the additional info. I'm sorry for the delay. I should have a fix out for this soon. Additionally, the next version of the app I am adding a logs screen to view the logs.

zaneschepke avatar Mar 15 '24 12:03 zaneschepke

I have seen that 3.3.9 is now available. When will it be available in F-Droid?

etofi avatar Mar 19 '24 15:03 etofi

I have seen that 3.3.9 is now available. When will it be available in F-Droid?

Hey! It usually takes about a week, but there are currently some issues with Fdroid pipeline because I have a lib that is still in process of getting published to maven central. It is currently hosted on my own package repository, but fdroid doesn't support this. Current issues for this is #47

zaneschepke avatar Mar 19 '24 16:03 zaneschepke

F-Droid is currently upgrading to Debian Bookworm which has Java 17 installed by default.

It will take a cycle or two, so breakage is expected until done.

licaon-kter avatar Mar 21 '24 16:03 licaon-kter

I'm seeing the same issue. The tunnel is not always automatically enabled on entering untrusted wifi or mobile data. For me too it seems like a "run for a while" problem. When I start the WG tunnel app, it immediately enables the tunnel. I have set battery usage to "unlimited" (as opposed to "optimised" or "reduced") I'm on the 3.4.2 version from the play store. I don't think the logs will be helpful, as when I look at "read the logs" they only go back to after I started the app, so don't show the time period in which autotunnel did not trigger.

kiekerjan avatar Apr 20 '24 13:04 kiekerjan

I'm seeing the same issue. The tunnel is not always automatically enabled on entering untrusted wifi or mobile data. For me too it seems like a "run for a while" problem. When I start the WG tunnel app, it immediately enables the tunnel. I have set battery usage to "unlimited" (as opposed to "optimised" or "reduced") I'm on the 3.4.2 version from the play store. I don't think the logs will be helpful, as when I look at "read the logs" they only go back to after I started the app, so don't show the time period in which autotunnel did not trigger.

I'll keep investigating. This is a very hard one to troubleshoot.

Do you know if the auto tunneling notification was still visible when you noticed this issue or was it closed?

Also, do you have any rough estimate on how often this occurs so I can try to replicate on a few different devices?

zaneschepke avatar Apr 20 '24 18:04 zaneschepke

I probably swiped that icon away manually. I'll keep it present and see what happens. Rough estimate is like 1 in 3 times I leave my home (where the trusted wifi is)

kiekerjan avatar Apr 21 '24 17:04 kiekerjan

So it just happened once more. The icon reporting "monitoring network state changes: active" was still present. When I clicked it, the WG tunnel UI was opened and it resumed auto tunneling. The logging went only back to the moment when I opened the UI.

kiekerjan avatar Apr 24 '24 16:04 kiekerjan

So it just happened once more. The icon reporting "monitoring network state changes: active" was still present. When I clicked it, the WG tunnel UI was opened and it resumed auto tunneling. The logging went only back to the moment when I opened the UI.

I got exactely the same, auto-tunnel did not activate, when opening the application immediatly re-established the connection, the log only start from when I opened the application, despite the notification being shown.

slubman avatar Apr 24 '24 20:04 slubman

So it just happened once more. The icon reporting "monitoring network state changes: active" was still present. When I clicked it, the WG tunnel UI was opened and it resumed auto tunneling. The logging went only back to the moment when I opened the UI.

I got exactely the same, auto-tunnel did not activate, when opening the application immediatly re-established the connection, the log only start from when I opened the application, despite the notification being shown.

I'm seeing the same thing. It happened to me once yesterday and once today. The toggle indicated I was connected, but I clearly wasn't. Once I opened the app, I was immediately connected. Both times the auto tunneling notifications were visible.

Thanks for the great app!

genomez avatar Apr 24 '24 22:04 genomez

I have the same issue. After a time, even though the notifications are active, the tunnel doesn't start when it should. Once, I just had to open the app for the tunnel to activate, but more recently, I had to manually stop and start the auto-tunnelling.

A point of reference is that I changed the notifications to "silent" in the Android notification settings.

dkoppenh avatar Apr 28 '24 05:04 dkoppenh

I have the same issue. After a time, even though the notifications are active, the tunnel doesn't start when it should. Once, I just had to open the app for the tunnel to activate, but more recently, I had to manually stop and start the auto-tunnelling.

A point of reference is that I changed the notifications to "silent" in the Android notification settings.

I'm still working on getting to the bottom of this one. This is a top priority.

zaneschepke avatar Apr 28 '24 05:04 zaneschepke

I made some changes to the latest release 3.4.3 that could potentially help with this issue. Please let me know if anyone notices any differences or if this issue is still persisting.

zaneschepke avatar May 11 '24 04:05 zaneschepke

Unfortunately, only version 3.4.2 is available on F-Droid. The app has now been updated to 3.4.4...

etofi avatar May 12 '24 06:05 etofi

Unfortunately, only version 3.4.2 is available on F-Droid. The app has now been updated to 3.4.4...

Yeah, Fdroid build/deployment pipelines takes up to one week. If you want updates immediately, feel free to add my custom Fdroid repo to the Fdroid app.

https://github.com/zaneschepke/fdroid

zaneschepke avatar May 12 '24 20:05 zaneschepke

Yeah, Fdroid build/deployment pipelines takes up to one week. If you want updates immediately, feel free to add my custom Fdroid repo to the Fdroid app.

https://github.com/zaneschepke/fdroid

In your custom Repo only version 3.4.2 is available, too via F-Droid app.

etofi avatar May 13 '24 04:05 etofi

Yeah, Fdroid build/deployment pipelines takes up to one week. If you want updates immediately, feel free to add my custom Fdroid repo to the Fdroid app.

https://github.com/zaneschepke/fdroid

In your custom Repo only version 3.4.2 is available, too via F-Droid app.

Hmm. Are you sure you have the repo added properly? I'm able to install 3.4.4 with my repo via F-droid.

zaneschepke avatar May 13 '24 04:05 zaneschepke

Hmm. Are you sure you have the repo added properly? I'm able to install 3.4.4 with my repo via F-droid.

I had to uninstall the F-Droid version to be able to install the one from the WGTunnel repository.

slubman avatar May 13 '24 10:05 slubman

I have the same issue that the Auto connect / disconnect is not doing anything for me. I installed the Store version on LineageOS, enabled "Tunnel on mobile data", enabled "Tunnel on untrusted wifi" and added my WiFi SSID. I also tried with setting a default tunnel and not (I only have one tunnel anyway). I allowed the app to be exempt from the battery savings and allowed it access to my location data. I restarted the Smartphone, tried with the app opened, in background and closed.

My tests was always done by turning the wifi off and on and waiting a minute. Maybe I am testing wrong and wifi should be enabled, but you have to leave the wifi zone?

kladderadeng avatar May 27 '24 15:05 kladderadeng

I have the same issue that the Auto connect / disconnect is not doing anything for me. I installed the Store version on LineageOS, enabled "Tunnel on mobile data", enabled "Tunnel on untrusted wifi" and added my WiFi SSID. I also tried with setting a default tunnel and not (I only have one tunnel anyway). I allowed the app to be exempt from the battery savings and allowed it access to my location data. I restarted the Smartphone, tried with the app opened, in background and closed.

My tests was always done by turning the wifi off and on and waiting a minute. Maybe I am testing wrong and wifi should be enabled, but you have to leave the wifi zone?

This specific use case has a bug that I'm currently working on where it does not turn on the tunnel when switching from wifi to mobile data. I should have a fix out for this soon!

zaneschepke avatar May 28 '24 04:05 zaneschepke

Not sure if this belongs here or in a new issue but I'm having similar problems with auto-tunneling. In my case I want to connect to a specific tunnel when I connect to a specific WiFi network. I've added the SSID to the 'Use tunnel on wifi name' field on the settings page for the tunnel and enabled auto-tunneling but when I connect to that WiFi network nothing happens.

KjartanOli avatar May 30 '24 00:05 KjartanOli

Not sure if this belongs here or in a new issue but I'm having similar problems with auto-tunneling. In my case I want to connect to a specific tunnel when I connect to a specific WiFi network. I've added the SSID to the 'Use tunnel on wifi name' field on the settings page for the tunnel and enabled auto-tunneling but when I connect to that WiFi network nothing happens.

I've just released a new version 3.4.5. Could you try this on that version and see if you are getting the same behavior? Also, could you please share your phone model and version?

Please make sure you also have "tunnel on untrusted wifi" enabled on the settings screen and auto tunneling started and not in the paused state.

zaneschepke avatar May 31 '24 04:05 zaneschepke

Turning on 'tunnel on untrusted wifi' makes it work. The tunnel activates when connect to the WiFi network. However, I don't want to tunnel on all untrusted networks, currently this is the only network I want to tunnel on. Is that possible?

KjartanOli avatar May 31 '24 10:05 KjartanOli

Turning on 'tunnel on untrusted wifi' makes it work. The tunnel activates when connect to the WiFi network. However, I don't want to tunnel on all untrusted networks, currently this is the only network I want to tunnel on. Is that possible?

Not currently possible, but I have had a request for a similar feature so I'll work on adding this.

zaneschepke avatar May 31 '24 11:05 zaneschepke