Skip to content

Commit 350d042

Browse files
authored
feat(boards): add the LilyGO T-Connect Pro Lite (#51)
From discussion #30, where @davidcoulson posted a working config and asked for it in the board list. ESP32-S3, 8MB flash, 8MB octal PSRAM, on-board W5500 Ethernet, RS485 on GPIO17/18 — so it gets the full profile: web UI, on-flash history, and no WiFi. Stripped of the contributor's site-specific parts (their packages, string labels, inverter names, and the four-LED status lambdas) and split the usual way: a board file to !include, and a ready-to-flash example beside it. The LED, button, relay, CAN and RS232 pins are documented in the board file without instantiating anything, so nothing is claimed that isn't wired. Bluetooth is compiled out — dead weight on a wired board, and it buys back a large slice of flash. That costs CCA-over-BLE, which the board data and README both say plainly; HTTP CCA import is unaffected. Teaching the config builder about it needed a wired path: a board that declares an `ethernet` PHY now emits an `ethernet:` block and omits `wifi:`/`captive_portal:` entirely, keeps WiFi credentials out of the generated secrets.yaml, and hides the WiFi fields in the form. Running both stacks would only split the lwIP socket budget. The pin map is the contributor's — no unit here to check it against. What is verified: the example compiles clean (flash 55.6%, RAM 21.8%), the generated config validates, and the builder's board data is covered by the existing drift test against the board file.
1 parent e310790 commit 350d042

11 files changed

Lines changed: 463 additions & 21 deletions

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
- **LilyGO T-Connect Pro Lite is a supported board.** ESP32-S3 with 8MB PSRAM, 8MB flash and wired Ethernet (W5500) — the full profile, web UI and on-flash history included, on a wired network. `boards/esp32s3-lilygo-t-connect-pro-lite.yaml` plus a ready-to-flash `boards/example-t-connect-pro-lite.yaml`. Contributed by @davidcoulson from a working install ([discussion #30](https://github.com/RAR/esphome-tigomonitor/discussions/30)); the pin map is theirs, and the config compiles clean here.
12+
- **The config builder can generate wired configs.** A board that declares an on-board Ethernet PHY now emits an `ethernet:` block and no `wifi:`/`captive_portal:` at all, and the Wi-Fi fields disappear from the form. Bluetooth is compiled out on this board to buy back flash, so CCA-over-BLE is unavailable there; HTTP CCA import is unaffected.
13+
1014
### Fixed
1115
- **A per-panel sensor entry that lists no measurements is now a config error instead of a silent no-op.** `address` and `name` say which panel and what to call it; the entities come from the sub-keys (`power: {}`, `voltage_in: {}`, ...). An entry with none produced nothing at all, with no warning — which reads as "my panels never appeared in Home Assistant" and sends people looking at heap limits and device counts ([#48](https://github.com/RAR/esphome-tigomonitor/issues/48)). Validation now names the offending entry and lists the available sub-keys.
1216

boards/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,27 @@ Assistant over the native API; it just cannot serve the dashboard.
2020
- **UART Buffers**: 2048 RX / 512 TX (increase RX to 8192 if using display package)
2121
- **Note**: When using `atoms3r-display.yaml` package, display updates compete with UART. See UART_OPTIMIZATION.md for packet loss mitigation. TX buffer can stay small since we only listen to the bus.
2222

23+
#### `esp32s3-lilygo-t-connect-pro-lite.yaml` - LilyGO T-Connect Pro Lite (8MB PSRAM, wired)
24+
- **Board**: LilyGO T-Connect Pro Lite (ESP32-S3), 8MB flash, 8MB octal PSRAM
25+
- **Network**: wired Ethernet via an on-board W5500 — **no `wifi:` block**. Do not
26+
add one; the radio would compete for the same lwIP socket budget for nothing
27+
- **CPU**: 240MHz
28+
- **RS485**: built-in transceiver on GPIO17 (TX) / GPIO18 (RX), on its own
29+
hardware UART, so the USB serial console stays available
30+
- **Recommended for**: installations that want the full web UI on a wired
31+
network. PSRAM and 8MB of flash mean `tigo_server` and on-flash history both fit
32+
- **Bluetooth**: compiled out to buy back flash, so the CCA-over-BLE bridge is
33+
not available. HTTP CCA import works normally. Re-enabling BLE means dropping
34+
the four `CONFIG_BT_*` lines *and* switching to `partitions/tigo-8mb-ble.csv`
35+
- **Ready-to-flash example**: `example-t-connect-pro-lite.yaml`
36+
- **Provenance**: contributed by @davidcoulson from a working install
37+
([discussion #30](https://github.com/RAR/esphome-tigomonitor/discussions/30)).
38+
The pin map is the contributor's — no maintainer unit exists to check it
39+
against, though the config compiles clean here. The screen-equipped "Pro" is a
40+
different board and is not configured by this file
41+
- **Other on-board hardware** (pins documented in the board file, nothing
42+
instantiated): RS232, CAN, four WS2812 LEDs, two buttons, a relay
43+
2344
### ESP32-P4 Boards
2445

2546
#### `esp32p4-evboard.yaml` - ESP32-P4 Evaluation Board (32MB PSRAM)
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
# LilyGO T-Connect Pro Lite Configuration
2+
# ESP32-S3, 8MB flash, 8MB octal PSRAM, wired Ethernet (W5500), built-in RS485
3+
# Recommended for: installations that want the web UI on a wired network
4+
#
5+
# Contributed by @davidcoulson in discussion #30, from a working install. The
6+
# maintainer has no unit of this board, so the pin map below is the
7+
# contributor's, not something verified here — if yours behaves differently,
8+
# please say so on that discussion.
9+
#
10+
# WHAT THIS BOARD BRINGS
11+
# ----------------------
12+
# It is the full-fat profile: PSRAM for `tigo_server`, 8MB of flash for the
13+
# on-device history database, and Ethernet instead of WiFi. The Lite has no
14+
# screen; the "Pro" (with screen) is a different board and this file does not
15+
# configure its display.
16+
#
17+
# ETHERNET, NOT WIFI
18+
# ------------------
19+
# The `ethernet:` block below is board wiring — the W5500 is soldered on. Do NOT
20+
# also declare `wifi:` in a config that includes this file. ESPHome will let you
21+
# build both, and the S3's radio then competes for the same lwIP socket budget
22+
# for no benefit. Leave WiFi out; if you want it instead of Ethernet, remove the
23+
# `ethernet:` block rather than running the two side by side.
24+
#
25+
# OTHER ON-BOARD HARDWARE (not configured here, pins for reference)
26+
# -----------------------------------------------------------------
27+
# The board carries more than the Tigo build needs. None of it is instantiated —
28+
# every unused pin stays free — but the map is here so you can add what you want:
29+
#
30+
# RS232 UART TX GPIO4, RX GPIO5
31+
# CAN (TWAI) TX GPIO6, RX GPIO7
32+
# WS2812 LEDs GPIO46, GPIO3, GPIO21, GPIO41 (one LED each)
33+
# Buttons A GPIO39, B GPIO40
34+
# Relay GPIO8
35+
#
36+
# Discussion #30 has a worked example that drives the four LEDs from monitor
37+
# state (online status, night mode, percentage of optimizers reporting, output
38+
# versus peak) if you want that.
39+
40+
esphome:
41+
name: tigo-server
42+
friendly_name: "Tigo Server"
43+
# allow_partition_access in the OTA config requires ESPHome 2026.5.0+
44+
min_version: "2026.5.0"
45+
46+
esp32:
47+
variant: esp32s3
48+
board: esp32-s3-devkitc-1
49+
flash_size: 8MB
50+
partitions: partitions/tigo-8mb.csv
51+
framework:
52+
type: esp-idf
53+
version: recommended
54+
advanced:
55+
# XIP-from-PSRAM — the fix for the tsdb flash-write crash
56+
# (docs/tsdb-flash-crash-issue.md). Every history commit takes ESP-IDF's
57+
# cross-core cache-disable; with code running from flash that stall raced
58+
# network ISRs and faulted. This flag sets SPIRAM_FETCH_INSTRUCTIONS +
59+
# SPIRAM_RODATA, which compiles the cache-disable out entirely. Costs
60+
# ~1.7 MiB of PSRAM.
61+
execute_from_psram: true
62+
components:
63+
# Time-series database for persistent history. Pinned to a fork by
64+
# immutable SHA — see the long explanation in esp32s3-atoms3r.yaml and
65+
# docs/esp-tsdb-fork.md. A branch can move under a build; a commit cannot.
66+
- name: zakery292/esp_tsdb
67+
source: https://github.com/RAR/esp_tsdb.git
68+
ref: ebfc360f00263ab90116ee3e556a9153ab4041a2
69+
# LittleFS — backing filesystem for the tsdb partition
70+
- joltwallet/littlefs^1.16
71+
sdkconfig_options:
72+
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y"
73+
# Run the UART ISR from IRAM. The single most important setting for frame
74+
# loss — without it the ISR stalls whenever flash is busy and Tigo frames
75+
# get dropped mid-burst.
76+
CONFIG_UART_ISR_IN_IRAM: "y"
77+
CONFIG_UART_RX_BUFFER_SIZE: "4096"
78+
# TX stays small: tigo_monitor only ever listens to the bus.
79+
CONFIG_UART_TX_BUFFER_SIZE: "256"
80+
CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE: "32"
81+
CONFIG_LOG_DEFAULT_LEVEL_INFO: "y"
82+
# PSRAM: 8MB octal at 80MHz
83+
CONFIG_SPIRAM_MODE_OCT: "y"
84+
CONFIG_SPIRAM_SPEED_80M: "y"
85+
# Left OFF, unlike the WiFi boards. That option relocates the WiFi/lwIP
86+
# buffer pool to PSRAM to save internal RAM, which matters when the radio
87+
# is up. Here the radio is off and the W5500 driver keeps its buffers
88+
# internal regardless, so it buys nothing.
89+
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP: "n"
90+
# VFS directory operations (stat/unlink/rename/opendir), off by default in
91+
# IDF. esp_tsdb reads database sizes via stat(), so without this the
92+
# History page's size column reads 0 and esp_tsdb's unlink() recovery
93+
# paths silently no-op.
94+
CONFIG_VFS_SUPPORT_DIR: "y"
95+
# More lwIP sockets for the web server + API running together (avoids
96+
# "Failed to create socket" under load, #20).
97+
CONFIG_LWIP_MAX_SOCKETS: "16"
98+
CONFIG_LWIP_MAX_ACTIVE_TCP: "16"
99+
CONFIG_LWIP_MAX_LISTENING_TCP: "16"
100+
# Bluetooth off: it is dead weight on a wired board and buys back a large
101+
# slice of flash. Adding the BLE CCA bridge means removing these four
102+
# lines AND switching to partitions/tigo-8mb-ble.csv — the BLE stack does
103+
# not fit the standard app slot.
104+
CONFIG_BT_ENABLED: "n"
105+
CONFIG_BLUEDROID_ENABLED: "n"
106+
CONFIG_BT_BLE_42_FEATURES_SUPPORTED: "n"
107+
CONFIG_BT_BLE_50_FEATURES_SUPPORTED: "n"
108+
109+
# Enable PSRAM
110+
psram:
111+
mode: octal
112+
speed: 80MHz
113+
114+
# --- Network -----------------------------------------------------------------
115+
# On-board W5500 over SPI. These pins are the board's wiring, not a preference.
116+
ethernet:
117+
type: W5500
118+
clk_pin: GPIO12
119+
mosi_pin: GPIO11
120+
miso_pin: GPIO13
121+
cs_pin: GPIO10
122+
interrupt_pin: GPIO9
123+
reset_pin: GPIO48
124+
clock_speed: 8MHz
125+
# Uncomment for a fixed address (DHCP otherwise):
126+
# manual_ip:
127+
# static_ip: 10.0.0.50
128+
# gateway: 10.0.0.1
129+
# subnet: 255.255.255.0
130+
131+
# --- Tigo bus ----------------------------------------------------------------
132+
# The board's RS485 transceiver, on its own hardware UART. That leaves the USB
133+
# console free, so keep `logger:` on its defaults — do NOT set `baud_rate: 0`.
134+
uart:
135+
id: tigo_uart
136+
tx_pin: GPIO17
137+
rx_pin: GPIO18
138+
baud_rate: 38400
139+
data_bits: 8
140+
parity: NONE
141+
stop_bits: 1
142+
rx_buffer_size: 2048
143+
144+
# --- Tigo Monitor ------------------------------------------------------------
145+
tigo_monitor:
146+
id: tigo_hub
147+
uart_id: tigo_uart
148+
# Device and node tables live in PSRAM here, so this is cheap to raise —
149+
# the contributor's install runs 64. Set it to your optimizer count.
150+
number_of_devices: 30
151+
update_interval: 30s
152+
153+
# --- Web server --------------------------------------------------------------
154+
tigo_server:
155+
id: tigo_web
156+
tigo_monitor_id: tigo_hub
157+
port: 80
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Example Tigo Monitor Configuration using the LilyGO T-Connect Pro Lite
2+
#
3+
# This is the "wired, full features" profile: web UI, REST API, on-flash
4+
# history, and Home Assistant over the native API — all over Ethernet.
5+
#
6+
# The hardware base (esp32s3-lilygo-t-connect-pro-lite.yaml) provides:
7+
# - the ESP32-S3 / 8MB flash / 8MB PSRAM setup and the tsdb history storage
8+
# - the on-board W5500 Ethernet controller
9+
# - the UART on GPIO17/18, the tigo_monitor hub, and tigo_server
10+
# so this file only layers on credentials, sensors, and app config.
11+
#
12+
# There is deliberately no `wifi:` block — see the note in the board file.
13+
# Panel addresses come from the web UI once it is up (Nodes view), or from the
14+
# "Generate YAML Config" button below if you would rather work from the logs.
15+
16+
packages:
17+
board: !include esp32s3-lilygo-t-connect-pro-lite.yaml
18+
19+
external_components:
20+
- source:
21+
type: git
22+
url: https://github.com/RAR/esphome-tigomonitor
23+
ref: main
24+
components: [tigo_monitor, tigo_server]
25+
26+
logger:
27+
level: INFO # Change to DEBUG if you need detailed logs for troubleshooting
28+
29+
api:
30+
31+
ota:
32+
- platform: esphome
33+
password: "YOUR_OTA_PASSWORD"
34+
# Permits a later partition-table change over the air (ESPHome 2026.5.0+).
35+
# It is only the permission: applying one still takes an explicit
36+
# `esphome upload --partition-table`. A plain `esphome run` never sends a
37+
# partition table, and succeeds without changing the layout.
38+
allow_partition_access: true
39+
40+
# Timestamps for the history database. Any time source works; SNTP needs no
41+
# Home Assistant connection.
42+
time:
43+
- platform: sntp
44+
id: sntp_time
45+
timezone: "America/New_York" # Adjust for your timezone
46+
47+
button:
48+
- platform: tigo_monitor
49+
name: "Generate YAML Config"
50+
id: generate_yaml_button
51+
tigo_monitor_id: tigo_hub
52+
button_type: yaml_generator
53+
- platform: tigo_monitor
54+
name: "Print Device Mappings"
55+
id: device_mappings_button
56+
tigo_monitor_id: tigo_hub
57+
button_type: device_mappings
58+
- platform: tigo_monitor
59+
name: "Reset Node Table"
60+
id: reset_node_table_button
61+
tigo_monitor_id: tigo_hub
62+
button_type: reset_node_table
63+
64+
sensor:
65+
# System-wide sensors — these need no addresses and work from first boot.
66+
- platform: tigo_monitor
67+
tigo_monitor_id: tigo_hub
68+
name: "Total System Power"
69+
id: total_system_power
70+
71+
- platform: tigo_monitor
72+
tigo_monitor_id: tigo_hub
73+
name: "Total System Energy"
74+
id: total_system_energy
75+
76+
- platform: tigo_monitor
77+
tigo_monitor_id: tigo_hub
78+
name: "Active Device Count"
79+
80+
- platform: tigo_monitor
81+
tigo_monitor_id: tigo_hub
82+
name: "Missed Frame Count"
83+
84+
- platform: tigo_monitor
85+
tigo_monitor_id: tigo_hub
86+
name: "Free Internal RAM"
87+
88+
- platform: tigo_monitor
89+
tigo_monitor_id: tigo_hub
90+
name: "Free PSRAM"
91+
92+
- platform: uptime
93+
name: "Tigo Server Uptime"
94+
95+
# Per-panel sensors go here. An entry needs `address:` AND at least one
96+
# measurement sub-key — address and name alone create no entities:
97+
#
98+
# - platform: tigo_monitor
99+
# tigo_monitor_id: tigo_hub
100+
# address: "1234"
101+
# name: "Panel A1"
102+
# power: {}
103+
# voltage_in: {}
104+
# current_in: {}
105+
# temperature: {}
106+
107+
text_sensor:
108+
- platform: ethernet_info
109+
ip_address:
110+
name: "Tigo Server IP Address"
111+
entity_category: diagnostic
112+
mac_address:
113+
name: "Tigo Server MAC Address"
114+
entity_category: diagnostic
115+
116+
- platform: version
117+
name: "Tigo Server ESPHome Version"
118+
119+
binary_sensor:
120+
- platform: status
121+
name: "Tigo Server Status"
122+
123+
- platform: tigo_monitor
124+
tigo_monitor_id: tigo_hub
125+
night_mode:
126+
name: "Solar Night Mode"
127+
128+
switch:
129+
- platform: restart
130+
name: "Tigo Server Restart"

0 commit comments

Comments
 (0)