API Reference / PersWiFiManager::onConnect

Attach a handler function that runs every time WiFi connects

Signatures

Args

Notes

This will run the handler function every time the WiFi settings are changed and then a successful connection is made.

For unsuccessful / AP mode connection handler, see onAp

Example Code

void setup(){
	...

	//uses a lambda function as the argument
	persWM.onConnect([]() {
		//this code runs every time wifi is connected
		DEBUG_PRINT("wifi connected");
		DEBUG_PRINT(WiFi.localIP());
		EasySSDP::begin(server);
	});