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