Page 1 of 1

How can I test whether or not I have an internet connection?

Posted: 10 Mar 2017 15:36
by Econdoc
What I think should be a simple problem turns out to be a tough nut to crack.
Assume that I am connected to my home router, but the internet is down. (WiFi is all I care about, not cell data)

IF I use the trigger WiFi Connected it returns TRUE, since I am connected to the SSID (but not to the internet).
If I use the condition Active Network Type, it also returns TRUE under these conditions.

How can I test whether or not I have an internet connection? There must be a way!

Re: How can I test whether or not I have an internet connect

Posted: 10 Mar 2017 15:55
by Scotty
The most obvious way would seem to be to send an Action / HTTP Request (to a reliable web site). If it fails, you'll get an error message.

Or perhaps download a dedicated app (PingTools, for example) and use automagic to run that?

Re: How can I test whether or not I have an internet connect

Posted: 11 Mar 2017 11:41
by Econdoc
Thanks for the reply. Following up on your reasoning, I tried using the Condition Host Reachable, with ping. I used an IP address for a DNS server (Opendns) as the address. This seems to work!

Thanks for the guidance.

Re: How can I test whether or not I have an internet connect

Posted: 25 Jun 2017 16:03
by akapelis
What trigger do you use please?

Re: How can I test whether or not I have an internet connect

Posted: 25 Jun 2017 18:09
by Econdoc
If I understand your question correctly, the ping is a CONDITION, not a trigger. Please see previous posts.

Re: How can I test whether or not I have an internet connect

Posted: 25 Jun 2017 19:46
by akapelis
I use this but it doesn't work.

Re: How can I test whether or not I have an internet connect

Posted: 26 Jun 2017 08:55
by Bingwu
Ciao Akapelis!

Type: Automatic
Host: www.google.com

does not work with me either!

Type: Socket
Host: www.google.com
Port: 80 (also 443)

or

Type: Ping
Host: www.google.com

is working!

greeting
Peter

Re: How can I test whether or not I have an internet connect

Posted: 26 Jun 2017 13:24
by akapelis
The "socket" option works perfectly, the "ping" option works fine when I'm connected by WiFi, but returns me false (no internet) when connected in 4G.
Thank you Peter.