Retry saved WebConfig WiFi when the MQTT worker is absent
This commit is contained in:
1 parent
b81da36a00
commit
526a3d1aa4
8 files changed
+479
-31
No files matched your search
@@ -10935,17 +10935,23 @@ bool MyMesh::startWebConfig(bool force_ap, char* reply) {
|
||||
bool owns_wifi = true;
|
||||
#ifdef WITH_MQTT_BRIDGE
|
||||
mqtt_prefs = _cli.getObserverPrefs();
|
||||
owns_wifi = false;
|
||||
owns_wifi = !mqtt_bridge
|
||||
|| (!mqtt_bridge->isRunning() && !mqtt_bridge->isStopping());
|
||||
#endif
|
||||
_webconfig = new WebConfigServer(this, mqtt_prefs, owns_wifi,
|
||||
self_id.pub_key, getFirmwareVer(), getBuildDate(), getRole(),
|
||||
_cli.getBoard()->getManufacturerName());
|
||||
_cli.getBoard()->getManufacturerName(), true);
|
||||
if (!_webconfig) {
|
||||
strcpy(reply, "Err: not enough memory for webconfig");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WITH_MQTT_BRIDGE
|
||||
_webconfig->updateWiFiOwnership(!mqtt_bridge
|
||||
|| (!mqtt_bridge->isRunning() && !mqtt_bridge->isStopping()));
|
||||
#endif
|
||||
|
||||
if (force_ap) {
|
||||
#ifdef WITH_MQTT_BRIDGE
|
||||
if (mqtt_bridge && mqtt_bridge->isRunning()) {
|
||||
@@ -12945,6 +12951,10 @@ void __attribute__((noinline)) MyMesh::servicePostMeshLoop() {
|
||||
mesh::usbConsolePort().printf("%s\r\n", wc_reply);
|
||||
}
|
||||
if (_webconfig) {
|
||||
#ifdef WITH_MQTT_BRIDGE
|
||||
_webconfig->updateWiFiOwnership(!mqtt_bridge
|
||||
|| (!mqtt_bridge->isRunning() && !mqtt_bridge->isStopping()));
|
||||
#endif
|
||||
_webconfig->tick(millis());
|
||||
if (!_webconfig->isRunning() && !_webconfig->isStopping()) {
|
||||
delete _webconfig;
|
||||
|
||||
Reference in new issue
Block a user