Skip to content

chuacb/resin_hopper_ws_lcd_fw

Repository files navigation

Resin Hopper WS LCD4 (ESP32-S3)

Target board: Waveshare ESP32-S3 Touch LCD 4 (V4.0). citeturn2view0

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). citeturn2view0turn1view0
LVGL QR code APIs are from LVGL 9.1 docs. citeturn0search3turn0search7

Validated hardware assumptions (this workspace)

  • 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 0x14 on touch bus (I2C port 0)
    • TCA9554 expander detected at 0x24 and can be shared on touch bus
  • Runtime fallback behavior:
    • If expander or touch is unavailable, firmware continues to boot (features degrade gracefully)

1) Development environment (Windows + PowerShell)

Prereqs

  • ESP-IDF v5.5+ installed (your earlier setup uses 5.5.2).
  • VS Code + Espressif IDF extension (recommended).

Build/flash commands (PowerShell)

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 monitor

Important rule (as you requested): every idf.py command above shows the shell (PowerShell) and the directory via -C ..


2) Managed components (auto-fetched)

This project uses ESP-IDF managed components:

  • lvgl/lvgl
  • espressif/esp_lcd_st7701 (LCD controller used on this board) citeturn0search13turn2view0
  • espressif/esp_lcd_touch_gt911 (touch controller used on this board) citeturn0search13turn2view0

ESP-IDF will download these automatically on build.


3) Features / modes

Demo mode (recommended first)

  • No Modbus, no Wi‑Fi required
  • Values are simulated
  • UI behavior and timers can be tested quickly

Live mode

  • Reads registers/booleans via Modbus RTU (RS485)
  • Optional Wi‑Fi + NTP + OTA + Web config

4) Configuration (central + runtime)

Compile-time (menuconfig)

  • Enable/disable: Demo Mode, Modbus, Wi‑Fi, OTA, Web Config
  • Timeouts, refresh periods
  • Modbus UART/baud/addr & byte swap
  • Colors (alarm/level bands)

Runtime (NVS + Web Config)

  • Wi‑Fi SSID/password (stored in NVS, loaded on boot)
  • Optional OTA URL
  • Web config login/password (basic auth)

5) Project layout (generic, reusable)

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.


6) What to edit first (incremental workflow)

  1. UI only: keep DEMO_MODE=y, build, verify pages/nav/QR/level colors.
  2. Enable Modbus and point the register map in components/app_modbus/app_modbus_map.h.
  3. Enable Wi‑Fi + NTP.
  4. Enable OTA.
  5. Enable Web Config.

7) Register map

Edit:

  • components/app_modbus/app_modbus_map.h

This project intentionally does not validate values (per your requirement). It just reads, stores, and displays.


8) Troubleshooting quick hits

  • 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.

License

MIT for the project glue code (your application). Managed components have their own licenses.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors