-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Lilygo T5-4.7 inch ESP32-S3 (aka "plus"/V2.3) e-paper module #1960
Comments
So far I managed to get
With the above, basic ESP32 functionality like OTA updates work normally.
Hopefully someone will have time to adapt the screen library. Update: there are three implementations for the original board discussed in #1109:
There's some work happening over at vroland/epdiy#203 for supporting ESP32-S3 in general and the new T5-4.7 in particular, but it's currently a bit too experimental for my taste, so I'm toying with approach similar to the one taken by tiaanv... |
OK, the screen appears to work for me: https://github.com/nickolay/esphome-lilygo-t547plus |
How did you flash, i was not able to flash it via esphome web. Only worked with esptool. I have a basic configuration to display the time, but it shows a wrong time, hour is alwas at 01:XX. My config: esphome:
name: lilygo
platformio_options:
# Unless noted otherwise, based on https://github.com/Xinyuan-LilyGO/LilyGo-EPD47/blob/1eb6119fc31fcff7a6bafecb09f4225313859fc5/examples/demo/platformio.ini#L37
upload_speed: 921600
monitor_speed: 115200
board_build.mcu: esp32s3
board_build.f_cpu: 240000000L
board_build.arduino.memory_type: qspi_opi
board_build.flash_size: 16MB
board_build.flash_mode: qio
board_build.flash_type: qspi
board_build.psram_type: opi
board_build.memory_type: qspi_opi
board_build.boot_freq: 80m
build_flags: # the first three defines are required for the screen library to function.
- "-DBOARD_HAS_PSRAM"
- "-DARDUINO_RUNNING_CORE=0" # TODO: this conflicts with the value from platformio's idedata, spewing a lot of warnings during the build.
- "-DARDUINO_EVENT_RUNNING_CORE=0" # and this too
# In addition to lilygo's settings:
# To enable reading logs over USB until `hardware_uart: USB_CDC` support
# is added to `logger:`, as detailed in <https://github.com/esphome/feature-requests/issues/1906>:
- "-DARDUINO_USB_MODE=1"
- "-DARDUINO_USB_CDC_ON_BOOT=1"
esp32:
variant: esp32s3
board: esp32-s3-devkitc-1
framework:
type: arduino
# Just like in <https://community.home-assistant.io/t/enable-usb-cdc-to-log-hello-world-to-esp32-s3-dev-board-for-esphome/463164/10>
# I had problems with newer versions; the following combination happens to work, so using it for now.
version: 2.0.3
platform_version: 5.1.1
logger:
level: VERBOSE
# hardware_uart: USB_CDC # see note about <https://github.com/esphome/feature-requests/issues/1906> above
# Enable Home Assistant API
api:
encryption:
key: "rZjS7VS1G5PPFc7JLfwWYGMZ8LVg81Mokz9UUoCel00="
ota:
password: "6903efa08992bfb72e6e2545357799ae"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Lilygo-T5 Fallback Hotspot"
password: "xHMGPUOTHBjX"
captive_portal:
binary_sensor:
- platform: gpio
pin:
number: GPIO21 #was GPIO39 on the previous board
inverted: true
name: "Button 1"
on_press:
- logger.log: PhysButton Pressed
external_components:
source:
type: local
path: esphome-lilygo-t547plus/components/
components: ["t547"]
time:
- platform: homeassistant
id: esptime
font:
- file: "fonts/Roboto-Regular.ttf"
id: font_clock
size: 78
glyphs: [':', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
display:
- platform: t547
# rotation: 180
update_interval: 30s
lambda: |-
it.strftime(it.get_width()/2, it.get_height()/2, id(font_clock), TextAlign::TOP_CENTER, "%H:%M", id(esptime).now());
|
You can add platformio board configuration from LilyGo-EPD47 GitHub repository to esphome. I added lilygo-t5-74-plus.json file to esphome:
name: liligo-t5-47-epaper-plus
platformio_options:
board_dir: boards
#include https://github.com/Xinyuan-LilyGO/LilyGo-EPD47/blob/master/platformio/boards/lilygo-t5-47-plus.json as custom board
board: lilygo-t5-47-plus
esp32:
variant: esp32s3
board: lilygo-t5-47-plus
framework:
type: arduino
# You don't need to specify version and platform_version
i2c:
sda: GPIO17
scl: GPIO18
# There is some problems with i2c scan so turn scan off if problem appear on your board
scan: false
id: bus_a
external_components:
- source: github://nickolay/esphome-lilygo-t547plus
components: ["t547"]
display:
- platform: t547
id: t5_display
update_interval: 30s |
I'm not sure how you can provide the necessary platformio_options via esphome web, so I'm flashing using the CLI ( I'm always flashing over USB to be able to see the logs from the first startup, which are very useful to troubleshoot the occasional problems, like the device booting into safe mode (i.e. ignoring most of the config). I've also added the device to Home assistant manually.
Cool tip, thanks! |
with this solution it works much better and without problems.. thank you |
Has anyone figured out how to read the battery voltage? According to https://github.com/Xinyuan-LilyGO/LilyGo-EPD47/blob/master/schematic/T5-4.7-Plus.pdf the pin should be GPIO14, but there I'm getting |
@kaeltis see Xinyuan-LilyGO/LilyGo-EPD47#87 for a C example, which seems to work okay. Didn’t try to use it from esphome yet. |
Thanks, I've forked an existing module that solved this for the old board revision and it seems to work. |
a try your code but have a error code a try change jason file but same problem thanks for help Processing obrazovka (board: lilygo-t5-47-plus; framework: arduino; platform: platformio/espressif32 @ 5.3.0)Error: Could not load broken JSON: /config/esphome/.esphome/build/obrazovka/boards/lilygo-t5-47-plus.json |
@startQ341 error indicate that lilygo-t5-47-plus.json file is somehow corrupted. Try to download it from source repository again or check in some online json validator what is problem with that file. |
@lehovec |
Thanks guys for this - it's working perfectly for me now, both screen and battery estimate. Only minor hassle is the lack of partial refresh support but hopefully that will become available eventually. Oh, and it would be nice to be able to disable that blinding blue light with something civilised like
rather than having to contemplate crushing it with pliers! (FWIW it can be done via epd_poweroff_all() apparently) |
Please help me compile for Lilygo 4.7 pro.
|
I managed to get it compiled and flashed with the below. I saved the JSON locally into
|
Has anyone managed to get the Touchscreen component working with this board? I've been using this touch panel on the older v3 boards and I'd like to continue using it on the newer S3 based boards. Unfortunately the interrupt_pin has changed from GPIO13 on the older v3 to GPIO9 on the newer S3 board, and it looks like the Touchscreen Component is fixed at GPIO13, although it requires you to specify the pin in yaml. I've logged an bug report here, just wondering if anyone has found a way to use touch? |
Same problem for me... |
Hi, I got the display working with the following config: esphome:
name: esp-t5-s3
friendly_name: "T5 S3"
platformio_options:
board_build.f_flash: 80000000L
board_upload.flash_size: 16MB
board_build.flash_mode: qio
board_build.psram_type: opi
board_build.partitions: default_16MB.csv
board_build.arduino.memory_type: qio_opi
on_boot:
then:
# read time from external source (connected via I2C)
- pcf85063.read_time
external_components: - source: github://Fabian-Schmidt/esphome-lilygo_t5_47_display
components: ["lilygo_t5_47_s3_display"]
refresh: 0s
- source: github://Fabian-Schmidt/esphome@jesserockz-2023-136-Fabian-Schmidt
components: [ logger ]
esp32:
board: esp32-s3-devkitc-1
framework:
type: arduino
version: latest
logger:
hardware_uart: USB_CDC # USB_CDC # USB_SERIAL_JTAG
i2c:
sda: 18
scl: 17
frequency: 10kHz
scan: false
id: i2c_bus_a
time:
- platform: pcf85063
id: esptime
update_interval: never
binary_sensor:
- platform: gpio
pin:
number: GPIO21
inverted: true
name: "Button 1"
on_press:
- lambda:
// Code here
sensor:
- platform: internal_temperature
id: esptemp
name: "Internal Temperature"
update_interval: 1s
font:
- file: Google_Sans_Bold.ttf
id: font_name
size: 38
display:
- platform: lilygo_t5_47_s3_display
update_interval: 10s
# rotation: 180
# clear: false
full_update_every: 6
# power_off_delay_enabled: false
lambda:
it.printf(100, 100, id(font_name), TextAlign::BASELINE_CENTER, "Hello World"); |
Hi, for my i ok this ....
|
Hello Guys, I wanted to say thanks to everybody who provided help in this thread. However, no matter how hard I tried, I could not manage to establish the connection with the RTC. |
Hey @VladimirV01 Here's what I have
then
I hope that helps? |
Hello @special-k-uk ! Thank you very much for taking the time to check this issue and write an answer. I have followed your advice and checked your configuration. Now I see that it syncs the RTC on time sync with homeassistant, therefore I can be sure it works. |
I managed to piece together a working config for my new board that includes a bunch of the changes, including the display code from @nickolay and battery stuff from @kaeltis (you two should consider merging your work for nickolay/esphome-lilygo-t547plus#3). I also activated the internal temp sensor, and set things to read/write with the internal clock. So far, everything is working great for me with an old LiPo battery I had sitting around (battery sensor is reading 4.5V, which lines up with what it did with the LilyGo firmware). Anyway, here it is for posterity (along with some notes since I just copy/pasted my yaml file here) # See: https://github.com/esphome/feature-requests/issues/1960
# See for older hardware: https://github.com/esphome/feature-requests/issues/1109
esphome:
name: lilygo-t5-eink
friendly_name: LilyGo T5 eInk
platformio_options:
board_build.f_flash: 80000000L
board_upload.flash_size: 16MB
board_build.flash_mode: qio
board_build.psram_type: opi
board_build.partitions: default_16MB.csv
board_build.arduino.memory_type: qio_opi
on_boot:
priority: -100
then:
- pcf8563.read_time
esp32:
board: esp32-s3-devkitc-1
framework:
type: arduino
version: latest
# Enable logging
logger:
# Enable Home Assistant API (API password is deprecated in favor of encryption key)
# https://esphome.io/components/api.html
api:
encryption:
key: !secret home_assistant_encryption_key
ota:
password: !secret ota_password
wifi:
networks:
- ssid: !secret wifi_ssid
password: !secret wifi_password
reboot_timeout: 15min
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Lilygo-T5-Eink Fallback Hotspot"
password: !secret fallback_ssid_password
captive_portal:
external_components:
# https://github.com/nickolay/esphome-lilygo-t547plus
- source: github://nickolay/esphome-lilygo-t547plus
components: ["t547"]
# https://github.com/kaeltis/esphome-lilygo-t547plus
- source: github://kaeltis/esphome-lilygo-t547plus
components: ["lilygo_t5_47_battery"]
#deep_sleep:
# run_duration: 30s
# sleep_duration: 1min
i2c:
- id: bus_a
sda: GPIO18
scl: GPIO17
frequency: 100khz
# There is some problems with i2c scan so turn scan off if problem appear on your board
scan: False
time:
- platform: pcf8563
id: internal_clock
address: 0x51
i2c_id: bus_a
- platform: homeassistant
id: ha_time
on_time_sync:
then:
- pcf8563.write_time
binary_sensor:
- platform: gpio
pin:
number: GPIO21 #was GPIO39 on the previous board
inverted: true
name: "Button 1"
on_press:
- logger.log: PhysButton Pressed
sensor:
- platform: internal_temperature
id: esptemp
name: "Internal Temperature"
update_interval: 1s
- platform: lilygo_t5_47_battery
id: battery_voltage
voltage:
name: "Battery Voltage"
- platform: template
name: "Battery Percentage"
id: battery_percentage
lambda: |-
// tweak values in mapping for calibration
// 4.1 = max voltage
// 3.3 = min voltage
float y = (id(battery_voltage).voltage->state - 3.3) * 100.0 / (4.1 - 3.3);
if (y < 100.0) { return y; } else { return 100.0; };
font:
# https://github.com/hprobotic/Google-Sans-Font/blob/master/
- file: fonts/GoogleSans-Bold.ttf
id: font_1
size: 45
- file: fonts/GoogleSans-Bold.ttf
id: font_2
size: 150
- file: "fonts/GoogleSans-Bold.ttf"
id: font_clock
size: 300
glyphs: [':', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
display:
- platform: t547
update_interval: 60s
# rotation: 180
#clear: true
#full_update_every: 3
#power_off_delay_enabled: true
lambda: |-
it.printf(10, 50, id(font_1), "Battery: %.1f% (%.1fV)", id(battery_percentage).state, id(battery_voltage).voltage->state);
// https://esphome.io/cookbook/display_time_temp_oled.html
it.printf(10, 100, id(font_1), "Internal Temp: %.1f°C", id(esptemp).state);
it.strftime(it.get_width()/2, it.get_height()/2-150, id(font_clock), TextAlign::TOP_CENTER, "%H:%M", id(ha_time).now()); |
Hello, |
Has anyone had such a problem `INFO ESPHome 2023.11.6 esp32: None Please specify flash_size within esp32 configuration only. |
|
Does anyone know where to put the board file in the latest Homeassistant/ESPHome version? The filestruckture seems to be totaly different now. No matter where I place the board json it's not found and the "config" folder is completely missing now :( |
Has this been added to ESPHome yet? Or which route do you need to go? |
After hours of trying to compile something so that I can display anything apart from the default Lilgo start screen, I managed to compile with this code; however it still doesn't update the screen! Am I making any silly mistakes?
|
I tried this but get this compile error:
Any advice? |
I got it to compile simply by adding the following to esphome section:
However, it seems the device is stuck in a boot loop after compiling, the logs are being spammed with:
|
im in the same boat as mdot9, similar error now with my code |
All these hurdles, they'll add to the satisfaction once this thing is installed and working properly! Gotta stay patient and not put my fist through this epaper ahaha. |
its strange because it was working fine before. maybe the latest ESPHome update caused a break. |
this. Need to know, otherwise I am unable to get this board working. |
Do you have root access? It's necessary. Is has to be placed in: /mnt/data/supervisor/addons/data/{addyour}_esphome/build/{devicename}/boards Find some further information here: |
I am going crazy trying to get this to work. I fail at the SPI part at the moment (simply copied the basic.yaml):
Errors:
|
moving the libraries on indentation up fixed it for me (so it's under esphome and not platformio_options. esphome/issues#2911 I also had to do this esphome/issues#6241 |
@dsanner So you are saying you have a working config, without the platform io boards json on your HA install? Would love to get a copy of your config then. :) |
I managed to make my board working with the following configuration :
For reference, with this configuration, I don't need a json file placed in my install. I do have an issue however, the deep sleep consumption is too high. I measure with a PPK2 around 5.5mA when in deep sleep. Would you have any idea to reduce this ? From what I see, I should get something down in the 100µA. |
It won't help you very much, but your config looks similar to mine. I have a run time of 1min and sleep time of 120 mins. The display lasts 1 1/2 months with a small battery. |
Same here. Voltage drop is logged in home assistant and it is way quicker than I was hoping for. Here's my working config. https://github.com/AppForce1/lilygo-t5-47-plus-esphome |
This Reddit post is saying something about pin 13. I plan on trying that soon. |
Tried setting pin 13 high. But that also has the effect of the blue LED on the back of the board staying on. |
I tried reusing your config to measure get back to working config with battery voltage readout, I get stuck at this error:
relevant config:
Any ideas where I'm going wrong? Thanks! |
@Plawasan How is your |
Should be same as yours..
|
hi ! but not the touchscreen and the RTC |
Not sure if this is helpful, but I recently received a v.2.4 board and it took me a while to get the touchscreen working, but the following did it (you can probably remove the "transform" section as that is unique to my setup):
|
it doesn't work. [16:15:26][C][i2c.arduino:071]: I2C Bus: |
ahhh, lol ... what a mistake : i've inverted the SDA and SCL value .. |
and pcf8563 is good with `time:
|
I would like to warn of one thing: with the Touch model, we lose pixels on the edges: 3 on the left, 6 at the top, 10 on the right, and 8 at the bottom |
hi all. |
There's #1109 open for the original T5-4.7 module. This year the vendor introduced a new version of the module, which they call "T5 4.7 Inch E-paper V2.3" or "T5-4.7 Plus".
The vendor advertises the new ESP32-S3 chip and TF-card reader as the major new features, but there are multiple other differences as well. The pinout is incompatible, so any attempts to blindly run examples from #1109 on the new board without first figuring out the differences will fail.
I'll copy the description from the original feature request verbatim, as only the internals of the board are different; the use-case is the same:
The text was updated successfully, but these errors were encountered: