Hello to all,
Does anyone know of a simple way in Annex32 to get the ESP32 to confirm internet connectivity. (An ESP32 that is connected to a home wifi network). In other words, confirming that the utilised home network is indeed still connected to Internet.
I am thinking … something equivalent to achieving a successful PING of a known reliable major worldwide website. I seek a solution and one that could if necessary be repeated as often as every minute, over a 24 hr period. I am sure that in my blind ignorance I am missing a very simple and obvious method!
Anyone faced this issue before and can offer a solution?
Thank you advance for sharing any thoughts
Best wishes to all
A simple way to check Internet connectivity?
- Fernando Perez
- Posts: 378
- Joined: Mon Feb 15, 2021 10:09 pm
- Location: Santander (Spain)
- Has thanked: 195 times
- Been thanked: 267 times
Re: A simple way to check Internet connectivity?
I would use this:
You do not have the required permissions to view the files attached to this post.
-
- Posts: 351
- Joined: Tue Jun 21, 2022 2:17 pm
- Location: South coast UK
- Has thanked: 187 times
- Been thanked: 113 times
Re: A simple way to check Internet connectivity?
The Annex command WIFI.STATUS will return 3 if it is connected.
Check the help documentation for the meaning of other returned values.
EDIT: Sorry, just re-read your post and you wanted to know if you had internet. Therefore, what Fernando Perez said.
Check the help documentation for the meaning of other returned values.
EDIT: Sorry, just re-read your post and you wanted to know if you had internet. Therefore, what Fernando Perez said.
- Fernando Perez
- Posts: 378
- Joined: Mon Feb 15, 2021 10:09 pm
- Location: Santander (Spain)
- Has thanked: 195 times
- Been thanked: 267 times
Re: A simple way to check Internet connectivity?
It seems to me that wifi.status only reports whether our module is connected to our network via Wi-Fi, but not whether there is a real connection to the Internet.
Code: [Local Link Removed for Guests]
r = ping("8.8.8.8")
if r=1 then
wlog "Connected to the internet"
else
wlog "Internet connection failure"
end if
Last edited by Fernando Perez on Wed Nov 01, 2023 2:03 pm, edited 1 time in total.
Re: A simple way to check Internet connectivity?
Fernado
How did I miss that a PING function exists?!!!? I scanned through the Help and never saw that. I did SEARCH for PING at the Help and no results are found from the SEARCH. But now i see it. Thanks!
BeanieBots
I have used WIFI status before and had always assumed that result 3 just meant that device is connected to the network, not that network itself is also connected to Internet.
How did I miss that a PING function exists?!!!? I scanned through the Help and never saw that. I did SEARCH for PING at the Help and no results are found from the SEARCH. But now i see it. Thanks!
BeanieBots
I have used WIFI status before and had always assumed that result 3 just meant that device is connected to the network, not that network itself is also connected to Internet.
Re: A simple way to check Internet connectivity?
Fernando
Thank you for the code suggestion.
All the best.
Thank you for the code suggestion.
All the best.