A touchscreen control panel for a Modbus RTU gripper, built on the ESP32-P4 Function EV Board.
This firmware runs an LVGL-based UI on the board's display and drives an electric gripper over RS485 (Modbus RTU) via UART. The screen provides INIT/OPEN/CLOSE buttons plus live sliders for target position and gripping force, with on-screen status feedback.
- Board: ESP32-P4 Function EV Board (
wt99p4c5_s1_boardBSP component) - Display/Touch: built-in LCD with capacitive touch (via BSP)
- Gripper link: RS485 half-duplex, UART1
| Signal | GPIO |
|---|---|
| TXD | 4 |
| RXD | 5 |
| RTS (DE) | 3 |
UART: 115200 baud, Modbus RTU framing, CRC16.
- ESP-IDF (target:
esp32p4) - LVGL for the UI
- FreeRTOS task + queue for async gripper command dispatch (
main.c:WT_gripper_task,g_cmd_queue) - Custom Modbus helpers for register read/write and CRC16 (
WT_modbus_crc16,WT_gripper_write_reg)
- INIT button: sends the gripper initialization command
- OPEN / CLOSE buttons: quick presets
- Position slider: 0 (closed) – 1000 (open)
- Force slider: 0–100%
- Live status label and UART-ready indicator
main/ Application code (UI + gripper control logic)
components/wt99p4c5_s1_board/ Board support package (display, touch, pinouts)
components/bsp_extra/ Extra board support helpers
CMakeLists.txt Top-level build file
sdkconfig Board/project configuration (tracked for reproducible builds)
idf.py set-target esp32p4
idf.py build
idf.py -p <PORT> flash monitor
Requires ESP-IDF >= 5.3.