Pages: [1]   Go Down
Author Topic: Check for Ethernet/Internet connection & re-establish if lost?  (Read 820 times)
0 Members and 1 Guest are viewing this topic.
UK
Offline Offline
Sr. Member
****
Karma: 1
Posts: 278
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Wonder what would be the best/most reliable way to check an Ethernet/Internet connection during the loop so that it can be restablished if it has failed?  For example, if Arduino has remained powered but the router has been reset the network connection is lost so needs to be renewed - This would be using the Arduino WizNet shield and Library.

Thanks for any piinters.
Logged

Rome, Italy
Offline Offline
Sr. Member
****
Karma: 20
Posts: 442
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can look (in this forum as well) for implementations of ICMP ping. Then you can periodically ping your router and try to reconnect if you get no answer. Ethernet.maintain() seems a good choice. A GET request to a web server can also do the job, but it takes longer and is a less reliable indicator of a local network problem.
Logged

Pages: [1]   Go Up
Jump to: