Skip to content
Jeremy Abel edited this page Dec 23, 2015 · 13 revisions

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.

boolean WiFiManager::autoConnect()

Description

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;

Signatures

boolean autoConnect()

Arguments

none

Return value

Boolean, true if connected


boolean WiFiManager::autoConnect(char const *apName);

Description

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

Signatures

boolean autoConnect(char const *apName)

Arguments

apName Desired SSID name. Note: in the staging version of ArduinoESP8266, custom names do not work and always give IA_THINKER or random SSID

Return value

Boolean, true if connected


boolean WiFiManager::autoConnect(char const *apName, char const *apPasswd);

Description

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;

Signatures

boolean autoConnect(char const *apName, char const *apPasswd)

Arguments

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

Return value

Boolean, true if connected

void WiFiManager::resetSettings()

Description

Resets the saved SSID and password settings. You'll only need to call this after lib has been started with autoConnect() or begin()

Signatures

void resetSettings()

Arguments

none

Return value

none


void WiFiManager::setAPConfig(IPAddress ip, IPAddress gw, IPAddress sn);

Description

Sets a custom ip / gateway / subnet configuration

Signatures

setAPConfig(IPAddress ip, IPAddress gw, IPAddress sn);

Arguments

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);
Return value

none


void WiFiManager::setAPCallback( void (*func)(void) )

Description

Set function callback when entering into AP mode

Signatures

void setAPCallback( void (*func)(void) )

Arguments

pointer to function callback


boolean WiFiManager::hasConnected()

Description

It indicates whether it was possible to connect to a network

Signatures

boolean hasConnected()

Arguments

none

Return value

Returns true if the connection was successful


void WiFiManager::setTimeout(unsigned long seconds);

Description

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.

Signatures

void setTimeout(unsigned long seconds)

Arguments

seconds time in seconds

Return value

none


void WiFiManager::setDebugOutput(boolean debug)

Description

Activate the serial output for debugging. Debug is enabled by default on Serial. To disable, call this before autoConnect

Signatures

void setDebugOutput(boolean debug)

Arguments

debug true if you want send to serial debug

Return value

none


String WiFiManager::urldecode(const char*)

Description

Decode values from URL

Signatures

String urldecode(const char* scr)

Arguments

scr pointer to array of char, to decode values from URL

Return value

String object