Getting Started
This guide walks you through cloning PylotOS, running host-side checks locally, and compiling ESP32 firmware either on your machine or through GitHub Actions.
1. Clone the Repository
PylotOS pins upstream MicroPython (v1.29.0) as an unmodified Git submodule:
git clone --recursive https://github.com/PylotOS/pylotos.git
cd pylotos
If you cloned without --recursive, initialize only the required ESP32 submodules (much faster than fetching all MicroPython ports):
git submodule update --init --depth 1 micropython
git -C micropython submodule update --init --depth 1 lib/berkeley-db-1.xx lib/micropython-lib
2. Run Host Tests & Linters Locally (No ESP-IDF Required)
You can validate all partition tables, board JSON schemas, SemVer parsing, and release manifest generation using standard Python 3.11+:
python -m venv .venv
# Linux / macOS:
source .venv/bin/activate
# Windows (PowerShell):
.\.venv\Scripts\Activate.ps1
pip install ruff pytest
ruff check tools kernel tests
pytest -v
3. Building Firmware
PylotOS targets ESP-IDF v5.5.2 (the recommended version for MicroPython v1.29.0).
Option A: Build with GitHub Actions (Zero Local Toolchain)
Every Pull Request and push to main automatically compiles m5stack_core2 inside the official espressif/idf:v5.5.2 container and publishes downloadable *-full.bin and *-ota.bin artifacts under the Actions tab.
Option B: Build Locally with Docker
docker run --rm -v "$PWD:/work" -w /work espressif/idf:v5.5.2 \
bash -c ". /opt/esp/idf/export.sh && python3 tools/build.py --board m5stack_core2 --version 0.1.0-local"
Option C: Build Locally with Native ESP-IDF v5.5.2
Inside an activated ESP-IDF v5.5.2 shell:
python3 tools/build.py --board m5stack_core2 --version 0.1.0-local
Build Outputs (dist/<board>/)
| File | Purpose | Flash Target |
|---|---|---|
pylotos-<board>-<ver>-full.bin | Complete merged flash image (bootloader + partition table + ota_data_initial + app) | Initial USB / Web Flasher install (0x1000 on ESP32) |
pylotos-<board>-<ver>-ota.bin | Application-only binary (micropython.bin) | GitHub Releases OTA updates into ota_0/ota_1 |
artifact.json | Build metadata, byte sizes, and SHA-256 checksums | Input for tools/gen_manifest.py |