Skip to content

Simply send SSD1306 off/on commands to keep I2C bus on Wire functioning correctly#1724

Closed
weebl2000 wants to merge 2 commits intomeshcore-dev:devfrom
weebl2000:fix-ssd1306display
Closed

Simply send SSD1306 off/on commands to keep I2C bus on Wire functioning correctly#1724
weebl2000 wants to merge 2 commits intomeshcore-dev:devfrom
weebl2000:fix-ssd1306display

Conversation

@weebl2000
Copy link
Contributor

@weebl2000 weebl2000 commented Feb 17, 2026

Following comment by @IoTThinks that the code killed the I2C bus. Even though pins 17/18 are mentioned to be dedicated to the OLED, you could still use the I2C bus on there for other things. I started out by stopping/restarting the Wire, but maybe it's easier to just put SSD11306 to sleep and avoid VEXT claim/release altogether? Power consumption should be very very minimal (< 10µA).

Confirmed that my BME280 works again when I comment out dedicated env pins:

image

Before this change with these lines commented out the BME280 would not be read because the bus would be broken.

I don't have a Heltec v4 with the TFT display, would be great if someone could test. I'd suspect the behavior is unchanged.

@Quency-D thoughts?

Tested this on a USB companion and v4 repeater, both working fine. No increased power consumption. Theoretically a 3500 mAh 18650 could power the SSD11306 display for 40 years if it's in the off state.

The only concern might be keeping VEXT on, but currently only the heltec boards have VEXT defined for the display and there's nothing else on there.

For anyone that can't build themselves easily but wants to try this: https://mcimages.weebl.me?commitId=fix-ssd1306display

…ol (like Heltec v4)

Call Wire.end() before cutting power to OLED to prevent parasitic
current draw and restore the bus cleanly.
@weebl2000 weebl2000 changed the title Simply send SSD1306 off/on commands to keep Simply send SSD1306 off/on commands to keep I2C bus on Wire functioning correctly Feb 17, 2026
@IoTThinks
Copy link
Contributor

You may check this PR.
We can pass NULL to perpher_power to skip all release/claim.
OLED in Heltec v4 does not use vext.

And set back the value in MC 1.11 for vext.

#1569

Please keep the GPIO 17,18 for all Meshcore roles on Heltec boards.

@IoTThinks
Copy link
Contributor

@weebl2000 I believe when vext is on, it would comsume extra 26mA as in MeshCore 1.12.

The minimum current change you see, I suspect not due to vext.
OLED is likely not using vext at all.

The extra small current is OLED still consumes tiny current when off.

@weebl2000 weebl2000 closed this Feb 18, 2026
@weebl2000 weebl2000 reopened this Feb 18, 2026
@weebl2000 weebl2000 closed this Feb 18, 2026
@weebl2000
Copy link
Contributor Author

@weebl2000 I believe when vext is on, it would comsume extra 26mA as in MeshCore 1.12.

The minimum current change you see, I suspect not due to vext. OLED is likely not using vext at all.

The extra small current is OLED still consumes tiny current when off.

The current increase when the screen turns off isn't from OLED sleep current (~10µA, unmeasurable on USB). It's from the inverted VEXT polarity — release() with ACTIVE=LOW drives GPIO36 HIGH, which turns VEXT ON (NPN Q6 + PMOS Q5 high-side switch). So the firmware turns on the Vext rail at the exact moment it intends to turn it off. Your fix (display(NULL) + ACTIVE=HIGH) correctly avoids this.

@IoTThinks
Copy link
Contributor

IoTThinks commented Feb 18, 2026

I would love to have the root cause fixed.

My PR may be a hint. I dont mind if any friends here can push a fix to dev.

Thanks a lot for your finding about vext polarity.

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

Comments