hello, can anyone help me please?
i found no solution for a working touchsreen.
wifi is always off when i configure a touchsreen: section
esphome:
name: zentraleinheit02
friendly_name: zentraleinheit02
esp32:
board: esp32-p4-evboard
flash_size: 16MB
framework:
type: esp-idf
advanced:
enable_idf_experimental_features: true
#
external_components:
- source: github://pr#11226
components: [display, mipi, mipi_spi]
refresh: 1h
esp32_hosted:
variant: esp32c6
active_high: true
clk_pin: GPIO12
cmd_pin: GPIO13
d0_pin: GPIO11
d1_pin: GPIO10
d2_pin: GPIO9
d3_pin: GPIO8
reset_pin: GPIO15
slot: 1
logger:
hardware_uart: USB_SERIAL_JTAG
level: DEBUG
psram:
mode: hex
speed: 200MHz
i2c:
- id: bus_int
sda: GPIO31
scl: GPIO32
frequency: 400kHz
pi4ioe5v6408:
- id: pi4ioe1
address: 0x43
# 0: O - wifi_antenna_int_ext
# 1: O - speaker_enable
# 2: O - external_5v_power
# 3: NC
# 4: O - lcd reset
# 5: O - touch panel reset
# 6: O - camera reset
# 7: I - headphone detect
- id: pi4ioe2
address: 0x44
# 0: O - wifi_power
# 1: NC
# 2: NC
# 3: O - usb_5v_power
# 4: O - poweroff pulse
# 5: O - quick charge enable (inverted)
# 6: I - charging status
# 7: O - charge enable
switch:
- platform: gpio
id: wifi_power
name: "WiFi Power"
pin:
pi4ioe5v6408: pi4ioe2
number: 0
restore_mode: ALWAYS_ON
- platform: gpio
id: usb_5v_power
name: "USB Power"
pin:
pi4ioe5v6408: pi4ioe2
number: 3
- platform: gpio
id: quick_charge
name: "Quick Charge"
pin:
pi4ioe5v6408: pi4ioe2
number: 5
inverted: true
- platform: gpio
id: charge_enable
name: "Charge Enable"
pin:
pi4ioe5v6408: pi4ioe2
number: 7
- platform: gpio
id: wifi_antenna_int_ext
pin:
pi4ioe5v6408: pi4ioe1
number: 0
- platform: gpio
id: speaker_enable
name: "Speaker Enable"
pin:
pi4ioe5v6408: pi4ioe1
number: 1
restore_mode: ALWAYS_ON
- platform: gpio
id: external_5v_power
name: "External 5V Power"
pin:
pi4ioe5v6408: pi4ioe1
number: 2
binary_sensor:
- platform: gpio
id: charging
name: "Charging Status"
pin:
pi4ioe5v6408: pi4ioe2
number: 6
mode: INPUT_PULLDOWN
- platform: gpio
id: headphone_detect
name: "Headphone Detect"
pin:
pi4ioe5v6408: pi4ioe1
number: 7
select:
- platform: template
id: wifi_antenna_select
name: "WiFi Antenna"
options:
- "Internal"
- "External"
optimistic: true
on_value:
- if:
condition:
lambda: return i == 0;
then:
- switch.turn_off: wifi_antenna_int_ext
else:
- switch.turn_on: wifi_antenna_int_ext
sensor:
- platform: ina226
address: 0x41
adc_averaging: 16
max_current: 8.192A
shunt_resistance: 0.005ohm
bus_voltage:
id: battery_voltage
name: "Battery Voltage"
current:
id: battery_current
name: "Battery Current"
# Positive means discharging
# Negative means charging
# Tab5 built-in battery discharges from full (8.23 V) to shutdown threshold (6.0 V)
- platform: template
name: "Battery Percentage"
lambda: |-
float voltage = id(battery_voltage).state;
// Adjust these values based on your battery's actual min/max voltage
float min_voltage = 6.0; // Discharged voltage
float max_voltage = 8.23; // Fully charged voltage
float percentage = (voltage - min_voltage) / (max_voltage - min_voltage) * 100.0;
if (percentage > 100.0) return 100.0;
if (percentage < 0.0) return 0.0;
return percentage;
update_interval: 60s
unit_of_measurement: "%"
accuracy_decimals: 1
touchscreen:
- platform: gt911
interrupt_pin: GPIO23
update_interval: never
reset_pin:
pi4ioe5v6408: pi4ioe1
number: 5
calibration:
x_min: 0
x_max: 720
y_min: 0
y_max: 1280
id: touch
esp_ldo:
- voltage: 2.5V
channel: 3
display:
- platform: mipi_dsi
dimensions:
height: 1280
width: 720
model: M5Stack-Tab5
reset_pin:
pi4ioe5v6408: pi4ioe1
number: 4
show_test_card: true
output:
- platform: ledc
pin: GPIO22
id: backlight_pwm
frequency: 1000Hz
light:
- platform: monochromatic
output: backlight_pwm
name: "Display Backlight"
id: backlight
restore_mode: RESTORE_DEFAULT_ON
default_transition_length: 250ms
[C][component:173]: Setup template.sensor took 0ms
[14:18:11.673][C][component:173]: Setup ledc.output took 0ms
[14:18:11.674][D][light:089]: ‘Display Backlight’ Setting:
[14:18:11.675][D][light:095]: Color mode:
[14:18:11.675][D][light:102]: State: ON
[14:18:11.676][D][light:077]: Brightness: 100%
[14:18:11.676][C][component:173]: Setup light took 3ms
[14:18:11.677][C][component:173]: Setup psram took 0ms
[14:18:11.678][C][component:173]: Setup ina226.sensor took 2ms
[14:18:11.681][C][component:173]: Setup touchscreen took 2ms
[14:18:11.731][D][esp-idf:000]: E (1602) i2c.master: I2C hardware NACK detected
[14:18:11.732][D][esp-idf:000]: E (1603) i2c.master: I2C transaction unexpected nack detected
[14:18:11.732][D][esp-idf:000]: E (1604) i2c.master: s_i2c_synchronous_transaction(945): I2C transaction failed
[14:18:11.733][D][esp-idf:000]: E (1605) i2c.master: i2c_master_execute_defined_operations(1401): I2C transaction failed
[14:18:11.734][D][esp-idf:000]: E (1606) i2c.master: I2C hardware NACK detected
[14:18:11.735][D][esp-idf:000]: E (1606) i2c.master: I2C transaction unexpected nack detected
[14:18:11.736][D][esp-idf:000]: E (1607) i2c.master: s_i2c_synchronous_transaction(945): I2C transaction failed
[14:18:11.737][D][esp-idf:000]: E (1608) i2c.master: i2c_master_execute_defined_operations(1401): I2C transaction failed
[14:18:11.737][E][component:314]: touchscreen set Error flag: Communication failed
[14:18:11.738][E][component:211]: touchscreen was marked as failed
[14:18:11.854][D][sensor:131]: ‘Battery Percentage’: Sending state nan % with 1 decimals of accuracy
[14:18:12.742][D][esp32.preferences:149]: Writing 1 items: 1 cached, 0 written, 0 failed
[14:18:15.697][D][sensor:131]: ‘Battery Voltage’: Sending state 7.75625 V with 2 decimals of accuracy