Skip to content

Upgrade TTGO T-Beam Sup to be LilyGo T-Beam Supreme board support with AXP2101 and SH1106#303

Open
Bwooce wants to merge 4 commits intoG4lile0:betafrom
Bwooce:clean/supreme-board
Open

Upgrade TTGO T-Beam Sup to be LilyGo T-Beam Supreme board support with AXP2101 and SH1106#303
Bwooce wants to merge 4 commits intoG4lile0:betafrom
Bwooce:clean/supreme-board

Conversation

@Bwooce
Copy link

@Bwooce Bwooce commented Feb 22, 2026

Summary

Upgrades the existing TTGO_TBEAM_SX1262 board entry ("TTGO T-Beam Sup SX1262 V1.0") with full hardware support for the LilyGo T-Beam Supreme S3, which is a newer revision of the same board line. The existing entry had basic pin mappings but lacked PMU support, display driver, and auto-detection.

Changes to the existing entry:

  • TCXO voltage: 1.6V to 1.8V (matches Meshtastic community standard; both values within TCXO spec 1.6-3.3V)
  • LED pin: hardcoded 3 to SUPREME_LED define (same value, clearer intent)
  • GNSS pins: added RX/TX/Wakeup mappings (wired up in follow-up PR)
  • Board name: renamed to "433 Mhz LilyGo T-Beam Supreme SX1262"
  • Bounds check: stored board index validated on boot to prevent crashes if enum layout changes

New functionality:

  • AXP2101 PMU support on Wire1 (GPIO 42/41): battery voltage/percentage, VBUS voltage, per-rail power control (ALDO1 sensors, ALDO3 radio, ALDO4 GNSS), sensor deep sleep, unused rails disabled
  • SH1106 OLED auto-detection with 5-minute display timeout
  • Auto-detection via AXP2101 probe on Wire1 in boardDetection()
  • setDio2AsRfSwitch(true) for SX1262/SX1268 (standard behaviour, harmless on boards without external switch)
  • Battery voltage via Power API replacing raw analogRead(36) median-sort in MQTT_Client

boards/lilygo-t-beam-supreme.json: Custom PlatformIO board definition required because neither pioarduino nor the official espressif32 platform ship a T-Beam Supreme board. Defines 8MB flash (vs 4MB on ttgo-t-beam), PSRAM, ESP32-S3 MCU, and USB CDC settings.

This PR covers the 433 MHz SX1262 variant only. The 868/915 MHz variant shares identical pin mappings and would need a separate board entry with appropriate radio type.

Includes setup documentation in doc/LilyGo_T-Beam_Supreme.md.

14 files changed, 455 insertions, 127 deletions. Builds on all 6 PlatformIO environments. Tested on T-Beam Supreme 433 MHz hardware.

Depends on #302.

Built with AI assistance (Claude) under full human supervision, with on-device testing on T-Beam Supreme hardware.

Test plan

  • Builds on all 6 PlatformIO environments without errors
  • T-Beam Supreme boots, detects AXP2101 on Wire1, configures power rails
  • SH1106 display detected and renders correctly
  • Battery voltage reads correctly via Power API (was 0.00V before fix)
  • Display turns off after 5 minutes, reactivates on button press
  • Existing boards (Heltec, TTGO) unaffected
  • DIO2 RF switch does not interfere with boards that lack external switch
  • Board index bounds check prevents crash on enum changes (verified on device)
  • MQTT telemetry reports battery voltage (0.70V/0% correct for USB-only, no battery)

The worldmap AJAX handler used 'x.status' (the console script's
XMLHttpRequest variable) instead of 'wmx.status', causing the
worldmap data to never update when both scripts are active.
getTZ() unconditionally skips the first 3 characters of the tz
buffer for deduplication prefix removal. If the buffer is shorter
than 3 characters (e.g. empty on first boot), this reads past the
end. Return "GMT0" as a safe default when the buffer is too short.
The !p test packet command calls radio.sendTestPacket() which
dereferences the radioHal pointer. On unconfigured boards where
Radio::init() has not been called, radioHal is NULL, causing a
crash. Add radio.isReady() check before attempting transmission.
Upgrades the existing TTGO_TBEAM_SX1262 board entry with full hardware
support for the LilyGo T-Beam Supreme S3, a newer revision of the same
board line. The original entry had basic pin mappings but lacked PMU
support, display driver, and auto-detection.

Board entry changes:
- TCXO voltage 1.6V to 1.8V (Meshtastic/community standard)
- LED pin uses SUPREME_LED define, GNSS pins mapped
- Renamed to "433 Mhz LilyGo T-Beam Supreme SX1262"
- Board index bounds check on boot prevents crash if enum changes

New hardware support:
- AXP2101 PMU on Wire1 (GPIO 42/41): battery voltage/percentage, VBUS,
  per-rail power control (ALDO1 sensors, ALDO3 radio, ALDO4 GNSS),
  sensor deep sleep, unused rails disabled
- SH1106 OLED auto-detection with 5-minute display timeout
- Auto-detection via AXP2101 probe on Wire1 in boardDetection()
- DIO2 RF switch enable for SX1262/SX1268
- Battery voltage via Power API replacing raw analogRead(36) median-sort

Includes board JSON, PlatformIO env, and setup documentation.
433 MHz SX1262 variant only.
@Bwooce Bwooce force-pushed the clean/supreme-board branch from 5bd8c23 to 4316f1a Compare February 22, 2026 03:17
@Bwooce
Copy link
Author

Bwooce commented Feb 22, 2026

I'm unsure if this should be called "433Mhz". It's not totally clear to me how the "this is what bands I am capable of" information is obtained; ideally we'd have one board def here for all the different bands (everything else is the same).

@Bwooce Bwooce changed the title Add LilyGo T-Beam Supreme board support with AXP2101 and SH1106 Upgrade TTGO T-Beam Sup to be LilyGo T-Beam Supreme board support with AXP2101 and SH1106 Feb 22, 2026
@Bwooce Bwooce marked this pull request as ready for review February 22, 2026 04:01
@Bwooce
Copy link
Author

Bwooce commented Feb 22, 2026

I have a follow on PR, assuming you like this one, to use the GPS for something useful in a configurable way.

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.

1 participant