Setting a GPIO high before on_boot / debugging power issue with LilyGO T-HMI

Hi,

I’m tinkering with a LilyGO T-HMI board and I have things working fine with ESPHome as long as I power up the board via USB-C. The board also has a separate 5V DC connector, but I cannot make it work when I supply power that way.

Looking at the designs from Github and some example code it looks like I’d need to set GPIO14 HIGH to power on the board. I have a similar situation with another board from LiliGO (T-Display S3) and in that case I added the following configuration to make it work:

esphome:
...
  on_boot:
    - priority: 90
      then: 
      - output.turn_on: lcd_power_on
...
output:
  - platform: gpio
    pin: GPIO15
    id: lcd_power_on

But, for this T-HMI board, the same trick doesn’t work. The board is just dead in the water. It does not power on the display, nor turns on any LED, nor connect to the WiFi.

From a hardware perspective, I did try with a very small Arduino sketch and it seems to power on when I set GPIO14 HIGH. But it does not work when I do it via esphome/on_boot. I even tried increasing the priority of on_boot to various values between 800 and -100, but with no success.

What else can I try? I cannot debug things via USB, because the board would power up via USB if I connect the cable.

Is there a way to maybe set a GPIO high “before” on_boot?

Thank you!

Physically connect it direct to a 3.3V line?

Hm. Right, I never thought of that. But that GPIO is not exposed on the board to solder anything on it. :confused:

Eventually what I did was to butcher an USB cable and power on the board via USB instead of the additional power connector. In talking with the board manufacturer they pointed out that for that particular power input they also have a Reed switch. But the board behaves weird with esphome. If I keep a magnet close to that Reed switch the board does seem to power up, I can see it on the wireless network, but I cannot access it at all.

I just gave up and powered via USB eventually. There are too many weird things that I cannot easily debug.

Are you able to get the touchscreen/display powered up via esphome via USBC?
Would you be able to share the captive_portal part of your code that works?
I am able to get it to connect to WiFi, but no idea how to enable display/touchscreen after that. Not sure about pins even after looking at schematic on https://github.com/Xinyuan-LilyGO/T-HMI/tree/master