Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MBlackmagic/WiFiConnector

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

latest
PIO
Website
Support Author
README ENGLISH
Subscribe

WiFiConnector

Asynchronous WiFi connection with automatic fallback to Access Point (AP) mode if a connection times out.

Compatibility

Supports ESP8266 and ESP32


Table of Contents


Usage

Use this library when your WiFi credentials are stored externally or are not known in advance.
If the SSID is passed as an empty string, the device will launch in AP mode.
If a connection fails, AP mode will be launched automatically for web-based configuration or user interaction.

Class Overview

// AP name, AP password, timeout in seconds, disable AP after STA connection
WiFiConnectorClass(const String& APname = "ESP AP",
                    const String& APpass = "",
                    uint16_t timeout = 60 * 3,
                    bool closeAP = true);

void setName(const String& name);              // Set AP name
void setPass(const String& pass);              // Set AP password
void setTimeout(uint16_t timeout);             // Set connection timeout
void setAPIdleTimeout(60000);                  // 60 second AP-Idle-Timeout
void closeAP(bool close);                      // Enable/disable AP shutdown after STA connect
void onConnect(ConnectorCallback cb);          // Set successful connect callback
void onError(ConnectorCallback cb);            // Set error callback after AP starts
bool connect(const String& ssid, const String& pass = ""); // Start connection
bool tick();                                   // Call in loop()
bool connected();                              // Returns true if STA connected
bool connecting();                             // Returns true if still connecting

About

Asynchronous WiFi connection with creation of access point when connection timeout

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%