Use wifi when mobile signal goes

Post your questions and help other users.

Moderator: Martin

Post Reply
Bascule
Posts: 16
Joined: 11 May 2015 09:44

Use wifi when mobile signal goes

Post by Bascule » 09 Jul 2015 13:17

Hi,

I'd like to be able to connect to a particular wifi access point when at work but ONLY if my mobile signal drops off. I need to be on mobile data when possible because some wifi trafic is filtered at work (e.g. Hangouts). However, there are some areas where I get no signal so I would like to connect to the work wifi which is marginally better than nothing at all. I always keep wifi on on my phone so I just want to automate the switch to wifi from mobile data when the signal drops to nothing or "emergency calls only".

Any help would be gratefully received :)

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Use wifi when mobile signal goes

Post by Martin » 10 Jul 2015 10:28

Hi,

You could turn wifi off per default and use a trigger Phone Service State to detect when the signal drops off. Switch on WiFi when this happens and turn it off again when you get a signal again.
Please note that some devices don't send the events when the screen is off.
You could also try to execute a flow periodically and use condition Host Reachable to detect if the network connection really works. Such a flow might drain the battery when executed frequently so I would only turn it on when the screen is on or disable option Wake device when in sleep mode in trigger Periodic Timer.
Finding the correct time to switch WiFi off again could be difficult in such a flow, maybe switch off WiFi after a few minutes to test if mobile data works again and turn wifi on when it still does not work.

Regards,
Martin

Bascule
Posts: 16
Joined: 11 May 2015 09:44

Re: Use wifi when mobile signal goes

Post by Bascule » 13 Jul 2015 09:50

Hi Martin,

Many thanks for the reply. I was trying to figure out a way of doing it without having to turn wifi off. I generally like to leave it enable for a more accurate location - I use location sharing and location based profiles (CyanogenMOD on Oneplus One phone). So I want my phone to prefer the mobile data connection over this particular access point even if the wifi access point is configured and even if wifi is enabled - and only to use that access point if the mobile signal goes away.

The problem seems to be that there is no way (in the phone) of configuring the wifi password for a particular SSID without the phone automatically connecting to it whenever it can. The phone will always prefer wifi over mobile data. It would be great to be able set priorities to the different connections (whilst leaving wifi enabled) - e.g...

1) Home wifi whenever available
2) Mobile data if no home wifi
3) Work wifi if no mobile data

I believe there's an app that will let you prioritise wifi access points but I can't find a way of including mobile data in that prioritisation. It looks like it's something I won't be able to do - I guess it's unusual to prefer mobile data over wifi if you have the wifi network configured. But in my case, at work, I have a restricted wifi network which is second best to mobile data, but better than no connection at all.

If you have any other ideas, I'd be interested to know. Apart from that, thanks again for a very useful app :)

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Use wifi when mobile signal goes

Post by Martin » 20 Jul 2015 18:02

Hi,

Newer versions of Android provide an advanced WiFi setting called Scanning always available which will keep the WiFi scanning turned on even when WiFi is turned off (see system settings->Wi-Fi, menu->Advanced).
In this mode wifi will not connect to access points so mobile data is used for network access but WiFi is still used to scan for access points and to improve location accuracy.

Regards,
Martin

Post Reply