Step 5

Flash the firmware

A PlatformIO project. Libraries download automatically on the first build. Tested on macOS; Linux and Windows should work the same way but have not been tested.

USB-C hub with USB-A ports

MacBook: the ESP32 does not start on a USB-C port

Plugged straight into a USB-C port of an Apple MacBook Air (M4), and likely other MacBook models and USB-C laptops, the ESP32 board stays dark and does not boot. It looks dead, but it is not: the board's USB-C socket lacks the resistors that tell a USB-C port to switch power on.

Fix: connect through a USB hub with USB-A ports, using a data USB-A to USB-C cable. This hub works with an Apple laptop: Amazon →

Source code

Firmware source code and host-side tests.

Download .zip 212 KB

ESP32 · Arduino · TFT_eSPI · TMCStepper · NimBLE

  1. Install PlatformIO
    macOS · tested
    $ brew install platformio
    Linux · untested
    $ pipx install platformio
    Then allow serial access: sudo usermod -aG dialout $USER, and log out and back in.
    Windows · untestedInstall VS Code with the PlatformIO IDE extension and run the commands below in its PlatformIO terminal. Windows may need the WCH CH340 USB driver.
  2. Unzip and open a terminal in it
    $ cd AutoSharpener
  3. Connect the ESP32Slide SW1 to USB and plug in the charger: the screen must stay dark. Then connect through a USB-A port or a hub (see the MacBook note above), with a data A-to-C cable. The board shows up as a CH340 serial port: /dev/cu.usbserial-… on macOS, /dev/ttyUSB0 on Linux, COM3 or similar on Windows. pio device list shows it.
    Never plug in USB-C while the jack powers the ESP32Nothing on the board stops the two supplies meeting. How the JACK / USB switch works →
  4. Build and flash
    $ pio run -t upload -t monitor
  5. Adjust to your machineMotor current, travel and speeds: lib/Board/Board.h.
  6. Optional: run the tests
    $ ./test/native/run.sh
    Kinematics and paths, on your computer, no board needed. Needs bash and a C++ compiler: Xcode command-line tools on macOS, g++ on Linux, WSL on Windows (untested).
Software

The screens

Inventory of user interfaces focused on easy navigation and access to functions.

Self-testDrivers, supply, stall lines and encoder checked at power-on
Sensorless homingFinds the frame corner by motor stall — no switches
Main menuStart, pattern, drip rate, home, jog, info
Pattern listBuilt-in paths plus your own multi-phase programs
RunningBig live speed; position, cycles, distance, time, drip
Drip rateHold the knob mid-run to change the water flow
PausePush to pause — continue or stop, stats kept
Jog & set homeNudge the head, save a new work centre
Problem with this step? Ask in Build →