-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathesp32-wrover-044f30.lcd.yaml
More file actions
executable file
·189 lines (159 loc) · 3.87 KB
/
Copy pathesp32-wrover-044f30.lcd.yaml
File metadata and controls
executable file
·189 lines (159 loc) · 3.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# LCD zamiast kamery
# esptool.py v4.7.0
# Serial port /dev/ttyUSB0
# Connecting....
# Chip is ESP32-D0WDQ6 (revision v1.0)
# Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
# Crystal is 40MHz
# MAC: 40:22:d8:04:4f:30
# Uploading stub...
# Running stub...
# Stub running...
# Changing baud rate to 460800
# Changed.
# Configuring flash size...
# Auto-detected Flash size: 4MB
# Flash will be erased from 0x00010000 to 0x00103fff...
substitutions:
device_name: esp32-wrover-044f30
domain: !secret DOMAIN
lvgl_buffer_size: 100%
<<: !include include.lcd-touch.yaml
esphome:
name: "esp32-wrover-044f30"
esp32:
board: esp-wrover-kit # has PSRAM
framework:
type: arduino
psram:
mode: octal
speed: 80MHz
# Enable logging
logger:
# level: ERROR
logs:
component: ERROR
debug:
update_interval: 5s
# generic services
time:
- platform: sntp
timezone: "Europe/Warsaw"
id: sntp_time
servers:
- bagno
- bagno.${domain}
- pl.pool.ntp.org
web_server:
port: 80
ota:
platform: esphome
password: "dai3ahGha7phu8ChoQuohQue"
wifi:
ssid: !secret WIFI_SSID
password: !secret WIFI_PASSWORD
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "${device_name}"
password: !secret WIFI_AP_PASSWORD
captive_portal:
button:
- platform: restart
name: "${device_name} Restart"
# web ui info
text_sensor:
- platform: version
name: "ESPHome Version ${device_name}"
- platform: debug
device:
name: "Device Info"
reset_reason:
name: "Reset Reason"
- platform: wifi_info
ip_address:
name: "IP Address ${device_name}"
ssid:
name: "Connected SSID ${device_name}"
bssid:
name: "Connected BSSID ${device_name}"
mac_address:
name: "Mac Wifi Address ${device_name}"
- platform: version
name: "ESPHome Version ${device_name}"
i2c:
sda: GPIO21 # TP_SDA
scl: GPIO22 # TP_SCL
spi:
clk_pin: GPIO18 # SCLK
mosi_pin: GPIO23 # MOSI
# miso_pin: GPIO19 # MISO do not connect to anything
output:
- id: lcd_brightness
platform: ledc
pin: GPIO5 # LCD_BL
light:
- platform: monochromatic
id: backlight
name: "LCD backlight"
output: lcd_brightness
initial_state:
state: on
brightness: 60%
restore_mode: ALWAYS_ON
display:
- platform: ili9xxx
model: GC9A01A
auto_clear_enabled: false
update_interval: never
id: touch_display
cs_pin: GPIO26 # LCD_CS
dc_pin: GPIO25 # LCD_DC
reset_pin: GPIO4 # LCD_RST
invert_colors: true
dimensions:
height: 240
width: 240
# show_test_card: true
data_rate: 80MHz
spi_mode: MODE3
touchscreen:
platform: cst816
id: touch_surface
interrupt_pin: GPIO34 # TP_INT
reset_pin: GPIO027 # TP_RST
touch_timeout: 1000ms # prevent touch event flood?
on_release:
- if:
condition: lvgl.is_paused
then:
- lvgl.resume:
- lvgl.widget.redraw:
- globals.set:
id: backlight_percent
value: '80'
- light.turn_on:
id: backlight
brightness: !lambda return (id(backlight_percent) / 100.0);
script:
- id: display_reprocess
then:
- logger.log:
format: "display_reprocess triggered: backlight_percent=%d"
args: [ 'id(backlight_percent)' ]
- if:
condition:
lambda: 'return id(backlight_percent) == 0;'
then:
- logger.log: lvgl paused
- lvgl.pause: # stop updating display if brightness is off
- light.turn_off:
id: backlight
else:
- light.turn_on:
id: backlight
brightness: !lambda return (id(backlight_percent) / 100.0);
- if:
condition: lvgl.is_paused
then:
- lvgl.resume:
- lvgl.widget.redraw: