How can I configure the portal for a given scenario? #376
-
Hello! I'm here after a long time with dozens of trials and errors.
Currently, I'm using this configurations: this->_portalConfig->autoReset = false;
this->_portalConfig->retainPortal = false;
this->_portalConfig->autoReconnect = true;
this->_portalConfig->reconnectInterval = 1;
this->_portalConfig->immediateStart = false;
this->_portalConfig->beginTimeout = 10000; But I had an unexpected behavior (for me): When the network is down, the ESP shows the portal again. For those who need to reset the configurations manually, follow the code: void DMCNWiFi::resetSettings() {
Serial.print(F("[WIFI] Resetting Settings..."));
WiFi.mode(WIFI_STA);
#ifdef ESP32
WiFi.disconnect(true, true);
#else
WiFi.persistent(true);
WiFi.disconnect(true);
WiFi.persistent(false);
#endif
AutoConnectCredential credential;
station_config_t config;
uint8_t entriesQuantity = credential.entries();
while (entriesQuantity--) {
credential.load((int8_t) 0, &config);
credential.del((const char *) &config.ssid[0]);
}
this->_portalConfig->immediateStart = true;
autoConnect();
this->_portalConfig->immediateStart = false;
Serial.println(F("done"));
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I can't say for sure because I can't see the substance of this->_portalConfig->immediateStart = true;
autoConnect(); // -> Does it include AutoConnect::config(_portalConfig)?
this->_portalConfig->immediateStart = false; Also, Would you please show me the implementation of the part related to AutoConnect of DMCNWiFi class? I will try to configure it to the behavior you expect.
Similar requirements are raised on another topic. I didn't expect this, but there seems to be a use case of "enable only the most recently connected access points". |
Beta Was this translation helpful? Give feedback.
I can't say for sure because I can't see the substance of
autoConnect()
you showed, but maybe you have the steps to register a_portalConfig
instance with AutoConnect::config that should follow thethis->_portalConfig->immediateStart = false;
setting. It may be leaking. how is it?Also, Would you please show me the implementation of the part related to AutoConnect of DMCNWiFi class? I will try to configure it to the behavior you expect.
Similar requirements are raised on anoth…