micropython-skills
Program and interact with embedded development boards (ESP32, ESP32-S3, ESP32-C3, ESP8266, NodeMCU, Raspberry Pi Pico, RP2040, STM32) through real-time REPL. This skill turns microcontroller hardware into an AI-programmable co-processor — read sensors, control actuators, flash firmware, diagnose devices, and deploy algorithms. Trigger when the user mentions any dev board or hardware interaction: ESP32, ESP8266, NodeMCU, Pico, 开发板, 板子, 单片机, 嵌入式, microcontroller, development board, sensor reading, GPIO, LED, motor, relay, I2C, SPI, UART, ADC, PWM, servo, DHT, BME280, temperature sensor, 传感器, 读传感器, 控制电机, 继电器, flash firmware, 烧录, 刷固件, 刷机, mpremote, MicroPython, IoT, MQTT, WiFi on board, 设备没反应, device not responding, or any task involving programming or controlling a physical microcontroller board.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/0x1abin/micropython-skillsmicropython-skills
AI Agent programmable co-processor skill collection. You (the Agent) generate MicroPython code, push it to devices via REPL, parse structured output, and iterate — turning hardware into your extended capability.
Quick Start
Python command: Use
python3on macOS/Linux,pythonon Windows. On Windows,python3is often a Microsoft Store stub that silently fails (exit code 49). On macOS/Linux,pythonmay not exist or may point to Python 2.
Every interaction follows this flow:
- Probe — Run
python3 {SKILL_DIR}/scripts/device_probe.pyto discover connected devicesstatus: "ok"→ Device has MicroPython, proceed to step 2status: "no_firmware"→ ESP chip detected but no MicroPython. Ask user to confirm, then flash:python3 {SKILL_DIR}/scripts/firmware_flash.py --port PORT --yesstatus: "no_device"→ No device connected. Guide user to connect hardware.status: "permission_denied"→ Serial port not accessible. On Linux:sudo chmod 666 /dev/ttyACM0. On Windows: check Device Manager for driver issues.
- Connect — Default: USB via mpremote. Optional: WiFi via WebREPL (user must request)
- Execute — Generate MicroPython code and push to device
- Parse — Scan stdout for tagged lines (RESULT:/ERROR:/STATUS:/LOG:)
- Iterate — Adjust code based on results, repeat steps 3-5
Where {SKILL_DIR} is the directory containing this SKILL.md file.
Connection Management
Default: USB (mpremote)
Always start by probing for devices:
python3 {SKILL_DIR}/scripts/device_probe.py
Execute code on device:
mpremote exec "import machine; print('RESULT:' + str(machine.freq()))"
Run a script file:
mpremote run script.py
For multi-line code, write a temporary .py file locally, then mpremote run /path/to/task.py.
Serial port names vary by platform:
| Platform | Port Format | Example |
|---|---|---|
| Linux | /dev/ttyUSB0, /dev/ttyACM0 | mpremote connect /dev/ttyACM0 |
| macOS | /dev/cu.usbserial-, /dev/cu.usbmodem | mpremote connect /dev/cu.usbmodem14101 |
| Windows | COM3, COM4, ... | mpremote connect COM3 |
The scripts auto-detect the port — you rarely need to specify it manually.
Optional: WiFi (WebREPL)
Only switch to WiFi when the user explicitly requests it. The switch flow:
- Ask user for WiFi SSID and password
- Push WiFi + WebREPL config to device via USB:
python3 {SKILL_DIR}/scripts/wifi_setup.py --ssid "SSID" --password "PASS" --webrepl-password "repl123" - Note the IP address from the output
- From now on, execute code over WiFi:
python3 {SKILL_DIR}/scripts/webrepl_exec.py --host 192.168.1.100 --password repl123 --code "print('hello')" - USB cable can be disconnected
For detailed command reference, read ./references/connections.md.
Sub-skill Router
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-0x1abin-micropython-skills": {
"enabled": true,
"auto_update": true
}
}
}