Unfortunately, the screen stays off. Did anyone already trying to get ESPHome to work on LilyGo T-Embed? Is it perhaps due to the board settings that it doesn’t work?
I haven’t got a embed board but all other lilygo products I have ever bought has had pinout diagrams that is incorrect.
Usually the pins that are for their hardware is correct and only the exposed leftover pins are incorrect.
But it wouldn’t surprise me if this too is wrong.
I have not yet tried this board in ESPHome, but I know that it is based on the t-display S3. It doesn’t use SPI to access the screen, but a faster parallel access. In Arduino you need to mod the standard eTFT-SPI lib from Bodmer to get it to work (faster than SPI).
So I presume that is the issue. Check this link T-Display S3 - How to install in Arduino IDE - YouTube from Volos Projects how to use it in the Arduino dev env.
Maybe someone got the T- display S3 working in ESPHome, that config should work for the T-embed.
Thank you. That’s a solution. The Display backlight worked, until I tried to customize it further.
I’m at least one step further. Backlight works, but no image visible. I hope it will soon be easier to equip the T-Embed with ESPHome
I got it to work using patched libraries from LilyGO’s GitHub repo for T-Embed and custom component from tdisplay3. I did have to add a switch for GPIO46. This GPIO is working as a power switch for board’s peripherals.
Looking at diff between upstream and LilyGO’s version of TFT_eSPI library, there aren’t many changes in LilyGO version, so it’s really weird that native ESPHome components do not work out of the box (they seem to be based on TFT_eSPI). Two differences I noticed are:
LiliyGO example code for T-Embed write ST7789_SLPOUT command in setup:
tft.writecommand(0x11);
T-Embed’s version of TFT_eSPI seems to be running at a higher SPI frequency.
Anyway, when I added ESPHome automation to write 0x11 on boot, I got some output on the screen (garbage and faint “Hello world” text"). Still need to setup development environment for ESPHome to experiment with SPI frequencies, but I’m moderately optimistic about this
On the other hand, I might just hack together some custom components for TFT_eSPI and lvlg, and use that, we’ll see how it goes
I’m using the ESPHome code for the ST7789V component from October (or prior) to test this display and it has the same command on Setup but it’s still not working for me:
void ST7789V::setup() {
ESP_LOGCONFIG(TAG, "Setting up SPI ST7789V...");
this->spi_setup();
this->dc_pin_->setup(); // OUTPUT
this->init_reset_();
this->write_command_(ST7789_SLPOUT); // Sleep out
delay(120); // NOLINT
Edit - I forgot to mention earlier that the reason I’m still using the OLD component for ST7789V is because I had issues with SPI for some new boards using the latest version, and the old version had fixed that, but not in this case.
ok i got some sketches working now. Mainly as @lukasz-tuz mentioned, you have to ensure GPIO46 (POWER_ON PIN) is high and also you have to write command tft.writecommand(0x11);
also better to use tft.init(); instead of tft.begin(); and due to some weird reason, i have to pull out the usb cable from power and then plug-in again to completely erase the cache of display screen from previously flashed sketch.
OK, after some trial and error I finally got the native ESPHome’s st7789v component to work with LilyGO’s T-Embed. Turns out, sending the SLPOUT command is required, but should be done as early as possible:
Thanks for your efforts on this! In addition to the config above, it sounds like I need to use the libraries from here. Any other patches or tweaks? Ultimately I’d like to get this working with the esphome-remote project.