2

Leaving an SSID does not start the WireGuard tunnel

Hello folks,

I bought Tasker mainly for one thing: to stop/start a WireGuard tunnel when in/out of a specific WiFi SSID, respectively. Quite a straightforward mission.

So I have two profiles: One for being inside the SSID (Wifi Connected, with the SSID name), linked  to a TunnelDown task

WireGuardSetTunnel(false,xxx)

and one for being outside that SSID (Wifi Connected, same SSID name, "invert"), linked to a TunnelUp task:

WireGuardSetTunnel(true,xxx)

When going into the SSID, the task takes place correctly and the tunnel is brought down. However when leaving the SSID, the opposite task is not performed, and the tunnel remains down.

When I'm NOT connected to the SSID, and I open the tasker app to see what's happening, the second profile is correctly lit in green (so it seems like Tasker is aware I'm out). When I "play" the corresponding task, it indeed starts the tunnel. However, that never happens automatically.

Note, only one direction is broken; when I start the tunnel manually and later go back into the SSID, the tunnel is indeed brought down, as it should.

Would appreciate your assistance here. Android 13.

EDIT: Resolved, by using one profile with entry/exit task rather than two separate profiles. Still not sure why the two profiles setup doesn't work, but my need seems to be resolved (still testing corner cases).

3 replies

Hi. Just to clarify, is is still not working? If not, maybe the WireGuard app is configured to be battery optimized so it can't always run in the background?

D

Thanks. Unfortunately, it is sort-of working, intermittently. Both apps (Tasker and WG) are configured Unrestricted in the background/batt-opt settings. Still, many times (say 2-3 out of 10?) it does not turn my VPN on when leaving the SSID and I end up having to turn it on manually. This ranks 0 in WAF :-)

On the flip side, it always turns it off when entering the SSID. Haven't seen a single blip in that direction.

LW

Happening to me as well. Just started yesterday after installing on a new phone 

D

I spoke too soon. The problem basically remains, even with the exit task configured: When entering the SSID, Tasker properly turns the tunnel off. When exiting the SSID (e.g. by selecting another SSID or by simply driving away), more often than not the tunnel is NOT turned on.

It does seem like an issue in Tasker.