-
Notifications
You must be signed in to change notification settings - Fork 26
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. |
I finally looked into how this works, because I couldn't understand why I can't use an absolute path for the Details for the curious:
In other news:
|
Thank you everyone for your help getting this set up... one thing that I can't seem to figure out is how to set up external buttons. I was able to get one set up on GPIO 15 using the pins in the molex connector, but can't seem to get another working on any of the other pins. The FAQ says that 12, 13, 14 and 15 should be available if not using the touch screen, but I can't seem to figure out how to physically connect the button to the board. I thought I could use the 40 pin connector, but I tested each pin and none seem to produce a response when I use:
I'm sure I'm missing something simple, but if anyone has an idea I would appreciate it. |
Trying to get homeassistant dashboard working on T5 ESP32-3. Keep getting esptime error. Anyone know how to fix this ?
|
Is it possible that the bit that goes:
Is throwing the proverbial wrench in the gears? Not sure if this is of any help, but the following works for me:
Cheers |
Did anyone get the touchscreen to work?
and
|
@xxLeoxx93 i foud a working solution for the touchscreen
|
@alexwide |
Hi,
What to do now? |
@dxdr You're doing better than me. Can you share an image of how you hooked things up to the molex connector? I was trying for capacitive touch that the S3 is supposed to support (I got as far as filing a bug: Xinyuan-LilyGO/LilyGo-EPD47#113) but at this point I'd love even a single external button. |
|
Im suddenly getting this error too now when trying to compile. Any solutions ? |
wrong board? must be "lilygo-t5-47-plus" |
Hi, Is posible to buy only new screen - without S3 board? |
No problem with my display after more than a year at all, but I have a refresh rate of 20 minutes. The board is basically just a bunch of different manufacturer components got together, so if you find just a display it is easy to change it. |
I can’t get my display to work :-(
I added in and that is my code
|
Ok, now I tried from And now I got this failure:
|
If this is of any help, this is the start of my code:
Then just need to add in your display info eg:
|
Its not working.
|
OK - I don't understand where: Is coming from. My guess is you are using different external components or have left it in your platformio_options. Can you post your code? Otherwise just start with the example bare code I provided above and go from there. :-) |
Here:
|
Ok, so just for the heck of it - given that your code currently is not compiling for you, I'd suggest just remove your current esphome and esp32 sections and try the following:
Once you get it working, you can tweak it later to better suit your requirements. |
hmm,
|
Do a 'clean build' first and try again.... |
Hurray, Thank you very much for the tip. |
Hi, is there a way to refresh partially ? Or to have a less "aggressive" refresh, when it's blinking 3 times ? Thanks |
|
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? |
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: