Skip to content

With this library an ESP8266 can automatically connect to an open wifi network which has a working internet connection. This library should not be considered save since it is a bad thing to have your iot autoconnect to everything it can get a hold of. However I developed it for a personal use case where exactly that was required. So here we go :)

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

Webklex/ESP8266AutoConnect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP8266AutoConnect

Software License

Let the ESP8266 auto connect to an open wifi network.

With this library an ESP8266 can automatically connect to an open wifi network which has a working internet connection. This library should not be considered save since it is a bad thing to have your iot autoconnect to everything it can get a hold of. However I developed it for a personal use case where exactly that was required. So here we go :)

Usage

First, include the library in your sketch and initialize a new instance:

#include <ESP8266AutoConnect.h>

int LED_DISCONNECTED = 15; //D8
int LED_CONNECTING = 13;   //D7
int LED_CONNECTED = 12;    //D6
#int LED_CONNECTED = 0;    //No indicator led for an online connection

ESP8266AutoConnect ac(LED_DISCONNECTED, LED_CONNECTING, LED_CONNECTED);

If you don't want to use any indicator led just ignore them:

#include <ESP8266AutoConnect.h>

ESP8266AutoConnect ac;

Next, simply call the ac.autoConnect() function. It won't continue until it has established a connection.

void loop() {
    ac.autoConnect();
    delay(1000);
}

All available methods:

void ac.autoConnect();

bool ac.ping(String host, int port);

void ac.setDisconnectLed(int); //Default = 0 (unset)
void ac.setConnectingLed(int); //Default = 0 (unset)
void ac.setConnectedLed(int);  //Default = 0 (unset)
void ac.setBlinkDelay(int);    //Default = 250
void ac.setPingHost(String);   //Default = "www.google.com"
void ac.setPingPort(int);      //Default = 443

Change log

Please see CHANGELOG for more information what has changed recently.

Security

If you discover any security related issues, please email github@webklex.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

With this library an ESP8266 can automatically connect to an open wifi network which has a working internet connection. This library should not be considered save since it is a bad thing to have your iot autoconnect to everything it can get a hold of. However I developed it for a personal use case where exactly that was required. So here we go :)

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Packages

No packages published

Languages