Getting Started & IDE Setup

This guide walks you through installing pylotos-sdk, enabling full type-checked autocomplete in VS Code / Cursor / PyCharm, previewing an app across multiple ESP32 boards on your PC, and deploying it to real hardware.


1. Install pylotos-sdk

Requires Python 3.10+ on macOS, Linux, or Windows:

# Install directly from GitHub into your project virtualenv:
python3 -m venv .venv
source .venv/bin/activate
pip install git+https://github.com/PylotOS/pylotos-sdk.git

# Or clone for editable local development & examples:
git clone https://github.com/PylotOS/pylotos-sdk.git
cd pylotos-sdk
pip install -e .
pip install pytest ruff

Verify the simulator CLI is on your PATH:

pylotos-sim --help

2. Configure VS Code / Cursor / PyCharm IntelliSense

Point your editor's Python interpreter to .venv/bin/python. Because pylotos-sdk ships PEP 561 py.typed markers and .pyi stubs at the top level of site-packages, Pylance and PyCharm immediately resolve:

Optional .vscode/settings.json for strict MicroPython-friendly linting:

{
  "python.analysis.typeCheckingMode": "basic",
  "ruff.lineLength": 100
}

MicroPython Compatibility Rule for On-Device /apps/*.py: Avoid CPython-only from __future__ import annotations, os.path, str.removeprefix(), str.removesuffix(), and str.isascii() in scripts destined for ESP32 /apps/. Use standard asyncio (or uasyncio), bytearray / memoryview, and "{}".format(...) or simple f-strings.


3. Write Your First Adaptive App (hello_fleet.py)

Create hello_fleet.py:

import hal
import pylotos.ui as ui

info = hal.board_info()
st = ui.State(
    counter=0,
    board=info.get("board_id", "unknown"),
    heap_kb=hal.mem_info().get("heap_free_bytes", 0) // 1024,
)


def _increment():
    st.counter = st.counter + 1
    st.heap_kb = hal.mem_info().get("heap_free_bytes", 0) // 1024
    hal.beep(1046, 30, 40)
    app.notify("Count -> {}".format(st.counter), level="ok", icon="bolt")


app = ui.App(
    "Hello Fleet",
    state=st,
    screens=[
        ui.Screen(
            "Dashboard",
            icon="home",
            children=[
                ui.Grid(
                    cols=2,
                    children=[
                        ui.Metric("Clicks", st.bind("counter"), accent="cyan"),
                        ui.Metric("Heap", st.bind("heap_kb"), unit="KB", accent="gold"),
                    ],
                ),
                ui.Card(
                    "Actions",
                    children=[
                        ui.KeyValue("Board", st.bind("board")),
                        ui.Button("Trigger Pulse", on_click=_increment, shortcut="t"),
                    ],
                ),
            ],
        ),
    ],
)


async def run(cv):
    await app.run_async(cv)

4. Preview Locally Across Any of the 30 Boards

Run pylotos-sim and open http://127.0.0.1:8080 in your browser:

# Wide 240x135 TFT + QWERTY keyboard (M5Stack Cardputer ADV)
pylotos-sim hello_fleet.py --board m5stack_cardputer_adv --port 8080

# Round 240x240 GC9A01 + Rotary Encoder + Touch (M5Stack Dial)
pylotos-sim hello_fleet.py --board m5stack_dial --port 8080

# 128x64 1-bit OLED (Heltec WiFi LoRa 32 V3)
pylotos-sim hello_fleet.py --board heltec_wifi_lora_32_v3 --port 8080

# Headless RISC-V Wi-Fi 6 node — Web Dashboard mode (M5Stack NanoC6)
pylotos-sim hello_fleet.py --board m5stack_nanoc6 --port 8080

You will see both the pixel-accurate hardware display (with interactive buttons/touch/encoder) and the live responsive Web Dashboard rendered by ui_renderer.js!


5. Deploy to Real ESP32 Hardware

Once your board is flashed via the 1-Click Web Flasher (asym-v1 layout) and joined to Wi-Fi (via NVS pre-provisioning, PylotOS-Setup Captive Portal, or Improv Wi-Fi):

  1. Browser App Studio: Open pylotos.org/apps, connect to <hostname>.local:8266, paste or upload hello_fleet.py, and click Deploy & Run (atomic SHA-256 upload with automatic .bak crash rollback).
  2. AI Coding Agent (MCP Bridge): In Claude Code, Cursor, Windsurf, or Gemini CLI with pylotos-mcp-bridge enabled, simply ask: "Deploy hello_fleet.py to my Cardputer ADV, start it, and take a screenshot."
  3. Direct HTTP API (curl):
   # List installed apps over mDNS:
   curl http://pylotos-cardputer.local:8266/api/apps/list