Target board: Waveshare ESP32-S3 Touch LCD 4 (V4.0). citeturn2view0
This is a fully working reference project (ESP-IDF) for your Resin Hopper HMI:
- LVGL UI with 3-page navigation bar (Main / Alarm / Details)
- Main page shows QR + key fields and level color bands
- Alarm page shows state + timestamped events + buzzer
- Detail page shows last-change timestamps
- Modbus RTU Master (RS485) or Demo Mode
- Wi‑Fi client + NVS credential storage
- NTP time sync
- OTA update over Wi‑Fi
- Web configuration (basic auth)
Notes on board peripherals and wiring come from the Waveshare wiki (including RS485 pins and IO expander signals like BEE_EN for buzzer enable). citeturn2view0turn1view0
LVGL QR code APIs are from LVGL 9.1 docs. citeturn0search3turn0search7
- Board: Waveshare ESP32-S3 Touch LCD 4 (ESP32-S3 + ST7701 + GT911 + TCA9554)
- Flash: 16MB (
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y) - Partition table:
two_ota_large(two OTA app slots) - I2C behavior on tested board revision:
- GT911 touch detected at
0x14on touch bus (I2C port 0) - TCA9554 expander detected at
0x24and can be shared on touch bus
- GT911 touch detected at
- Runtime fallback behavior:
- If expander or touch is unavailable, firmware continues to boot (features degrade gracefully)
- ESP-IDF v5.5+ installed (your earlier setup uses 5.5.2).
- VS Code + Espressif IDF extension (recommended).
Shell: Windows PowerShell
Working directory: the project root (this folder)
# 1) Go to project
cd D:\src\espidf_proj\resin_hopper_ws_lcd4
# 2) Ensure ESP-IDF environment is activated (example)
# If you use Espressif's "ESP-IDF PowerShell" shortcut, skip this line
. D:\Espressif\frameworks\esp-idf-v5.5.2\export.ps1
# 3) Set target (one time)
idf.py -C . set-target esp32s3
# 4) Configure (menuconfig)
idf.py -C . menuconfig
# 5) Build + flash + monitor
idf.py -C . build
idf.py -C . -p COM12 flash monitorImportant rule (as you requested): every idf.py command above shows the shell (PowerShell) and the directory via -C ..
This project uses ESP-IDF managed components:
lvgl/lvglespressif/esp_lcd_st7701(LCD controller used on this board) citeturn0search13turn2view0espressif/esp_lcd_touch_gt911(touch controller used on this board) citeturn0search13turn2view0
ESP-IDF will download these automatically on build.
- No Modbus, no Wi‑Fi required
- Values are simulated
- UI behavior and timers can be tested quickly
- Reads registers/booleans via Modbus RTU (RS485)
- Optional Wi‑Fi + NTP + OTA + Web config
- Enable/disable: Demo Mode, Modbus, Wi‑Fi, OTA, Web Config
- Timeouts, refresh periods
- Modbus UART/baud/addr & byte swap
- Colors (alarm/level bands)
- Wi‑Fi SSID/password (stored in NVS, loaded on boot)
- Optional OTA URL
- Web config login/password (basic auth)
resin_hopper_ws_lcd4/
main/
app_main.c
components/
app_config/
app_hal_ws_lcd4/
app_model/
app_modbus/
app_ui/
app_wifi/
app_time/
app_ota/
app_webcfg/
app_log/
Hardware-dependent code is isolated in app_hal_ws_lcd4/.
To port to another board, replace only that component + pins.
- UI only: keep
DEMO_MODE=y, build, verify pages/nav/QR/level colors. - Enable Modbus and point the register map in
components/app_modbus/app_modbus_map.h. - Enable Wi‑Fi + NTP.
- Enable OTA.
- Enable Web Config.
Edit:
components/app_modbus/app_modbus_map.h
This project intentionally does not validate values (per your requirement). It just reads, stores, and displays.
- If UI flickers: the UI module updates only on change, and uses LVGL invalidation minimally.
- If touch doesn’t show nav bar: touch events are handled globally; nav bar is shown on any touch and stays active on every page.
MIT for the project glue code (your application). Managed components have their own licenses.