Skip to content

ESP3D-X Repository Overview

ESP3D-X is an ESP-IDF 5.x firmware project for a touchscreen CNC pendant running on ESP32/ESP32-S3 hardware. It provides a multi-transport, multi-firmware-target pendant UI for CNC machines controlled by FluidNC, grbl, or grblHAL. The firmware handles real-time GCode streaming, machine status display, jog control, probing, file management, and remote access — all on a single constrained MCU with no external PSRAM on the primary target board.


ESP32 / ESP32-S3 Target

Host / Developer Machine

Storage & Configuration

main/modules/filesystem/

Network & Web Services

main/modules/network/

CNC Firmware Integration

main/modules/gcode_host/ · main/target/

UI Framework & Screens

main/display/

Core Platform & Infrastructure

main/core/ · components/esp3d_log/

Board Support Package

boards/*/components/bsp/

idf.py build / flash

UART bytes

Communication Transports

main/modules/

Serial UART

BT SPP

BT BLE GATT

USB Serial OTG

Socket TCP

WebSocket Client

Hardware Peripheral Drivers

hardware/

Display drivers

SPI · I80 · RGB

Touch drivers

FT5x06 · FT6336U · GT911 · XPT2046

Physical inputs

Buttons · Encoder · Switch · Potentiometer

Buzzer

LEDC PWM

Build & Development Tools

tools/ · build_scripts/

ui_studio · fw_simulator · comm clients

board_init.c

Display · Touch · LVGL tick

Buttons · Encoder · Potentiometer

app_main → ESP3DX::begin()

ESP3DSettings (NVS)

ESP3DValues

Observable pub/sub bus

ESP3DCommands

[ESPxxx] handlers

esp3d_log

Macros · Backends · Hooks

ESP3DTranslationService

LNG1 binary blobs

UIManager · ESP3DXUi

tft_ui_task (Core 1)

Theme system

26 semantic tokens · 4 themes

esp3d_resources

Flash partition XIP

Reusable components

CircularMenu · ListMenu

Panel · VirtualButtons · Keyboard

Screens

Splash · Main · Jog · Status

Files · Probe · Settings · …

CNC-specific UI

cnc/fluidnc · cnc/grbl · cnc/grblhal

ESP3DGCodeHostService

Dual queue · State machine

Flow control gates

ESP3DGCodeHandlerService

FluidNC / grbl / grblHAL

Protocol parser

gcodeHostFlow*

Ok credit · Planner · RX window

ESP3DWifiClient

STA · AP

HTTP Server

WebUI · Files · WebDAV

WebSocket Server

WebUI · Data stream

mDNS

SSDP / UPnP

Flash FS

/fs (FAT or LittleFS)

SD Card

/sd (SPI or SDIO)

Update Service

Boot-time SD update

Config File

INI parser

CNC Controller

FluidNC · grbl · grblHAL

Log Backends

SD · UART2 · Telnet · WebSocket


streamTask (Core 0)networkTask (Core 0)tft_ui_task (Core 1)board_init()ESP3DX::begin()app_main (Core 0)ESP-IDF RuntimestreamTask (Core 0)networkTask (Core 0)tft_ui_task (Core 1)board_init()ESP3DX::begin()app_main (Core 0)ESP-IDF Runtimeloop[Every LVGL tick (Core 1)]app_main()ESP3DX::begin()esp3d_log_init()nvs_flash_init()board_init() - display · touch · LVGL tickESP3DSettings::validate / reset NVSESP3DValues::initialize()ESP3DTranslationService::begin()spawn tft_ui_task pinned to Core 1UIManager::initialize() - load resources / themesplash_screen::create()ESP3DUpdateService::begin() - SD update checkESP3DXStream::begin() - GCode pipelineESP3DXNetwork::begin() - WiFi or BTESP3DValues::handle() - drain update queuelv_timer_handler()

CNC Controller

Transport

CNC Integration (Core 0)

ESP3DValues

(observable bus)

UI Layer (Core 1)

User Inputs (Core 1)

send_gcode(jog cmd)

flow-gated TX

bytes

status reports / ok

RX line

set_value(positions / status / …)

callback on Core 1

lv_obj_set_text(…)

Touch / Buttons

Encoder / Switch

Active Screen

(jog / status / files / …)

publish

set_value()

subscribe

callback

GCodeHostService

Scheduler + flow control

GCodeHandlerService

Protocol parser

UART / BT / USB

/ TCP / WS

FluidNC / grbl / grblHAL


Shared (mutex-protected)

Core 1

Core 0

networkTask

WiFi lifecycle + service startup

streamTask

GCode host + transport dispatch

esp3d_serial_rx_task

or BT / USB / Socket RX task

tft_ui_task

LVGL handler · screen updates

ESP3DValues

ESP3DSettings (NVS)

GlobalFileSystem

esp3d_log


no pending request

line read

EOF

at in-flight cap

credits ok

ok received

timeout 10 s

pause requested

resume

start

ready_to_read_cursor

read_cursor

send_gcode_command

end

wait_for_ack

error

paused


no PSRAM: mutually exclusive

no PSRAM: mutually exclusive

one radio

same CNC-over-WiFi role

CMakeLists.txt

feature flags

Serial UART

(default)

BT SPP

ESP3D_BT_SERIAL_FEATURE

BT BLE GATT

ESP3D_BT_BLE_FEATURE

USB Serial OTG

ESP3D_USB_SERIAL_FEATURE

Socket Client TCP

SOCKET_CLIENT_SERVICE

WebSocket Client

ESP3D_WS_CLIENT_SERVICE_FEATURE

WiFi transports

(SOC / WSC)

cmake/sanity_check.cmake

enforces all exclusions


SKU C - Bluetooth CNC

BT SPP or BLE → CNC controller

WiFi DISABLED (no PSRAM)

only ~10 KB heap available

SKU B - WiFi CNC only

Socket Client TCP → CNC controller

WebUI · SSDP · WS Server DISABLED

(cmake/sanity_check.cmake)

SKU A - Serial CNC + WiFi Remote

Serial / USB UART → CNC controller

WiFi → HTTP WebUI · WS Data · mDNS · SSDP


ModulePathPrimary Documentation
Board Support Packagesboards/*/components/bsp/docs/guides/board_build_guidelines.md
Hardware Peripheral Drivershardware/docs/architecture/display_drivers.md, docs/architecture/Input_system.md
Core Platform & Infrastructuremain/core/, components/esp3d_log/docs/guides/esp32_memory_constraints.md, docs/guides/esp3d_log_guide.md
UI Framework & Screensmain/display/docs/architecture/screens_architecture.md, docs/architecture/screen_transitions_flow.md, docs/ui_resources/theme_palette.md, docs/ui_resources/ui_style_guide.md
CNC Firmware Integrationmain/modules/gcode_host/, main/target/docs/architecture/gcode_host_architecture.md, docs/architecture/gcode_host_streaming_flow.md
Communication Transportsmain/modules/serial/, bt_serial/, bt_ble/, usb_serial/, socket_client/, websocket_client/docs/architecture/connection_management.md, docs/architecture/websockets_protocol.md
Network & Web Servicesmain/modules/network/, wifi/, http/, websocket_server/, mdns/, ssdp/docs/features/feature_resource_matrix.md, docs/features/mdns.md
Storage & Configurationmain/modules/filesystem/, update/, config_file/docs/architecture/shared_sd_mechanism_V2.0.md, docs/ui_resources/development.md
Build & Development Toolstools/docs/guides/tools.md, docs/guides/board_build_guidelines.md
Log Backendsmain/modules/log/docs/guides/esp3d_log_guide.md
DocumentTopic
docs/architecture/connection_management.mdTransport lifecycle, connection states (U/T/C/?/A)
docs/architecture/gcode_host_architecture.mdCore + CNC domain split, CMake wiring
docs/architecture/gcode_host_streaming_flow.mdState machine, pause/resume/abort, flow gates
docs/architecture/esp3d_message_priority_system.mdNormal vs high-priority message routing
docs/architecture/screens_architecture.mdScreen registration, GenericScreen base
docs/architecture/screen_transitions_flow.mdSafe timer-based transition idiom
docs/architecture/Input_system.mdEncoder, buttons, switch, potentiometer pipeline
docs/architecture/display_drivers.mdSPI/I80/RGB driver stack, orientation math
docs/architecture/shared_sd_mechanism_V2.0.mdSD bus arbitration between ESP32 and MCU
docs/features/feature_resource_matrix.mdFeature compatibility, WiFi/CNC SKU model
docs/guides/esp32_memory_constraints.mdHeap fragmentation, worst-case RAM budgets
docs/guides/esp3d_log_guide.mdLogging macros, backends, runtime hooks
docs/ui_resources/development.mdui_resources partition binary format, SD update pipeline
docs/ui_resources/theme_palette.md26 semantic color tokens, per-theme RGBA values
docs/ui_resources/ui_style_guide.mdThemeStyles architecture, apply* function catalog
docs/guides/ui_resources_guide.mdAdding icons and fonts, SD-card update workflow
docs/hardware/pibot-cnc-pendant-hardware-documentation.mdPhysical pendant hardware reference
Terminal window
# Build for a specific board/variant
idf.py build
# Flash and monitor
idf.py flash monitor
# Multi-board build (via build manager)
python tools/build_scripts/build_mgr.py
# Generate UI resources partition
python tools/build_scripts/generate_resources.py
# Launch UI Studio (theme/image/font editor)
cd tools/ui_studio && python app.py

ModuleContent
Board_Support_PackagesThe 18 supported boards: BSP, factory apps, bootloaders, build scripts
Hardware_Peripheral_DriversDisplay drivers (SPI/I80/RGB), touch, physical inputs, buses, buzzer
Core_Platform_&_InfrastructureEntry point, esp3d_core, [ESPxxx] commands, observable values, logs, translations
UI_Framework_&_ScreensLVGL framework, reusable components, generic and CNC screens (FluidNC/grbl/grblHAL)
CNC_Firmware_IntegrationG-code host, streaming, FluidNC / grbl / grblHAL protocol parsers
Communication_TransportsUART, Bluetooth SPP/BLE, USB OTG, TCP sockets, WebSocket client
Network_&_Web_ServicesWiFi, HTTP/WebUI server, WebSocket server, mDNS, SSDP, authentication
Storage_&_ConfigurationFile systems (flash/SD), update service, INI config file
Build_&_Development_ToolsBuild scripts, firmware simulator, UI Studio, communication clients
embedded_webuiMinimal embedded web page (terminal, files, update) served from flash
logging_backendsBackends de journalisation (seriemoniteur, SD, reseau)

Practical guides to extend the firmware (extracted from the DeepWiki analysis):

Additional references: