enable IPv6 for tasmota, add env:ci_16M for E32V2

This commit is contained in:
MichaelDvP
2024-02-29 10:04:10 +01:00
parent 2ddd2401eb
commit 463c68d08c
8 changed files with 79 additions and 55 deletions

View File

@@ -70,6 +70,9 @@ void NetworkSettingsService::manageSTA() {
// Connect or reconnect as required
if ((WiFi.getMode() & WIFI_STA) == 0) {
#ifdef TASMOTA_SDK
WiFi.enableIPv6(_state.enableIPv6);
#endif
if (_state.staticIPConfig) {
WiFi.config(_state.localIP, _state.gatewayIP, _state.subnetMask, _state.dnsIP1, _state.dnsIP2); // configure for static IP
}
@@ -388,13 +391,15 @@ void NetworkSettings::read(NetworkSettings & settings, JsonObject root) {
root["password"] = settings.password;
root["hostname"] = settings.hostname;
root["static_ip_config"] = settings.staticIPConfig;
root["enableIPv6"] = settings.enableIPv6;
root["bandwidth20"] = settings.bandwidth20;
root["nosleep"] = settings.nosleep;
root["enableMDNS"] = settings.enableMDNS;
root["enableCORS"] = settings.enableCORS;
root["CORSOrigin"] = settings.CORSOrigin;
root["tx_power"] = settings.tx_power;
#ifndef TASMOTA_SDK
root["enableIPv6"] = settings.enableIPv6;
#endif
// extended settings
JsonUtils::writeIP(root, "local_ip", settings.localIP);
@@ -416,14 +421,17 @@ StateUpdateResult NetworkSettings::update(JsonObject root, NetworkSettings & set
settings.password = root["password"] | FACTORY_WIFI_PASSWORD;
settings.hostname = root["hostname"] | FACTORY_WIFI_HOSTNAME;
settings.staticIPConfig = root["static_ip_config"] | false;
settings.enableIPv6 = root["enableIPv6"] | false;
settings.bandwidth20 = root["bandwidth20"] | false;
settings.tx_power = static_cast<uint8_t>(root["tx_power"] | 0);
settings.nosleep = root["nosleep"] | false;
settings.enableMDNS = root["enableMDNS"] | true;
settings.enableCORS = root["enableCORS"] | false;
settings.CORSOrigin = root["CORSOrigin"] | "*";
#ifdef TASMOTA_SDK
settings.enableIPv6 = true;
#else
settings.enableIPv6 = root["enableIPv6"] | false;
#endif
// extended settings
JsonUtils::readIP(root, "local_ip", settings.localIP);
JsonUtils::readIP(root, "gateway_ip", settings.gatewayIP);