Easer icon indicating copy to clipboard operation
Easer copied to clipboard

[temp solved] LineageOS 18.1 Event Wi-Fi Connection on connect not working (Update on 19.1 too).

Open vsatmydynipnet opened this issue 3 years ago • 12 comments

Describe the bug I have setup an event to start openvpn and switch owntrack recording mode if leaving home WLAN. this works fine on my Samsung A5 2017 / LineageOS 18.1 (Setup was baed on this tutorial https://kmj.at/en/Easer_Smartphone_Automation_for_LineageOS_and_Android_Example_for_OpenVPN_%20SIP_Softphone_Nexttracks_Owntracks/ ).

Now I got a new Fairphone 3+ and setup things in the same way. For whatever reason, leaving the home wlan is detected as usual, but coming home WLAN connection is not detected and openvpn and owntracks continues to run.

If I click the reload button on the overview page, WLAN is detected and openvpn is stopped, owntrack mode set to manual.

So the error is that when coming home, the wlan connection, which happens and the device is successfully connect, but Easer does not see connection happens and run the actions by itself.

To Reproduce Hard to say, my Samsung does it the FP3+ does not do it

Additional context Device FP3+ OS LineageOS 18.1, no Gapps Version is 8.2.2-beta from F-Droid

Currently can leave with it, because it detects when i move out, but manual action coming home is kinda annoying, especially where some areas at home has no WLAN, so need to switch back manually, even if i do not leave the house.

Any idea is greatly appreciated.

vsatmydynipnet avatar Apr 19 '22 16:04 vsatmydynipnet

I am one step ahead now:

  • If I unlock the device and bringt Easer in the foreground, e.g. moving around while pivor is on the screen. All works as expected.
  • Unlocking the device, not running Easer in Foregroud is the same as locked, means leving the Wi-Fi works, but reconnecting to it, not. This is kinda ignored.

vsatmydynipnet avatar Apr 21 '22 13:04 vsatmydynipnet

Hi. Thanks for the bug report. Could I check if you have disabled "battery optimization" for Easer in your system setting? This seems to be similar to (the comments in) #377.

renyuneyun avatar Apr 23 '22 13:04 renyuneyun

Good afternoon, yes Battery Optimization is disabled. I think i definitely tried everything I found, also in #377. The same setup works on Samsung A5 2017 LineageOS 18.1 noGapps. I have installed all apps in the same way on the FP3+ and everything works fine, root is working too.

Only Easer must be in the foreground then all is working too. As soon as locked, or even unlocked, but not in the forground, Easer only does leaving home (Start OpenVPN, Set Owntracks to move mode.). Coming home should stop OpenVPN and switch Owntracks to Manual mode, but this does not work if not in the foreground.

vsatmydynipnet avatar Apr 23 '22 14:04 vsatmydynipnet

That is interesting to see two phones with (supposedly) the same ROM version have different behaviours. Could you first try v0.8.2.3-beta2 and see if this still exists?

If not, I have a guess related to foreground services -- not the logic, but a missing line in the AndroidManifest.xml. The next beta release should contain a fix to that, so you may have a try again and see if the issue you are facing is fixed.

renyuneyun avatar Apr 23 '22 14:04 renyuneyun

I am already on y v0.8.2.3-beta2. Whenever you have a apk let me know, will try it on the FP3+. Thank you for your work.

vsatmydynipnet avatar Apr 23 '22 14:04 vsatmydynipnet

Thanks. I uploaded the release to https://github.com/renyuneyun/Easer/releases/tag/v0.8.3-beta? If you have time, could you have a try and report back?

renyuneyun avatar Apr 24 '22 18:04 renyuneyun

Thank you! I already installed it and will test it later today. First difference I see is, that notifications are not more shown up under quiert. Will report back later.

vsatmydynipnet avatar Apr 25 '22 10:04 vsatmydynipnet

After using it today I have to state, that the situation is the same as before. Leaving the house, starting OpenVPN + Set Owntracks to Move mode works, coming home it looks like it is ignoring the Connection to Home WiFi SID.

vsatmydynipnet avatar Apr 25 '22 16:04 vsatmydynipnet

Same here. Xperia XA with LineageOS 18.1 with microg.

helge42 avatar May 04 '22 12:05 helge42

This comes out as really bad bug. It happens often that, for whatever reason, the fp3+ stops wifi during the night, then easer switches owntracks to move mode and drains the battery, so that in the morning in am on 5-8%. :-( because of not switching back after wifi is active again, i can not do anything......

Hopefully there is a solution soon

vsatmydynipnet avatar Jun 06 '22 08:06 vsatmydynipnet

UPDATE: I dirty flashed LOS 19.1 over my 18.1 FP3+ (No Gapps, rooted with Magisk).

The Problem still exists here. Leaving the WiFi works great, reconnecting is ignored. :-(

vsatmydynipnet avatar Jul 13 '22 10:07 vsatmydynipnet

I temporary was able to solve the WiFi stuff using condition

Connected -> [X] Mobile and reverse (not connected mobile) when being home using the Wifi.

That way I am back to be able to trust phone operations. I know this works only for people like me never using public hotspots and other connection, except WiFi home and Mobile if not at home. So a WiFi fix would be great.

vsatmydynipnet avatar Jul 16 '22 08:07 vsatmydynipnet