-
Notifications
You must be signed in to change notification settings - Fork 2k
API reference
This is the detailed documentation of every class and function of the WiFiManager library. Some parts have been simplified to be easier to understand, so if you look at the source code, you might see some differences.
Call this function to start a connection automatically. If a saved SSID and password is not found, it will enter AP mode. The name of the SSID will be "ESP" + ID chip;
boolean autoConnect()
none
Boolean, true if connected
Call this function to start a connection automatically. If a saved SSID and password is not found, it will enter AP mode. The name of the SSID is specified by apName
boolean autoConnect(char const *apName)
apName
Desired SSID name.
Note: in the staging version of ArduinoESP8266, custom names do not work and always give IA_THINKER or random SSID
Boolean, true if connected
You can and should password protect the configuration access point. Simply add the password as a second parameter to autoConnect. A short password seems to have unpredictable results so use one that's around 8 characters or more in length. If a saved value is not found, enter in AP mode. The name of the SSID will be "ESP" + ID chip;
boolean autoConnect(char const *apName, char const *apPasswd)
apName
Desired SSID name.
apPasswd
pre-entered password
Note: in the staging version of ArduinoESP8266, custom names do not work and always give IA_THINKER or random SSID
Boolean, true if connected
Resets the saved SSID and password settings. You'll only need to call this after lib has been started with autoConnect() or begin()
void resetSettings()
none
none
Sets a custom ip / gateway / subnet configuration
setAPConfig(IPAddress ip, IPAddress gw, IPAddress sn);
ip
: IP address
gw
: Gateway Address
sn
: Subnet mask
use IPAddress() function to create a valid ip chain.
IPAddress ip(192,168,1,5);
IPAddress gw(192,168,1,1);
IPAddress sn(255,255,255,0);
setAPConfig(ip, gw, sn);
none
Set function callback when entering into AP mode
void setAPCallback( void (*func)(void) )
pointer to function callback
It indicates whether it was possible to connect to a network
boolean hasConnected()
none
Returns true if the connection was successful
Sets a timeout before the webserver loop ends and exits even if there has been no setup. Useful for devices that failed to connect at some point and got stuck in a webserver loop.
void setTimeout(unsigned long seconds)
seconds
time in seconds
none
Activate the serial output for debugging. Debug is enabled by default on Serial. To disable, call this before autoConnect
void setDebugOutput(boolean debug)
debug
true if you want send to serial debug
none
Decode values from URL
String urldecode(const char* scr)
scr
pointer to array of char, to decode values from URL
String object