Still Having Trouble with 8266 Re-Connects

This is really getting annoying.... I'm STILL having trouble getting 8266s to re-connect reliably. I have several 8266s operating in AP+STA mode. One 8266 (AP0) connects to my TP-Link router, two others (AP1 & AP2) connect to AP0. All 8266s ALWAYS connect immediately following a reset or power-up and work perfectly. But, if I reset the AP0 8266, AP1 and AP2 will NOT re-connect, unless I reset them! My initialization code sets both autoConnect and autoReconnect, but they WILL NOT re-connect once AP0 is restarted. But, reset AP1 and/or AP2, and the re-connect instantly (under 1/2 second).

All SSIDs, Passwords, IP addresses, etc. are verified 100% correct, and EVERYTHING works perfectly unless I reset AP0 AFTER AP1 and AP2 have connected to it. WTH is going on here?? This should be simple...

Here is my init code:

void TimerWiFiDeviceAPI::InitializeTimer(char *stassid, char *stapassword, IPAddress staip, IPAddress gatewayip)
{
	boolean success = false;

	// Setup WiFi Client
	ConsolePort->printf("Initializing %s Timer for Network %s...\n", DeviceName, stassid);

        WiFi.begin();
	while (!success)
	{
		// Set Mode
		if (!(success = WiFi.mode(WiFiMode_t::WIFI_STA)))
			continue;

		// Configure STA
		if (!(success = WiFi.config(staip, gatewayip, Netmask, gatewayip)))
			continue;

		if (!(success = WiFi.setAutoConnect(true)))
			continue;

		// Connect STA
		if (!(success = WiFi.begin(stassid, stapassword)))
			continue;

		if (!(success = WiFi.setAutoReconnect(true)))
			continue;
	}
}

Regards,
Ray L.

This is still driving me nuts. It appears to me to be a bug in the ESP8266 libraries. I find that if I reset AP0 for long enough for AP1 and AP2 to change state to WL_DISCONNECTED (which can take up to 5 seconds), then they will re-connect properly as soon as AP0 comes back up. But if I do a quick reset of AP0, then AP1 and AP2 may never even notice AP0 went off-line, and they continue to show WL_CONNECTED, even though the connection no longer works! It seems to be a bit of a zombie connection. I've tried everything I can think of to FORCE a disconnect, but nothing seems to work.

Regards,
Ray L.

To force a disconnect, you can try WiFi.mode( WIFI_OFF ) ;
On ap1 and ap2, you could regularly run your own check to see ap0 is responding if you can’t rely on WL_DISCONNECTED. Say use client.connect() against ap0. If that fails, force a restart by while( 1 ) for the wdt to do it for you, or a more elegant way of your choice.

The problem is the v2.3.0 ESP8266WiFi library is cr@p. I backed up to 2.2.0, and it now works exactly as it should.

Regards,
Ray L.