Fix blank OLED on T-Beam Supreme V3 (I2C bus init + 0x3D address)#2815
Conversation
The SH1106 OLED on the LilyGo T-Beam Supreme V3 never lights up because: 1. The primary I2C bus (Wire) that the OLED, BME280 and magnetometer share is never initialized. The PMU/RTC use Wire1 (via XPowersLib); nothing brings up Wire on PIN_BOARD_SDA/PIN_BOARD_SCL, so the display driver talks on the wrong default pins. 2. The OLED is at I2C address 0x3D on this board (0x3C is taken by the QMC6310 magnetometer), but SH1106Display::begin() only tried 0x3C. Initialize Wire for TBEAM_SUPREME_SX1262, and have SH1106Display::begin() prefer 0x3D (only ever used by the OLED) before falling back to 0x3C. Backwards-compatible for boards with the OLED at 0x3C. Closes meshcore-dev#2609
10614ac to
b8b6598
Compare
romeomont
left a comment
There was a problem hiding this comment.
Tested on my T-Beam Supreme V3 and the OLED now works correctly. LGTM, good to merge.
|
Re: the outstanding regression-check item — I only had a T-Beam Supreme on hand (the 0x3D board, already covered by the checked test-plan item), not a 0x3C board, so I did a code-level review of the fallback path instead of a hardware run: uint8_t addr = 0;
if (i2c_probe(Wire, 0x3D)) {
addr = 0x3D;
} else if (i2c_probe(Wire, DISPLAY_ADDRESS)) {
addr = DISPLAY_ADDRESS;
}
return addr && display.begin(addr, true);On a standard board with the OLED at 0x3C and nothing at 0x3D:
Probing an absent address is a standard non-destructive I2C operation, and Logic checks out for the 0x3C fallback case. I don't currently have a plain 0x3C board (standard T-Beam / T-Beam 1W / Station G2 / etc.) to physically confirm, so this is a code review, not a hardware-verified test run — flagging that distinction for whoever merges. |
|
No idea if it is better to define "DISPLAY_ADDRESS" in platformio.ini for T-Beam Supreme V3. |
Keep SH1106Display generic by relying on DISPLAY_ADDRESS while the T-Beam Supreme variant declares its 0x3D OLED address.
|
Good suggestion. I pushed a follow-up commit ( |
Summary
Fixes the blank OLED on the LilyGo T-Beam Supreme V3 (ESP32-S3 + SX1262 + SH1106). Closes #2609 (see also #2591).
There are two independent bugs on this board, and both are needed for the display to work:
Wire) is never initialized. On the Supreme the PMU/RTC are onWire1(GPIO 42/41, brought up byXPowersLib), while the OLED + BME280 + magnetometer are on the primaryWirebus (GPIO 17/18). Nothing ever callsWire.begin()for it, soAdafruit_SH110Xends up on the wrong (default) pins.0x3D, not0x3C. On this board0x3Cis occupied by the QMC6310 magnetometer, so the panel was moved to0x3D(per LilyGo's hardware docs).SH1106Display::begin()only ever triedDISPLAY_ADDRESS(0x3C).Changes
src/helpers/esp32/TBeamBoard.cpp— initializeWireonPIN_BOARD_SDA/PIN_BOARD_SCLforTBEAM_SUPREME_SX1262so the OLED bus is actually up beforedisplay.begin().src/helpers/ui/SH1106Display.cpp— probe0x3Dfirst (only the OLED uses it) and fall back to0x3C. This avoids the false-positive where0x3CACKs because of the magnetometer.Both changes are backwards-compatible: boards with the OLED at the standard
0x3Cand nothing at0x3Dstill resolve to0x3C.Evidence
Boot-time I2C scan on the affected board (Wire, GPIO 17/18):
0x3C= QMC6310 magnetometer0x3D= SH1106 OLED0x77= BME280After this change the display initializes at
0x3Dand renders normally.Test plan
T_Beam_S3_Supreme_SX1262_repeater): OLED renders boot logo + home screen.0x3C(e.g. standard T-Beam) to confirm the fallback path still initializes the display.