mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
back to platform 2024.01.01, show dns ipv6 in right format
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
#include "NetworkStatus.h"
|
#include "NetworkStatus.h"
|
||||||
|
|
||||||
#include "../../src/emsesp_stub.hpp"
|
#include "../../src/emsesp_stub.hpp"
|
||||||
|
#ifdef TASMOTA_SDK
|
||||||
|
#include "lwip/dns.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
NetworkStatus::NetworkStatus(AsyncWebServer * server, SecurityManager * securityManager) {
|
NetworkStatus::NetworkStatus(AsyncWebServer * server, SecurityManager * securityManager) {
|
||||||
server->on(NETWORK_STATUS_SERVICE_PATH,
|
server->on(NETWORK_STATUS_SERVICE_PATH,
|
||||||
@@ -32,8 +35,13 @@ void NetworkStatus::networkStatus(AsyncWebServerRequest * request) {
|
|||||||
root["mac_address"] = ETH.macAddress();
|
root["mac_address"] = ETH.macAddress();
|
||||||
root["subnet_mask"] = ETH.subnetMask().toString();
|
root["subnet_mask"] = ETH.subnetMask().toString();
|
||||||
root["gateway_ip"] = ETH.gatewayIP().toString();
|
root["gateway_ip"] = ETH.gatewayIP().toString();
|
||||||
|
#ifdef TASMOTA_SDK
|
||||||
|
IPAddress dnsIP1 = IPAddress(dns_getserver(0));
|
||||||
|
IPAddress dnsIP2 = IPAddress(dns_getserver(1));
|
||||||
|
#else
|
||||||
IPAddress dnsIP1 = ETH.dnsIP(0);
|
IPAddress dnsIP1 = ETH.dnsIP(0);
|
||||||
IPAddress dnsIP2 = ETH.dnsIP(1);
|
IPAddress dnsIP2 = ETH.dnsIP(1);
|
||||||
|
#endif
|
||||||
if (IPUtils::isSet(dnsIP1)) {
|
if (IPUtils::isSet(dnsIP1)) {
|
||||||
root["dns_ip_1"] = dnsIP1.toString();
|
root["dns_ip_1"] = dnsIP1.toString();
|
||||||
}
|
}
|
||||||
@@ -54,8 +62,13 @@ void NetworkStatus::networkStatus(AsyncWebServerRequest * request) {
|
|||||||
root["gateway_ip"] = WiFi.gatewayIP().toString();
|
root["gateway_ip"] = WiFi.gatewayIP().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TASMOTA_SDK
|
||||||
|
IPAddress dnsIP1 = IPAddress(dns_getserver(0));
|
||||||
|
IPAddress dnsIP2 = IPAddress(dns_getserver(1));
|
||||||
|
#else
|
||||||
IPAddress dnsIP1 = WiFi.dnsIP(0);
|
IPAddress dnsIP1 = WiFi.dnsIP(0);
|
||||||
IPAddress dnsIP2 = WiFi.dnsIP(1);
|
IPAddress dnsIP2 = WiFi.dnsIP(1);
|
||||||
|
#endif
|
||||||
if (dnsIP1 != INADDR_NONE) {
|
if (dnsIP1 != INADDR_NONE) {
|
||||||
root["dns_ip_1"] = dnsIP1.toString();
|
root["dns_ip_1"] = dnsIP1.toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ extra_scripts =
|
|||||||
[espressi32_base_tasmota]
|
[espressi32_base_tasmota]
|
||||||
; use Tasmota's library which removes some unused libs (like mbedtsl, so no WiFi_secure.h) and increases available heap
|
; use Tasmota's library which removes some unused libs (like mbedtsl, so no WiFi_secure.h) and increases available heap
|
||||||
; Tasmota Arduino Core 2.0.14 with IPv6 support, based on IDF 4.4.6
|
; Tasmota Arduino Core 2.0.14 with IPv6 support, based on IDF 4.4.6
|
||||||
platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.01.00/platform-espressif32.zip
|
platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.01.01/platform-espressif32.zip
|
||||||
; Tasmota Arduino Core 3.0.0-alpha based on IDF v5.1.2
|
; Tasmota Arduino Core 3.0.0-alpha based on IDF v5.1.2
|
||||||
; platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.02.10/platform-espressif32.zip
|
; platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.02.10/platform-espressif32.zip
|
||||||
framework = arduino
|
framework = arduino
|
||||||
|
|||||||
Reference in New Issue
Block a user