mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-04-27 12:39:40 +00:00
Fixed redirect issue after initial setup with DHCP on ESP8266
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
if(sysinfo.net.ip && tries%3 == 0) {
|
if(sysinfo.net.ip && tries%3 == 0) {
|
||||||
if(sysinfo.net.ip == '0.0.0.0') {
|
if(!sysinfo.net.ip) {
|
||||||
retry();
|
retry();
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -137,7 +137,7 @@
|
|||||||
Gateway: {sysinfo.net.gw}
|
Gateway: {sysinfo.net.gw}
|
||||||
</div>
|
</div>
|
||||||
<div class="my-2">
|
<div class="my-2">
|
||||||
DNS: {sysinfo.net.dns1} {#if sysinfo.net.dns2 && sysinfo.net.dns2 != '0.0.0.0'}/ {sysinfo.net.dns2}{/if}
|
DNS: {sysinfo.net.dns1} {#if sysinfo.net.dns2}/ {sysinfo.net.dns2}{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -217,6 +217,9 @@ void AmsWebServer::sysinfoJson() {
|
|||||||
hostname = "ams-"+chipIdStr;
|
hostname = "ams-"+chipIdStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IPAddress localIp = WiFi.localIP();
|
||||||
|
IPAddress subnet = WiFi.subnetMask();
|
||||||
|
IPAddress gateway = WiFi.gatewayIP();
|
||||||
IPAddress dns1 = WiFi.dnsIP(0);
|
IPAddress dns1 = WiFi.dnsIP(0);
|
||||||
IPAddress dns2 = WiFi.dnsIP(1);
|
IPAddress dns2 = WiFi.dnsIP(1);
|
||||||
|
|
||||||
@@ -271,15 +274,18 @@ void AmsWebServer::sysinfoJson() {
|
|||||||
hostname.c_str(),
|
hostname.c_str(),
|
||||||
performRestart ? "true" : "false",
|
performRestart ? "true" : "false",
|
||||||
rebootForUpgrade ? "true" : "false",
|
rebootForUpgrade ? "true" : "false",
|
||||||
WiFi.localIP().toString().c_str(),
|
|
||||||
WiFi.subnetMask().toString().c_str(),
|
|
||||||
WiFi.gatewayIP().toString().c_str(),
|
|
||||||
#if defined(ESP8266)
|
#if defined(ESP8266)
|
||||||
|
localIp.isSet() ? localIp.toString().c_str() : "",
|
||||||
|
subnet.isSet() ? subnet.toString().c_str() : "",
|
||||||
|
gateway.isSet() ? gateway.toString().c_str() : "",
|
||||||
dns1.isSet() ? dns1.toString().c_str() : "",
|
dns1.isSet() ? dns1.toString().c_str() : "",
|
||||||
dns2.isSet() ? dns2.toString().c_str() : "",
|
dns2.isSet() ? dns2.toString().c_str() : "",
|
||||||
#else
|
#else
|
||||||
dns1.toString().c_str(),
|
localIp != INADDR_NONE ? localIp.toString().c_str() : "",
|
||||||
dns2.toString().c_str(),
|
subnet != INADDR_NONE ? subnet.toString().c_str() : "",
|
||||||
|
gateway != INADDR_NONE ? gateway.toString().c_str() : "",
|
||||||
|
dns1 != INADDR_NONE ? dns1.toString().c_str() : "",
|
||||||
|
dns2 != INADDR_NONE ? dns2.toString().c_str() : "",
|
||||||
#endif
|
#endif
|
||||||
meterState->getMeterType(),
|
meterState->getMeterType(),
|
||||||
meterModel.c_str(),
|
meterModel.c_str(),
|
||||||
|
|||||||
Reference in New Issue
Block a user