eenk development
Everything you need to build the eenk firmware from source and set up the eenky IDE for development.
Note: Just want to flash a device? Skip the build environment entirely and use the Web Flasher to install pre-built firmware in minutes.
Prerequisites
Before you begin, ensure the following are installed on your system:
| Tool | Required For | Notes |
|---|---|---|
| Git | All | With submodule support |
| Python 3.8+ | PlatformIO + scripts | python must be in PATH |
| PlatformIO Core | Firmware builds | pip install platformio |
| MinGW-w64 / g++ | Native simulator (Windows) | MSYS2 recommended |
| SDL2 | Native simulator | Via MSYS2 on Windows |
| Node.js 18+ | eenky IDE | LTS recommended |
Cloning the repository
eenk uses git submodules for its dependencies. Always clone recursively:
git clone --recurse-submodules https://github.com/t0mg/eenk.git
cd eenk
If you already cloned without --recurse-submodules, initialize them manually:
git submodule update --init --recursive
Building the desktop simulator
Note: currently only ever tested on Windows (MSYS2).
The native build compiles an SDL2 desktop application that simulates the e-ink display at 800×480px. This is the fastest way to test firmware changes without hardware.
Windows (MSYS2):
# Add MinGW to PATH, then build
$env:PATH = "C:\msys64\mingw64\bin;$env:PATH"
pio run -e native
Linux / macOS:
# Install SDL2 via package manager first:
# sudo apt install libsdl2-dev (Debian/Ubuntu)
# brew install sdl2 (macOS)
pio run -e native
The output binary is at .pio/build/native/program.exe (Windows) or .pio/build/native/program (Linux/macOS).
Run it with a compiled story:
.pio\build\native\program.exe path\to\story.bin
Use W/S or arrow keys to navigate, Enter to confirm.
Building the firmware
Xteink X3 / X4 (esp32c3)
pio run -e esp32c3
Outputs:
.pio/build/esp32c3/firmware.bin— app partition only.pio/build/esp32c3/firmware-factory.bin— merged (bootloader + partitions + app), ready for Web Flasher
Xteink X3 / X4 OTA Updater (esp32c3_updater)
The partition table contains a separate 1 MB updater partition (app1) to fit a minimal recovery firmware that can flash an OTA update from SD. Build the updater before the main firmware if you want it included in the factory image:
pio run -e esp32c3_updater
pio run -e esp32c3
Xteink X4 Pro (esp32s3)
pio run -e esp32s3
Outputs:
.pio/build/esp32s3/firmware-factory.bin— merged factory image for X4 Pro
Runing tests
Unit tests with unsufficient coverage run against the native simulator and the simulator is used to generate "golden" screenshots testing various UI elements, which are saved into test/golden/:
pio test -e native
Check for unintended visual regressions after display-related changes:
git diff test/golden/
Flashing to Hardware
Connect your device via USB and run:
pio run -e esp32c3 -t upload
or for the X4Pro:
pio run -e esp32s3 -t upload
eenky IDE development
eenky is the companion Electron-based IDE for authoring Ink stories, running the simulator, and managing the hardware device.
Cloning the repository
The eenky repository has eenk as a git submodule in order to build the simulator, and import shared css styles and documentation files.
git clone --recurse-submodules https://github.com/t0mg/eenky.git
cd eenky/app
npm install
npm run setup # Builds and copies the simulator binary into place
npm start # Launch the IDE in development mode
Note: If you make changes in the eenk submodule that affect the
nativeenvironment target and want to test them in eenky, you can manually rebuild and copy and rename the binaryprogram.exeoutput binary intoapp/main-process/ink/win/eenk-sim.exe(Windows example).
Packaging for production
eenky uses electron-builder to create distributable installers and binaries. To build a production package:
# 1. Build the Vue renderer
cd app/renderer
npm run build
cd ..
# 2. Package the app
# This creates the installer for your current operating system
# under /bin/<os-arch>/
npm run dist