Has anyone successfully got touch wakeup to work on the Makerfabs 4" screen? After much tinkering, I have the screen and touch screen working, along with a binary touch screen button, but can’t get touch wake up to work. Doesn’t anyone now which pin the touchscreen interrupt pin should be? I think this is what is preventing it from working…
i2c:
- id: bus_a
sda: GPIO17
scl: GPIO18
frequency: 50kHz
spi:
- id: lcd_spi
clk_pin: GPIO12
mosi_pin: GPIO11
touchscreen:
platform: gt911
id: my_touchscreen
display: st7701_display
update_interval: 50ms
address: 0x5D
on_touch:
- logger.log:
format: Touch at (%d, %d)
args: [touch.x, touch.y]
- lambda: |-
ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%0d",
touch.x,
touch.y,
touch.x_raw,
touch.y_raw
);
esphome:
name: train-screen-big
friendly_name: Train Screen Big
platformio_options:
board_build.flash_mode: dio
external_components:
- source: github://clydebarrow/esphome@lvgl
components: [lvgl ]
esp32:
board: esp32-s3-devkitc-1
variant: esp32s3
flash_size: 16MB
framework:
type: esp-idf
sdkconfig_options:
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y"
CONFIG_ESP32S3_DATA_CACHE_64KB: "y"
CONFIG_ESP32S3_DATA_CACHE_LINE_64B: "y"
CONFIG_SPIRAM_FETCH_INSTRUCTIONS: y
CONFIG_SPIRAM_RODATA: y
psram:
mode: octal
speed: 80MHz
deep_sleep:
id: deepsleep1
sleep_duration: 1h
touch_wakeup: True
logger:
api:
encryption:
key: "*****"
ota:
password: "*****"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "Train-Screen-Big"
password: "*****"
sensor:
- platform: homeassistant
entity_id: sensor.gtfs_mta_subway_28th_street_uptown
id: train_uptown_due_in
on_value:
then:
- script.execute: update_display
- platform: homeassistant
entity_id: sensor.gtfs_mta_subway_28th_street_downtown
id: train_downtown_due_in
on_value:
then:
- script.execute: update_display
- platform: homeassistant
entity_id: sensor.gtfs_mta_subway_28th_street_uptown
attribute: Next bus due in
id: train_uptown_next_train_due_in
on_value:
then:
- script.execute: update_display
- platform: homeassistant
entity_id: sensor.gtfs_mta_subway_28th_street_downtown
attribute: Next bus due in
id: train_downtown_next_train_due_in
on_value:
then:
- script.execute: update_display
text_sensor:
- platform: homeassistant
entity_id: sensor.gtfs_mta_subway_28th_street_uptown
attribute: Due at
id: train_uptown_due_at
- platform: homeassistant
entity_id: sensor.gtfs_mta_subway_28th_street_downtown
attribute: Due at
id: train_downtown_due_at
- platform: homeassistant
entity_id: sensor.gtfs_mta_subway_28th_street_uptown
attribute: Next bus
id: train_uptown_next_train_due_at
- platform: homeassistant
entity_id: sensor.gtfs_mta_subway_28th_street_downtown
attribute: Next bus
id: train_downtown_next_train_due_at
- platform: homeassistant
entity_id: sensor.mta_subway_1_service_status
attribute: train_status
internal: false
id: train_status
- platform: homeassistant
entity_id: sensor.train_status_uptown
internal: false
id: train_status_uptown
- platform: homeassistant
entity_id: sensor.train_status_downtown
internal: false
id: train_status_downtown
binary_sensor:
#-------------------------------------------
# GT911 touchscreen sensor
#-------------------------------------------
# - platform: gt911
# name: Screen Press
# internal: false
# on_press:
# - logger.log: "Button pressed"
- platform: touchscreen
name: Screen Button
x_min: 0
x_max: 480
y_min: 0
y_max: 480
internal: false
on_press:
- logger.log: "Screen button pressed"
script:
- id: update_display
then:
- lvgl.label.update:
id: uptown1
text: !lambda |-
static char buf[8];
snprintf(buf, sizeof(buf), "%.0f", id(train_uptown_due_in).state);
return buf;
- lvgl.label.update:
id: uptown2
text: !lambda |-
static char buf[8];
snprintf(buf, sizeof(buf), "%.0f", id(train_uptown_next_train_due_in).state);
return buf;
- lvgl.label.update:
id: downtown1
text: !lambda |-
static char buf[8];
snprintf(buf, sizeof(buf), "%.0f", id(train_downtown_due_in).state);
return buf;
- lvgl.label.update:
id: downtown2
text: !lambda |-
static char buf[8];
snprintf(buf, sizeof(buf), "%.0f", id(train_downtown_next_train_due_in).state);
return buf;
button:
- platform: template
name: "Train Screen Sleep"
icon: "mdi:update"
on_press:
then:
- logger.log: "Entering Deep sleep"
- deep_sleep.enter: deepsleep1
font:
- file: 'fonts/GothamRnd-Bold.ttf'
id: large
size: 130
- file: 'fonts/GothamRnd-Bold.ttf'
id: medium
size: 90
- file: 'fonts/GothamRnd-Bold.ttf'
id: small
size: 36
- file: 'fonts/GothamRnd-Book.ttf'
id: book_small
size: 18
- file: 'fonts/materialdesignicons-webfont.ttf'
id: mdifont
size: 125
extras:
- file: 'materialdesignicons-webfont.ttf'
glyphs: [
"\U000F005D",
"\U000F0045",
"\U000F0CA0",
]
# Include Material Design Icons font
# Thanks to https://community.home-assistant.io/t/display-materialdesign-icons-on-esphome-attached-to-screen/199790/16
- file: 'fonts/materialdesignicons-webfont.ttf'
id: font_mdi_large
size: 60
glyphs:
- "\U000F0026" # mdi-alert
# Include Custom Titles
image:
- file: mdi:numeric-1-circle
id: train
resize: 125x125
- file: mdi:arrow-up
id: up
resize: 100x100
- file: mdi:arrow-down
id: down
resize: 100x100
color:
- id: color_text
red: 50%
green: 0%
blue: 0%
white: 0%
lvgl:
bg_color: 0
default_font: medium
displays:
- display_id: st7701_display
# touchscreens:
# - touchscreen_id: my_touch
pages:
- id: main_page
widgets:
- label:
align: CENTER
text_font: mdifont
y: -160 #negative = higher
x: 0
text: "\U000F0CA0"
- label:
align: CENTER
text_font: mdifont
y: -50 #negative = higher
x: -120
text: "\U000F005D"
- label:
align: CENTER
text_font: mdifont
y: -50 #negative = higher
x: +120
text: "\U000F0045"
- label:
id: uptown1
align: CENTER
text_font: medium
y: 75 #negative = higher
x: -120
text: "-"
- label:
id: uptown2
align: CENTER
text_font: medium
y: 175 #negative = higher
x: -120
text: "-"
- label:
id: downtown1
align: CENTER
text_font: medium
y: 75 #negative = higher
x: 120
text: "-"
- label:
id: downtown2
align: CENTER
text_font: medium
y: 175 #negative = higher
x: 120
text: "-"
display:
- platform: st7701s
id: st7701_display
auto_clear_enabled: false
data_rate: 80MHz
update_interval: never
spi_mode: MODE3
color_order: bgr
dimensions:
width: 480
height: 480
invert_colors: true
# transform:
# mirror_x: true
# mirror_y: true
cs_pin: 1
de_pin: 45
hsync_pin: 5
vsync_pin: 4
pclk_pin: 21
pclk_frequency: 12MHz
data_pins:
red:
- 42 # R1
- 41 # R2
- 40 # R3
- 39 # R4
- 2 # R5
green:
- 48 # G0
- 47 # G1
- 14 # G2
- 9 # G3
- 3 # G4
- 0 # G5
blue:
- 16 # B1
- 15 # B2
- 8 # B3
- 7 # B4
- 6 # B5
captive_portal: