mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-28 05:36:37 +00:00
add esp32 ethernet details to info page
This commit is contained in:
parent
c9f7609eed
commit
ec84e97b5c
@ -19,10 +19,11 @@ void EthernetEvent(WiFiEvent_t event)
|
|||||||
case SYSTEM_EVENT_ETH_START:
|
case SYSTEM_EVENT_ETH_START:
|
||||||
Log.notice(TAG_ETH, F("Started"));
|
Log.notice(TAG_ETH, F("Started"));
|
||||||
// set eth hostname here
|
// set eth hostname here
|
||||||
ETH.setHostname("esp32-ethernet");
|
ETH.setHostname(mqttGetNodename().c_str());
|
||||||
break;
|
break;
|
||||||
case SYSTEM_EVENT_ETH_CONNECTED:
|
case SYSTEM_EVENT_ETH_CONNECTED:
|
||||||
Log.notice(TAG_ETH, F("Connected"));
|
Log.notice(TAG_ETH, F("Connected"));
|
||||||
|
eth_connected = true;
|
||||||
break;
|
break;
|
||||||
case SYSTEM_EVENT_ETH_GOT_IP:
|
case SYSTEM_EVENT_ETH_GOT_IP:
|
||||||
Log.notice(TAG_ETH, F("MAC Address %s"), ETH.macAddress().c_str());
|
Log.notice(TAG_ETH, F("MAC Address %s"), ETH.macAddress().c_str());
|
||||||
@ -60,7 +61,7 @@ void ethernetLoop(void)
|
|||||||
|
|
||||||
bool ethernetEvery5Seconds()
|
bool ethernetEvery5Seconds()
|
||||||
{
|
{
|
||||||
Log.warning(TAG_ETH, eth_connected ? F("ONLINE") : F("OFFLINE"));
|
// Log.warning(TAG_ETH, eth_connected ? F("ONLINE") : F("OFFLINE"));
|
||||||
return eth_connected;
|
return eth_connected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -504,7 +504,24 @@ void webHandleInfo()
|
|||||||
httpMessage += String(WiFi.macAddress());
|
httpMessage += String(WiFi.macAddress());
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#if HASP_USE_ETHERNET > 0
|
||||||
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
|
httpMessage += F("</p/><p><b>Ethernet: </b>");
|
||||||
|
httpMessage += String(ETH.linkSpeed());
|
||||||
|
httpMessage += F(" Mbps");
|
||||||
|
if(ETH.fullDuplex()) {
|
||||||
|
httpMessage += F(" FULL_DUPLEX");
|
||||||
|
}
|
||||||
|
httpMessage += F("</br><b>IP Address: </b>");
|
||||||
|
httpMessage += String(ETH.localIP().toString());
|
||||||
|
httpMessage += F("</br><b>Gateway: </b>");
|
||||||
|
httpMessage += String(ETH.gatewayIP().toString());
|
||||||
|
httpMessage += F("</br><b>DNS Server: </b>");
|
||||||
|
httpMessage += String(ETH.dnsIP().toString());
|
||||||
|
httpMessage += F("</br><b>MAC Address: </b>");
|
||||||
|
httpMessage += String(ETH.macAddress());
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
/* Mqtt Stats */
|
/* Mqtt Stats */
|
||||||
#if HASP_USE_MQTT > 0
|
#if HASP_USE_MQTT > 0
|
||||||
httpMessage += F("</p/><p><b>MQTT Status: </b>");
|
httpMessage += F("</p/><p><b>MQTT Status: </b>");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user