Fixes #1183 — T-Echo Lite incorrect battery voltage#2287
Fixes #1183 — T-Echo Lite incorrect battery voltage#2287liamcottle merged 1 commit intomeshcore-dev:devfrom
Conversation
|
Hi @pelgraine — a few questions to help clarify which variant this PR
I ask because my PR #2353 targets the Non-Shell variant specifically, |
|
Hi, yes, I shouldn't have put the platformio changes in. This fix is really just about the battery voltage problem detailed in issue #1183, not the headless build problem. The one I worked with was actually the T-Echo Lite Non-Shell (has USB-C, no display) version. When I have a spare minute I'll fix the PR to remove those. |
Battery (TechoBoard.h/cpp): Added PIN_VBAT_MEAS_EN (P0.31) — the T-Echo Lite has a gated voltage divider that must be enabled before reading. Also added pinMode(PIN_VBAT_READ, INPUT) before each ADC read to reclaim P0.02 from other peripherals. Pin definitions hardcoded from LilyGo's t_echo_lite_config.h. I2C (variant.h): Corrected SDA/SCL from P0.04/P0.02 to P1.04/P1.02 per LilyGo's IIC_1_SDA/IIC_1_SCL. The old P0.02 mapping conflicted with the battery ADC pin. GPS (variant.h): Corrected all five GPS pin assignments to match LilyGo's config — UART TX/RX, wake, PPS, and power enable were all scrambled. SPI (variant.h): Fixed SPI_INTERFACES_COUNT from _PINNUM(0, 2) to (2). Tested on T-Echo Lite Non-Shell (USB-C, no display). Battery readings match Heltec V4 reference within 10mV.
aeecc4d to
d516cd8
Compare
|
@jirogit all updated! |

The T-Echo Lite variant files were copied from the T-Echo without adapting to the Lite's different hardware. Three issues fixed, plus build environments added for the screenless Core variant.
Battery (TechoBoard.h/cpp): Added PIN_VBAT_MEAS_EN (P0.31) — the T-Echo Lite has a gated voltage divider that must be enabled before reading. Also added pinMode(PIN_VBAT_READ, INPUT) before each ADC read to reclaim P0.02 from other peripherals. Pin definitions hardcoded from LilyGo's t_echo_lite_config.h.
I2C (variant.h): Corrected SDA/SCL from P0.04/P0.02 to P1.04/P1.02 per LilyGo's IIC_1_SDA/IIC_1_SCL. The old P0.02 mapping conflicted with the battery ADC pin.
GPS (variant.h): Corrected all five GPS pin assignments to match LilyGo's config — UART TX/RX, wake, PPS, and power enable were all scrambled.
Tested on T-Echo Lite Base (screenless):

Battery readings now match Heltec V4 comparison reference within 10mV - Heltec v4 read partially discharged battery as 3.51v, screenshots of T-Echo Lite readings below: