rethink-app icon indicating copy to clipboard operation
rethink-app copied to clipboard

v055u: wifi only automation not always working

Open shifoc opened this issue 2 months ago • 5 comments

It stays paused

shifoc avatar Nov 04 '25 11:11 shifoc

On some WiFi networks, the actual SSIDs remain "hidden".

Will you filter for getNetworkSSID in Configure -> Settings -> App logs (remember to change the log level to "Very verbose" by tapping on the filter icon in the search bar of the App logs UI) as you switch to WiFi where the WireGuard stays paused when it shouldn't? That should tell us whether the active WiFi network is hiding its SSID.

ignoramous avatar Nov 04 '25 18:11 ignoramous

On some WiFi networks, the actual SSIDs remain "hidden".

Will you filter for getNetworkSSID in Configure -> Settings -> App logs (remember to change the log level to "Very verbose" by tapping on the filter icon in the search bar of the App logs UI) as you switch to WiFi where the WireGuard stays paused when it shouldn't? That should tell us whether the active WiFi network is hiding its SSID.

I couldn't see anything in the logs but if I stop the service and start it again it will connect instantly

shifoc avatar Nov 05 '25 08:11 shifoc

start it again it will connect instantly

Wow. Strange.

I couldn't see anything in the logs

At "Very verbose" log level, Rethink should print logs with getNetworkSSID in it, which the search filter should be able to reveal. To make sure the search filter isn't struggling (due to a high volume of "Very verbose" logs streaming in), you can set the log level back to "None" to pause log collection before you use search.

ignoramous avatar Nov 06 '25 17:11 ignoramous

Hi again,

I am not sure but I think if the app is in the background, it doesn't work.

1762503214588,V ConnectivityEvents: getNetworkSSID: SSID is unknown for network 716370268173, falling back to WifiManager
...
1762503214687,V ConnectivityEvents: isNetworkCellular: netid: 166, hasCellular? false, hasWifi? true, metered? false
...
v4: [NetworkProperties(network=166, capabilities=[ Transports: WIFI Capabilities: NOT_METERED&INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&VALIDATED&NOT_ROAMING&FOREGROUND&NOT_CONGESTED&NOT_SUSPENDED&NOT_VCN_MANAGED&NOT_BANDWIDTH_CONSTRAINED LinkUpBandwidth>=16143Kbps LinkDnBandwidth>=44260Kbps TransportInfo: <SSID: <unknown ssid>, BSSID: 02:00:00:00:00:00, MAC: 02:00:00:00:00:00, IP: /***, Security type: 3, Supplicant state: COMPLETED, Wi-Fi standard: 11ax, RSSI: -40, Link speed: 573Mbps, Tx Link speed: 573Mbps, Max Supported Tx Link speed: 573Mbps, Rx Link speed: 573Mbps, Max Supported Rx Link speed: 573Mbps, Frequency: 5200MHz, Net ID: -1, Metered hint: false, score: 60, isUsable: true, CarrierMerged: false, SubscriptionId: -1, IsPrimary: -1, Trusted: true, Restricted: false, Ephemeral: false, OEM paid: false, OEM private: false, OSU AP: false, FQDN: <none>, Provider friendly name: <none>, Requesting package name: <none><none>MLO Information: , Is TID-To-Link negotiation supported by the AP: false, AP MLD Address: <none>, AP MLO Link Id: <none>, AP MLO Affiliated links: <none>, Vendor Data: <none>> SignalStrength: -40 UnderlyingNetworks: Null], linkProperties={InterfaceName: wlan0 
...
1762503214692,D RethinkDnsVpn: VpnService; getNetworkSSID - onNetworkConnected: active: null, v4: 716370268173##, v6:

when the app was in foreground I got those logs:

1762502544792,I ConnectivityEvents: getNetworkSSID: SSID for network 441492361229 is: <Redacted>

is it because you are missing the ACCESS_BACKGROUND_LOCATION permission to get the SSID info while in background?

shifoc avatar Nov 07 '25 08:11 shifoc

Perhaps!

+ <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+ <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+ <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" tools:targetApi="29" />
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

Pointers: https://github.com/wgtunnel/wgtunnel/commit/7f0fea3766a4d807bfa0b7801fd6a1ffc88ec7b1

Surprising since all VPNs are technically registered as being in foreground 🤷

ignoramous avatar Nov 07 '25 17:11 ignoramous