Post your questions and help other users.
Moderator: Martin
-
Econdoc
- Posts: 153
- Joined: 28 May 2016 20:06
Post
by Econdoc » 16 Jul 2016 15:54
My WiFi is set to “always on”. I get (seemingly randomly) disconnects from my own home WiFi. If my phone sits on a desk for hours, it will disconnect from WiFi without ever having been moved. I use “WiFi disconnect from home” as a trigger to turn on Bluetooth. When I set up my flows, I assumed that as long as I stayed home, I would stay connected. Not working out very well.
- Is it normal for WiFi to disconnect or is this a phone issue?
If it is normal, should some other trigger be used? Or some other logic?
Is there a better way to approach this problem?
-
Bushmills
- Posts: 286
- Joined: 23 Sep 2014 21:56
Post
by Bushmills » 16 Jul 2016 17:26
WiFi dis- and reconnect happen sporadically. Not really frequently here, but enough to make addition of extra logic to home presence detection desirable.
What I do here is to use WiFi disconnect from home SSID to enable geolocation monitoring, and disable geolocation monitoring when connecting to home SSID. Actual action related to leaving home is only done when exit from home geofence occurs. One of those actions is disabling WLAN, which is turned on again by geofence enter event. From that point, WLAN can connect again, which completes detection of home arrival event.
-
Martin
- Posts: 4468
- Joined: 09 Nov 2012 14:23
Post
by Martin » 16 Jul 2016 19:41
Maybe it's caused by some kind of battery optimization of the device. I'll make a test to see if this happens on my devices. What device model are you using?
You could build a flow that rechecks the wifi connection after a short amount of time to see if the disconnection is permanent or if it was just a short interruption. Something like this could work:
-trigger WiFi Disconnected: WiFiXYZ
-action Sleep: 30s
-condition WiFi Connected: WiFiXYZ
--> true: -action Notification on Screen: WiFi Reconnected within 30s
--> false: -action Set Bluetooth State: On
-
Econdoc
- Posts: 153
- Joined: 28 May 2016 20:06
Post
by Econdoc » 16 Jul 2016 21:09
Thanks Bushmills and Martin.
The phone is a OnePlus One, running Marshmallow (CM 13.1).
I am following Martin's suggestion and waiting a while for a reconnect. That seems much simpler than installing a geofence. (I don't like turning GPS on unless I really need it!)
Hope that solves the problem.
-
Bushmills
- Posts: 286
- Joined: 23 Sep 2014 21:56
Post
by Bushmills » 16 Jul 2016 21:30
Well, I like to have geofence monitoring on outside anyway, because the device responding to different locations in various ways, therefore home presence detect kind of gets a free ride.
-
Martin
- Posts: 4468
- Joined: 09 Nov 2012 14:23
Post
by Martin » 17 Jul 2016 11:33
I happen to have a OnePlus One test device. I'll monitor the wifi connection to see if I can reproduce the problem.
I'll test with the default settings (not charging, WiFi set to always on, System settings->Battery->Battery mode: Balanced, Enable per-app profiles: on, Battery optimization for Automagic: on). Let me know if you use different settings.