Reading the repo
Opening the box…
Reading the repo
Opening the box…
How to install on Linux
ESP32-P4 touchscreen lathe controller with reusable grblHAL driver and independently pinned core
Saved setup from 8 h ago
Will it work on Linux?
INSTALL.mdVersion 0.4.1 removes the previous product identity and uses the
settings NVS partition. A full P4 flash erase and installation replaces
the previous firmware, partition table and settings. No intermediate firmware
is needed. Do not use an application-only OTA update for this transition.
Bring the controller and a USB data cable. Use the P4 programming/debug USB port, not the ESP32-C6 coprocessor's programming port. Keep the motor drives disconnected or unpowered throughout installation and first-start checks. The normal firmware permits axis control once startup is ready.
Install ESP-IDF 5.5.2, source its export.sh, and build from the repository root:
git submodule update --init dependencies/esp32 dependencies/grbl dependencies/trinamic
python -m pip install -r requirements-build.txt
idf.py build
Replace USB_PORT below with the actual connected P4 serial port. If automatic
bootloader entry fails, use the board's BOOT/RESET sequence, then retry. Confirm
that the programming tool identifies an ESP32-P4 before erasing.
This erases the P4's entire flash: old applications and rollback slots,
partition table, Wi-Fi credentials, controller calibration/settings, saved
positions, work offsets, limits, disabled-axis state, UI preferences and files.
Defaults are then loaded from main/machine.h and the application. The separate
ESP32-C6 Wi-Fi coprocessor is not erased or reflashed by these commands.
idf.py -p USB_PORT erase-flash
idf.py -p USB_PORT flash monitor
flash installs the bootloader, partition table, factory application and initial
OTA metadata from the same build. Keep power connected through verification.
Exit the serial monitor with Ctrl+]. There is no old firmware left on the P4 to
roll back to after this erase; later OTA updates establish new rollback slots.
For an electrically disconnected diagnostic fixture, build and flash the separate enable-locked variant instead:
idf.py -B build-bench -DSDKCONFIG=sdkconfig.bench -DLATHE_BENCH_ONLY=ON -DLATHE_OTA_REQUIRE_PAIRING=ON build
idf.py -B build-bench -p USB_PORT erase-flash
idf.py -B build-bench -p USB_PORT flash monitor
After this clean install, routine updates use the current uploader and the
esp32-p4-lathe-controller image identity; see OTA.md. Keep this partition
layout for subsequent application-only updates.
Then run bash setup.sh. It stops at the first error and is safe to run again. Servers and tests aren't started; it lists them at the end. Read it first.
The repo uses git submodules, so the clone fetches them too.
git clone --recurse-submodules https://github.com/fer662/esp32-p4-lathe-controller.git cd esp32-p4-lathe-controller
C/C++ compiler, CMake 3.16, Python 3
sudo apt install build-essential # Debian/Ubuntu sudo apt install cmake sudo apt install python3 python3-pip
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake --build build
Install ESP-IDF 5.5.2 with ESP32-P4 tools and source its export.sh.
git clone https://github.com/fer662/esp32-p4-lathe-controller.git
cd esp32-p4-lathe-controller
git submodule update --init dependencies/esp32 dependencies/grbl dependencies/trinamic
python -m pip install -r requirements-build.txt
idf.py build
The normal build permits axis control. For a disconnected bench with motor enables locked and fixture diagnostics compiled in:
idf.py -B build-bench -DSDKCONFIG=sdkconfig.bench -DLATHE_BENCH_ONLY=ON -DLATHE_OTA_REQUIRE_PAIRING=ON build
Application configuration is in main/machine.h; board wiring is selected through
waveshare_p4_xz_map.h from the driver dependency. Driver and application C code
compile with the same configuration header. Managed component versions are pinned
in dependencies.lock; the component manager is pinned in requirements-build.txt
to make fresh resolution reproducible. Keep the three LVGL 9 optional-backend switches disabled;
the interface deliberately uses LVGL 8.3.11.
No reports for Linux yet.
GitManual AI Agent reads the 5 key files and writes a step-by-step guide for Linux. Once written, it's saved for everyone.