Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WiFi] Workaround Arduino ESP8266 issue, correct TaskExit event generation #4468

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/src/ESPEasyCore/ESPEasyWifi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1449,12 +1449,12 @@ void setupStaticIPconfig() {
setUseStaticIP(WiFiUseStaticIP());

if (!WiFiUseStaticIP()) { return; }
const IPAddress ip = Settings.IP;
const IPAddress gw = Settings.Gateway;
const IPAddress subnet = Settings.Subnet;
const IPAddress dns = Settings.DNS;
const IPAddress ip (Settings.IP);
const IPAddress gw (Settings.Gateway);
const IPAddress subnet (Settings.Subnet);
const IPAddress dns (Settings.DNS);

WiFiEventData.dns0_cache = Settings.DNS;
WiFiEventData.dns0_cache = dns;

WiFi.config(ip, gw, subnet, dns);

Expand Down
4 changes: 2 additions & 2 deletions src/src/WebServer/AccessControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ bool getIPallowedRange(IPAddress& low, IPAddress& high)
}
return getSubnetRange(low, high);
case ONLY_IP_RANGE_ALLOWED:
low = SecuritySettings.AllowedIPrangeLow;
high = SecuritySettings.AllowedIPrangeHigh;
low = IPAddress(SecuritySettings.AllowedIPrangeLow);
high = IPAddress(SecuritySettings.AllowedIPrangeHigh);
break;
default:
low = IPAddress(0, 0, 0, 0);
Expand Down
7 changes: 5 additions & 2 deletions src/src/WebServer/DevicesPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,10 @@ void handle_devices_CopySubmittedSettings(taskIndex_t taskIndex, pluginID_t task
}
ExtraTaskSettings.clearUnusedValueNames(valueCount);

// ExtraTaskSettings has changed.
// The content of it is needed for sending CPLUGIN_TASK_CHANGE_NOTIFICATION and TaskInit/TaskExit events
Cache.updateExtraTaskSettingsCache();

// allow the plugin to save plugin-specific form settings.
{
String dummy;
Expand All @@ -406,8 +410,7 @@ void handle_devices_CopySubmittedSettings(taskIndex_t taskIndex, pluginID_t task
}
}

// ExtraTaskSetting has changed.
// The content of it is needed for sending CPLUGIN_TASK_CHANGE_NOTIFICATION
// ExtraTaskSettings may have changed during PLUGIN_WEBFORM_SAVE, so again update the cache.
Cache.updateExtraTaskSettingsCache();

// notify controllers: CPlugin::Function::CPLUGIN_TASK_CHANGE_NOTIFICATION
Expand Down