RemoteWebViewServer icon indicating copy to clipboard operation
RemoteWebViewServer copied to clipboard

Waveshare ESP32-S3-Touch-LCD-7B - No touch

Open DJSmile-T opened this issue 4 months ago • 7 comments

Touch detected correctly on-device, but not forwarded to server / page (no reaction at all)

Board / display setup

Board: Waveshare ESP32-S3-Touch-LCD-7B (1024x600, ESP32-S3-WROOM-1-N16R8) Display driver: rpi_dpi_rgb (not mipi_rgb, since this board isn't a built-in supported model) IO expander: waveshare_io_ch32v003 (from PR #10071, since this board uses the CH32V003 chip, not CH422G) Touchscreen: gt911, address 0x5D, interrupt on GPIO4, reset via IO expander EXIO1 remote_webview version: latest from github://strange-v/RemoteWebViewClient@main ESPHome version: 2026.7.0

What works

Display renders correctly, frames decode and update fine (confirmed via rwv_decode logs, tile sizes/timings all normal). Touch is detected correctly at the hardware/ESPHome level. Using a temporary debug on_touch: handler on the touchscreen: block, tapping the same physical button consistently logs the same coordinates, e.g.:

TOUCH x=111 y=48 TOUCH x=115 y=46 TOUCH x=120 y=45

These coordinates correctly correspond to the on-screen button location (top-left menu area).

What doesn't work

Tapping the screen produces no reaction whatsoever on the remote page. No navigation, no highlight, nothing. Confirmed via Chrome DevTools (chrome://inspect) connected to the RemoteWebViewServer's debug port while tapping the physical screen: zero visible reaction on the inspected tab (no element highlight, no click event, no navigation) at the moment of tapping. This persists even with only one touchscreen: defined in the YAML (so implicit binding should apply), and also after explicitly setting touchscreen_id: <my_touchscreen_id> on the remote_webview: block — no change in behavior either way. Ruled out a possible conflict from a custom on_touch: debug logger on the touchscreen component — removed it entirely, issue persists. Ruled out a boot/rollback issue — confirmed clean successful boots (no "OTA rollback" warnings) with the current firmware, touch still not forwarded.

Config (relevant excerpts)

yamltouchscreen: platform: gt911 id: waveshare_touch interrupt_pin: GPIO4 i2c_id: bus_a reset_pin: waveshare_io_ch32v003: wave_io number: 1 mode: OUTPUT transform: mirror_x: false mirror_y: false

remote_webview: id: bfl touchscreen_id: waveshare_touch server: SERVER url: URL full_frame_tile_count: 1 jpeg_quality: 65 max_bytes_per_msg: 131072 big_endian: 1 rotation: 0

Question Is touch forwarding known to work on non-square / higher-resolution displays (this is 1024x600, versus the 480x480 panel used in the README example)? Or is there a known issue with touch coordinate scaling/forwarding on rpi_dpi_rgb-based setups specifically? Happy to provide more logs, try a patched build, or test anything else — display/frame streaming itself works perfectly, it's purely the touch-forwarding path that seems to be a no-op in this setup.

DJSmile-T avatar Jul 18 '26 11:07 DJSmile-T

I haven't heard about touch issues. It for sure works on non-square displays. Try touching in different spots, maybe you have an orientation issue.

strange-v avatar Jul 25 '26 06:07 strange-v

I have the same device, working with ESPHome, and it works perfectly well with touch. I don't get from your question what system you use, so if you would like to, I can share my yaml for the device. It's also not a remote webview issue, but a Waveshare issue.

hans-martijn avatar Aug 28 '26 12:08 hans-martijn

I have the same device, working with ESPHome, and it works perfectly well with touch. I don't get from your question what system you use, so if you would like to, I can share my yaml for the device. It's also not a remote webview issue, but a Waveshare issue.

If you could share it with me it would be great. Im using a esphome config with a simple template with entities from home assitant to show information.

DJSmile-T avatar Aug 28 '26 13:08 DJSmile-T

ok, here it is (sorry, I pasted it in the code part, but obviously that didn't work):

`# =====================================

=== WAVESHARE 7" vers B 1024x600 ===

=====================================

substitutions: name: "cc-screen" friendly_name: "Captains cabin HA screen" project_name: "ha.remote" project_version: "1.0.0"

esp32: board: esp32-s3-devkitc-1 variant: ESP32S3 cpu_frequency: 240MHz flash_size: 16MB framework: type: esp-idf # --- Overclock Flash & PSRAM to 120MHz --- # advanced: # enable_idf_experimental_features: true sdkconfig_options: # --- Performance System --- CONFIG_FREERTOS_HZ: "1000" CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240: "y" CONFIG_ESP32S3_DATA_CACHE_16KB: "n" CONFIG_ESP32S3_DATA_CACHE_32KB: "n" CONFIG_ESP32S3_DATA_CACHE_64KB: "y" # Max cache for Octal PSRAM CONFIG_ESP32S3_DATA_CACHE_LINE_64B: "y" # Cache alignment CONFIG_SPIRAM_MODE_OCT: "y" # PSRAM in Octal mode CONFIG_ESPTOOLPY_FLASHMODE_QIO: "y" # Flash in QIO mode

  # --- Compiler Optimization ---
  CONFIG_COMPILER_OPTIMIZATION_PERF:      "y"             # Compile for speed instead of size
  
  # --- Memory Placement ---
  CONFIG_SPIRAM_FETCH_INSTRUCTIONS:       "y"             # Move non-critical code to PSRAM to free IRAM for LVGL
  CONFIG_SPIRAM_RODATA:                   "y"             # Place read-only data (like fonts/images) in PSRAM
  
  # --- LVGL Specific ---
  CONFIG_LV_MEM_CUSTOM:                   "y"             # Delegate LvGL memory allocation to ESP-IDF/FreeRTOS
  CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM:  "y"             # Use IRAM for LVGL drawing functions
  CONFIG_LV_MEMCPY_MEMSET_STD:            "y"             # Use ESP hardware-optimized memcpy/memset
  
  # --- Multicore Affinity ---
  CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1:     "y"             # Move main loop (and LVGL) to Core 1

  # --- Overclock Flash & PSRAM to 120MHz ---
  # CONFIG_IDF_EXPERIMENTAL_FEATURES:      "y"
  # CONFIG_ESPTOOLPY_FLASHFREQ_120M:       "y"
  # CONFIG_SPIRAM_SPEED_120M:              "y"
components:
  - name: "espressif/esp_websocket_client"
    ref: 1.5.0
  - name: "espressif/esp-dsp"
    ref: 1.7.0
  - name: "bitbank2/jpegdec"
    source: https://github.com/strange-v/jpegdec-esphome

psram: mode: octal speed: 80MHz

================================================================

WiFi

================================================================

wifi: ssid: !secret wifi_ssid # Defined in secrets.yaml password: !secret wifi_password # Defined in secrets.yaml fast_connect: true

api: encryption: key: !secret api_key

ota:

  • platform: esphome # Your existing OTA method

i2c: sda: GPIO8 scl: GPIO9 scan: true frequency: 400khz id: bus_a

esphome: name: "${name}" friendly_name: "${friendly_name}" project: name: "${project_name}" version: "${project_version}" platformio_options: #board_upload.maximum_ram_size: 524288 build_flags: - "-DBOARD_HAS_PSRAM" - "-DLV_CONF_INCLUDE_SIMPLE" - "-DLV_USE_CHART=1" # Ottimizzazione LVGL per Frame Rate - "-DLV_MEM_CUSTOM=1" - "-DLV_MEMCPY_MEMSET_STD=1" #- "-DCONFIG_IDF_EXPERIMENTAL_FEATURES=1"

#board_build.f_flash: 120000000L
board_build.f_flash: 80000000L  
board_build.flash_mode: qio      
board_build.arduino.memory_type: qio_opi

on_boot: then: - script.execute: reset_display_timeout

logger:

level: DEBUG # WARNING for production units

baud_rate: 0 # Disable debug on serial port

external_components:

  • source: type: git url: https://github.com/fuzzybear62/esphome-waveshare_io_ch32v003 ref: main components: [ waveshare_io_ch32v003 ]
  • source: github://strange-v/RemoteWebViewClient@main refresh: 0s components: [remote_webview]

waveshare_io_ch32v003: id: waveshare_io_hub i2c_id: bus_a address: 0x24

output:

  • platform: waveshare_io_ch32v003 id: wave_io_pwm_output inverted: true zero_means_zero: true waveshare_io_ch32v003_id: waveshare_io_hub safe_pwm_levels: min_value: 0 max_value: 247

light:

  • platform: monochromatic output: wave_io_pwm_output name: "Display Backlight" icon: mdi:lightbulb-on id: display_backlight restore_mode: ALWAYS_ON default_transition_length: 0ms

touchscreen: platform: gt911 id: main_touch display: main_display i2c_id: bus_a interrupt_pin: GPIO4 reset_pin: waveshare_io_ch32v003: waveshare_io_hub number: 1 mode: OUTPUT

on_touch: - script.execute: reset_display_timeout # Reset screen timeout on touch - light.turn_on: id: display_backlight brightness: 95%

#-------------------------------------------

Display

#------------------------------------------- display:

  • platform: rpi_dpi_rgb id: main_display update_interval: never auto_clear_enabled: false color_order: RGB pclk_frequency: 30MHZ dimensions: width: 1024 height: 600 de_pin: number: 5 hsync_pin: number: 46 ignore_strapping_warning: true vsync_pin: number: 3 ignore_strapping_warning: true pclk_pin: 7 pclk_inverted: true reset_pin: waveshare_io_ch32v003: waveshare_io_hub number: 3 hsync_back_porch: 152 hsync_front_porch: 48 hsync_pulse_width: 162 vsync_back_porch: 13 vsync_front_porch: 3 vsync_pulse_width: 45 data_pins: red: - 1 #r3 - 2 #r4 - 42 #r5 - 41 #r6 - 40 #r7 blue: - 14 #b3 - 38 #b4 - 18 #b5 - 17 #b6 - 10 #b7 green: - 39 #g2 - 0 #g3 - 45 #g4 - 48 #g5 - 47 #g6 - 21 #g7

switch:

  • platform: gpio name: "Backlight Switch" id: backlight_switch internal: true
    pin: waveshare_io_ch32v003: waveshare_io_hub number: 2 mode: OUTPUT restore_mode: ALWAYS_ON

================================================================

Script to turn off display backlight after inactivity

================================================================

script:

  • id: reset_display_timeout mode: restart then:
    • delay: 30s
    • light.turn_on: id: display_backlight brightness: 5%

================================================================

RemoteWebView — renders HA dashboard remotely and streams to display

================================================================

remote_webview: id: rwv display_id: main_display touchscreen_id: main_touch device_id: cc-screen server: "192.168.0.10:8181" # Replace with your server hostname or IP url: "http://hass:8123/cc-screen" # Replace with your HA dashboard URL tile_size: 32 full_frame_tile_count: 4 full_frame_area_threshold: 0.50 full_frame_every: 50 every_nth_frame: 1 min_frame_interval: 600 jpeg_quality: 85 max_bytes_per_msg: 61440

================================================================

Expose the dashboard URL as a Home Assistant text entity

================================================================

text:

  • platform: template id: rwv_url name: "Dashboard URL" optimistic: true mode: TEXT set_action:
    • lambda: |- if (!id(rwv).open_url(std::string(x.c_str()))) { id(rwv).set_url(std::string(x.c_str())); ESP_LOGI("remote_webview", "URL queued (not connected): %s", x.c_str()); }`

If the screen stays black, but with a backlight, simply take power off it for 10 seconds and then it works.

hans-martijn avatar Aug 28 '26 15:08 hans-martijn

Thank you for this, tested it and came to the same conclusion. The touch was not working :-( After more trouble shooting i came to the conclusion with alot of "spare" time that it was not the code and not the remotewebview but it was the browsermod....

So i disabled browser mod for this screen and everything is working fine now. Thank you @hans-martijn for thinking along with me and sharing your nice code!

DJSmile-T avatar Aug 30 '26 20:08 DJSmile-T

I had the same problem. If you use browser-mod, then it overlays an input which completely blocks HA. See https://github.com/thomasloven/hass-browser_mod/issues/1389. The workaround is to inject a javascript which closes the browser-mod user interaction, and since I don't have any media on any HA webpage, I use this script globally.

hans-martijn avatar Sep 22 '26 11:09 hans-martijn

Hi, the method to use Browser Mod without interaction is to disable the Media Player for the Device. This is done in Browser Mod integration in Devies and Settings. Select the browser/device. Find the Media Player entity and disable it. No user interaction settings at all will be rendered for the browser/device one the Media Player is disabled.

dcapslock avatar Sep 22 '26 12:09 dcapslock