feat: Add Ethernet runtime configuration CLI

- Add ip/gw/subnet/dns get/set commands with SPIFFS persistence
- Implement reconfigureEthernet() method for runtime config
- Fix TCP_CONSOLE_PORT conditional compilation
- Update platformio.ini for consistency (USE_ETHERNET)
- Document Ethernet settings and get bridge.type command
- Fixes #2196 #2197 hardware and console dependencies
This commit is contained in:
Piero Andreini 2026-04-05 12:07:11 +02:00
parent ea72dd0f97
commit 4542e6c86a
12 changed files with 295 additions and 16 deletions

View file

@ -3,7 +3,7 @@
#include "MyMesh.h"
#if defined(ESP32) && defined(TCP_CONSOLE_PORT)
#if defined(TCP_CONSOLE_PORT)
#include <helpers/esp32/TCPConsole.h>
TCPConsole tcp_console(nullptr); // prefs set in setup()
#endif
@ -81,7 +81,16 @@ void setup() {
the_mesh.begin(fs);
#ifdef USE_ETHERNET
NodePrefs* prefs = the_mesh.getNodePrefs();
if (prefs->eth_ip != 0) {
board.reconfigureEthernet(prefs->eth_ip, prefs->eth_gateway, prefs->eth_subnet);
}
#endif
#if defined(TCP_CONSOLE_PORT)
tcp_console.setPrefs(the_mesh.getNodePrefs());
#endif
#ifdef DISPLAY_CLASS
ui_task.begin(the_mesh.getNodePrefs(), FIRMWARE_BUILD_DATE, FIRMWARE_VERSION);