Skip to content

Feature/lilygo t eth elite#2196

Open
ndrpri wants to merge 3 commits intomeshcore-dev:devfrom
ndrpri:feature/lilygo-t-eth-elite
Open

Feature/lilygo t eth elite#2196
ndrpri wants to merge 3 commits intomeshcore-dev:devfrom
ndrpri:feature/lilygo-t-eth-elite

Conversation

@ndrpri
Copy link
Copy Markdown

@ndrpri ndrpri commented Mar 30, 2026

Overview

This PR adds full MeshCore firmware support for the LilyGo T-ETH-Elite ESP32-S3 board,
paired with the T-ETH-Elite LoRa Shield in both SX1262 and SX1276 radio variants.

Hardware

  • Main board: LilyGo T-ETH-Elite (ESP32-S3-WROOM-1, 16MB Flash, 8MB PSRAM)
  • Ethernet: W5500 via SPI (SPI2_HOST/FSPI)
  • LoRa Shield: T-ETH-Elite LoRa Shield with:
    • SX1262 (433MHz / 868MHz / 915MHz)
    • SX1276 (433MHz / 868MHz / 915MHz)
  • GPS: L76K module on Serial1 (IO39/IO42)
  • Buttons: 5x analog buttons on IO7

Changes

New files

  • boards/t_eth_elite.json — PlatformIO board definition
  • lib/ETHClass2/ — Ethernet driver for W5500 on ESP32-S3
  • src/helpers/esp32/TEthEliteBoard.h — dispatcher header
  • src/helpers/esp32/TEthEliteBoard_SX1262.h — pin definitions for SX1262 variant
  • src/helpers/esp32/TEthEliteBoard_SX1276.h — pin definitions for SX1276 variant
  • src/helpers/esp32/TEthEliteBoard.cpp — board implementation shared by both variants
  • variants/lilygo_t_eth_elite_sx1262/ — SX1262 variant (target.h, target.cpp, platformio.ini)
  • variants/lilygo_t_eth_elite_sx1276/ — SX1276 variant (target.h, target.cpp, platformio.ini)

Modified files

  • examples/companion_radio/main.cpp — added USE_ETHERNET support alongside WIFI_SSID

Available environments

Both variants provide the following firmware types:

  • _repeater — standalone repeater (LoRa only)
  • _repeater_eth — repeater with Ethernet management
  • _repeater_bridge_espnow — repeater with ESPNow bridge
  • _room_server — room server (LoRa only)
  • _room_server_eth — room server with Ethernet management
  • _companion_radio_eth — companion radio via Ethernet TCP
  • _companion_radio_wifi — companion radio via WiFi
  • _companion_radio_ble — companion radio via Bluetooth LE

Key implementation notes

  • ETH (W5500) uses SPI2_HOST (FSPI), radio uses default SPIClass — no bus conflict
  • SX1276 requires a delay(100) after std_init() for RSSI noise floor stabilization
  • GPS Serial1 is explicitly initialized with board-specific pins in TEthEliteBoard::begin()
  • ETH and WiFi/BLE are mutually exclusive per firmware variant
  • Static IP configurable via build flags: ETH_STATIC_IP, ETH_GATEWAY, ETH_SUBNET, ETH_DNS

Tested

  • Ethernet connectivity (static IP)
  • LoRa radio SX1276 TX/RX
  • Companion radio via Ethernet (TCP port 5000)
  • Companion radio via BLE
  • OTA firmware update via

@lnxsamox86 lnxsamox86 mentioned this pull request Mar 30, 2026
@lnxsamox86
Copy link
Copy Markdown

Hello,
thank you for the FW. I just successfully compiled LilyGo_T_ETH_Elite_SX1262_companion_radio_ble.

To make it work I had to remove MomentaryButton user_btn(PIN_USER_BTN_ANA, 1000, true) from target.cpp and hardcode create button with MomentaryButton user_btn(0, 1000, true);

Compiling .pio/build/LilyGo_T_ETH_Elite_SX1262_companion_radio_ble/src/helpers/TxtDataHelpers.cpp.o examples/companion_radio/ui-new/UITask.cpp: In member function 'void UITask::begin(DisplayDriver*, SensorManager*, NodePrefs*)': examples/companion_radio/ui-new/UITask.cpp:558:3: error: 'analog_btn' was not declared in this scope analog_btn.begin(); ^~~~~~~~~~ examples/companion_radio/ui-new/UITask.cpp:558:3: note: suggested alternative: 'analogWrite' analog_btn.begin(); ^~~~~~~~~~ analogWrite examples/companion_radio/ui-new/UITask.cpp: In member function 'virtual void UITask::loop()': examples/companion_radio/ui-new/UITask.cpp:755:22: error: '_analogue_pin_read_millis' was not declared in this scope if (abs(millis() - _analogue_pin_read_millis) > 10) { ^~~~~~~~~~~~~~~~~~~~~~~~~ Compiling .pio/build/LilyGo_T_ETH_Elite_SX1262_companion_radio_ble/src/helpers/bridges/BridgeBase.cpp.o examples/companion_radio/ui-new/UITask.cpp:756:5: error: 'ev' was not declared in this scope ev = analog_btn.check(); ^~ examples/companion_radio/ui-new/UITask.cpp:756:10: error: 'analog_btn' was not declared in this scope ev = analog_btn.check(); ^~~~~~~~~~ examples/companion_radio/ui-new/UITask.cpp:756:10: note: suggested alternative: 'analogWrite' ev = analog_btn.check(); ^~~~~~~~~~ analogWrite Compiling .pio/build/LilyGo_T_ETH_Elite_SX1262_companion_radio_ble/src/helpers/esp32/ESPNOWRadio.cpp.o *** [.pio/build/LilyGo_T_ETH_Elite_SX1262_companion_radio_ble/examples/companion_radio/ui-new/UITask.cpp.o] Error 1

@ndrpri
Copy link
Copy Markdown
Author

ndrpri commented Mar 31, 2026

Hi! Thank you for testing and reporting this.
This is actually a known bug that we already identified and fixed in our branch. The issue is tracked here: #2203
The root cause is that PIN_USER_BTN_ANA is defined in TEthEliteBoard_SX1262.h, which causes UITask.cpp to look for analog_btn and _analogue_pin_read_millis variables that are not declared in the companion radio context.
The correct fix (already applied in our branch) is in UITask.cpp:

Replace abs(millis() - _analogue_pin_read_millis) with (long)(millis() - _analogue_pin_read_millis)
Declare int ev locally inside the PIN_USER_BTN_ANA block
Declare analog_btn as extern MomentaryButton analog_btn in target.h inside #ifdef PIN_USER_BTN_ANA
Add MomentaryButton analog_btn(PIN_USER_BTN_ANA, 1000, true) in target.cpp

Please do not hardcode pin 0 — PIN_USER_BTN_ANA (IO7) is the correct analog button pin for this board.
We will update the PR with these fixes shortly. Thank you!

@ndrpri
Copy link
Copy Markdown
Author

ndrpri commented Mar 31, 2026

Thank you for testing and reporting this!
We have already fixed this issue in commit ndrpri@f6319e86
The fix includes:

analog_btn properly declared in target.cpp and target.h
UITask.cpp fixed for ESP32-S3: abs() ambiguity resolved and ev declared locally in the PIN_USER_BTN_ANA block

Please update your branch and it should compile correctly. No need to hardcode pin 0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants