re-connect instantly (typically 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. The only other code that even touches the 8266s is simply sending and receiving UDP packets, so the problem HAS to be here.
boolean TimerWiFiDeviceAPI::InitializeAP(TimerModes mode,
char *apssid, char *appassword, IPAddress apip, IPAddress gatewayip, uint8_t apchannel,
char *stassid, char *stapassword, IPAddress staip,
uint16_t port)
{
#if (TARGET == TARGET_CONTROL_PANEL) || (TARGET == TARGET_TIMER_DEVICE_ONLY) || (TARGET == TARGET_TIMER_ALL_IN_ONE)
boolean success = false;
ConsolePort->printf("Initializing %s AP for Network %s on Channel %d...\n", DeviceName, TimerAPSSID, TimerAPChannel);
WiFi.begin();
while (!success)
{
// Set Mode
if (!(success = WiFi.mode(WiFiMode_t::WIFI_AP_STA)))
continue;
// Configure STA
if (!(success = WiFi.config(staip, gatewayip, Netmask, gatewayip)))
continue;
// Configure AP
if (!(success = WiFi.softAPConfig(apip, GatewayIP, Netmask)))
continue;
// Start/Connect AP + STA
if (!(success = WiFi.setAutoConnect(true)))
continue;
if (!(success = WiFi.begin(stassid, stapassword)))
continue;
if (!(success = WiFi.setAutoReconnect(true)))
continue;
if (!(success = WiFi.softAP(apssid, appassword, apchannel)))
continue;
}
#endif
}
Regards,
Ray L.