Add OTA support via Ethernet for T-ETH-Elite

This commit is contained in:
Piero Andreini 2026-03-30 14:53:20 +02:00
parent add48e5cbe
commit b2be547c33
2 changed files with 21 additions and 7 deletions

View file

@ -14,6 +14,7 @@ extern MomentaryButton user_btn;
uint32_t deviceOnline = 0x00;
static SPIClass spi_eth(FSPI);
static ETHClass2 ETH;
String eth_local_ip; // global, accessible from ESP32Board.cpp via extern
void TEthEliteBoard::begin() {
ESP32Board::begin();
@ -152,6 +153,8 @@ void TEthEliteBoard::startEthernet() {
ETH.config(IPAddress(192, 168, 4, 2), IPAddress(192, 168, 4, 1), IPAddress(255, 255, 255, 0));
}
eth_local_ip = ETH.localIP().toString(); // save IP for OTA use
uint8_t mac[6];
ETH.macAddress(mac);
Serial.printf("ETH MAC %02X:%02X:%02X:%02X:%02X:%02X\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);