Recently I ordered the LilyGO T-QT ESP32-S3 to turn it into a small alarm clock and maybe display some essential info about the house. It took a couple of hours to get it to work, since it is running the GC9107 which is not a standard module in ESPHome.
I’ll leave my config here for
Anyone else trying or hoping to get it up and running.
Maybe some advice on essential but pretty stupid backlight turnoff on boot?
Prerequisites
The initial flash of the module must be done with your browser, esphome flasher, does not work, this is ESP32s3-specific.
You need a font called OCRAEXT.ttf in your fonts directory. Of course you can use another one, but if you do so, change the font-section accordingly.
So this one is pretty similar to T-Display-S3 and T-Embed. Compared to T-Embed:
You need the same priority 800 labda to send 0x11 to
You don’t need GPIO46 to turn peripherals on.
You do need to turn backlight OFF (!) at priority -100 (maybe earlier, but it doesn’t work at 800), otherwise the screen will remain off.
The code will also create a diagostic backlight switch in your HA, which is usefull for debugging, but otherwise pretty stupid. Especially since is must be off to be on. (Yeah, I could invert it probably)
So, I made some improvements, basically answering my own question.
Instead of defining GPIO10 as a switch, you can define it as a (inverted) PWM led light, which gives you the possibility to dim! and switch off the backlight.
Make sure to update to the latest version of ESPHome. I’ve spend hours trying to get dimming to work. Then I found out my outdated version was suffering from some kind of PWM-bug for the ESP32S3.
After this, the on_boot turn_off can be removed.
You can also remove the backlight_pin from the display-settings
I made some small adjustments to offset_width and _height.
Thanks for your post, I was looking for exactly this.
As I’m a beginner in this area, would it be possible to explain this specific step a little more indeep?
Whatever I tried, I end-up that the S3 reboots in the middle of the initial flash and is stuck/blocking every other action.
Only a full-flash with the original LilyGo bin can unblock it (first unplug, press & hold boot and replug, flash).
Hi Michael,
I don’t know what you have tried and if your problem is the same as mine
I experienced problems trying to do initial flash with esphomeflasher. I got “Invalid header: 0xffffffff” messages. For me it only worked by flashing through the browser (which took me a while, because I run ESPHome Docker version, which I assume you don’t):
If you select that option, it will guide you through the process.
Ah, finally I go it … I do have a slightly different model of the display.
So it can’t work 1:1, but the hint of flashing it once in http://web.esphome.io/ is still very true.
I tweaked the code a bit to provide dimmable control over the backlight on the M5 AtomS3. And with ESPHome version 2023.4.1, I didn’t need to specify the version, platform_version, or variant in the esp32 section.
I have tried your config but for me display just blinks shows 00:00 (or current time) and does not show anything, if i uncomment id(disp).disable(); then it does not show anything at all
Hard to say. I wonder if it even has anything to do with the display. Have you tried uploading a more or less empty firmware? Ruling out power/wifi issues?
This is using the ESP-IDF framework which I’m given to understand is the recommended one for ESP32S3. We use the transform key instead of rotation to do the 180⁰ in hardware instead of software. The offsets are swapped compared to using the st778v component. We have to invert the colours too and using the m5stack-recommended 500Hz PWM for the backlight I find that 0.3 for the minimum duty cycle gives a usable 0-100% backlight brightness range.
Note that I do not have to send command 0x11 (SLPOUT) to the display controller at start-up - I assume the ili9xxx/st7789v driver must be doing that for us.
FYI I can get 20fps (50ms refresh) for simple graphics-primitive-based animations with the auto-clear turned off.
I’ve now bought another AtomS3 and have used the arduino framework type with otherwise the same configuration I’ve posted previously and it works fine too. (I prefer the arduino framework anyway - never liked the way ESP-IDF builds everything and lets God/the linker sort them out.)