ESPConn is a simple library to check the connection to and automatically reconnect to your WiFi. Include in your Arduino IDE project.
You need to have ESP8266WiFi library installed. You'll also need the ESP8266 Ping library made by jeroenst installed. I provided a copy of the code in the /src/ folder.
Copy the contents of the /src/ folder directly to the folder of your Arduino IDE project.
Then, you have to include the ESPConn library:
#include "ESPConn.h"
Second, you have to initialize the IP you want to ping. I recommend using your router or any server like Google:
IPAddress ip (192, 168, 0, 1);
Using the library is easy, to check the connection, use:
checkConnection(ip, "YOUR_SSID", "YOUR_PASS");
And replace "YOUR_SSID" and "YOUR_PASS" with your WiFi credentials. In case of no connection, it automatically reconnects to the WiFi.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.