Check Internet access on Network Connection

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
Brounoh
Posts: 11
Joined: 15 Apr 2014 19:44

Check Internet access on Network Connection

Post by Brounoh » 01 Aug 2014 14:39

Hi,

as I travel a lot I use to connect to many friend's/hotel/workplace Wifi networks. All these have straight password, so I access everything directly as I have the related passwords.
For hotspot such as starbuck, ISP hotspots... to which I have connected once to their network (therefore saved in my Wifi List), there is very often a validation page, or a code entering page.

My issue:: I have set a Flow that, 1) if Wifi loses connection to a network, 2) sleeps 2 minutes, 3) if no new connection to know network 4) Wifi gets switched off.
If my Wifi is ON and I walk near such hotspots described above, my trigger to switch the Wifi to OFF (if not connected) does not work as I keep being connected to random Wifi hotspot, however I do not get internet connection due to the validation pages mentioned above.

Enhance, I am wondering if there is a Condition (that I haven't discovered yet) or if there could be a Condition that would check if there is a proper internet connection, e.g. for instance ping a server and check if there is a response.
Therefore in my flow I could have that Condition Turning the Wifi OFF even if connected to a Hostpot, given that there is not internet connection.

Hope it is clear.

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

Re: Check Internet access on Network Connection

Post by Martin » 02 Aug 2014 07:18

Hi,

There's a condition Host Reachable to check if a particular host can be contacted. The socket option with port 80 might work in your scenario. Ping is not supported on all devices or could fail when a server does not respond to ICMP requests.
As a last resort when the above action should fail, you could use an action HTTP Request to check if a particular webpage returns the expected content.

Regards,
Martin

Brounoh
Posts: 11
Joined: 15 Apr 2014 19:44

Re: Check Internet access on Network Connection

Post by Brounoh » 02 Aug 2014 14:44

Martin wrote:Hi,

There's a condition Host Reachable to check if a particular host can be contacted. The socket option with port 80 might work in your scenario. Ping is not supported on all devices or could fail when a server does not respond to ICMP requests.
As a last resort when the above action should fail, you could use an action HTTP Request to check if a particular webpage returns the expected content.

Regards,
Martin
Martin,

that sounds like what will do the trick. I will update my flows and report later if I get into a wall and need help again :)
Best,
B.

Brounoh
Posts: 11
Joined: 15 Apr 2014 19:44

Re: Check Internet access on Network Connection

Post by Brounoh » 02 Aug 2014 15:46

Martin, your suggestion Host Reachable works greatly.

I am pinging http://www.livescore.com (I want something NOT Google, Yahoo... that some hotspots might let throught for emails etc... livescore is light so it always loads up very quickly - any suggestion of something lighter and quicker, I am a taker!).

Attached is the Flow if someone wants it or if someone has even better suggestions.

I use it this way:
I use Llama to set specific Recurrent Locations, it triggers Wifi / Data ON and OFF depending if I am entering or leaving. However, when leaving some of these Recurrent Locations, I gave a 1 minute delay to adjust for the location and for potential mobile mast change. During the delay, my phone tend to connect to a bunch of random public hotspot on my path (e.g. SFR Wifi, Free Wifi in France, BT Wifi, O2 Wifi in the UK, etc etc etc...). With this Automagic Flow it switches Wifi Off if it cannot get access to Internet. If the Hotspot lets me through, then Wifi stays on, Data stays off.

I use to do the location triggers within Automagic but I may have not used it correctly as the phone didn't know well enough where I was (I used Network location settings to avoid GPS), therefore now I use Llama as it locates me well given the mobile mast around - also a taker if Automagic does that well too with mobile mast (I did not find a setting that way - Period Location Update with "Balanced Power/Accuracy (Experimental)" maybe but I am afraid to put something like 4m as it might kill the battery and "Balanced Power/Accuracy (Experimental)" does not see accurate enough to me (<100m)).
Attachments
flow_WiFi_Enabling_20140802_173658.xml
(4.8 KiB) Downloaded 1043 times

Locked