Token导航 LogoToken导航TokenDH.com
开发需要联网clawhub未标认证来源可访问clear审计提醒

unihiker-k10-micropythonunihiker K10 micropython 测试

Agent Skill

用于辅助 Python 项目开发、测试、依赖管理和常见框架工作流。它适合让 Agent 阅读 Python 代码、定位测试问题、整理运行命令、生成脚本或分析数据处理逻辑。使用时需要确认项目虚拟环境、依赖版本和测试入口;涉及执行脚本、读写文件、访问数据库或调用外部 API 时,应先明确运行目录和输入输出范围,避免误改生产数据。

总安装

4,253

周安装

179

GitHub Stars

公开资料未说明

下载量

1,489
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:unihiker-k10-micropython(unihiker K10 micropython 测试)
来源仓库:https://github.com/rockets-cn/unihiker-k10-micropython
安装命令:
openclaw skills install unihiker-k10-micropython
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install unihiker-k10-micropython

简介

使用 MicroPython 对 Unihiker K10 板进行编程、上传代码、刷新固件或访问 K10 MicroPython API(屏幕、传感器、RGB、音频、AI)时使用

SKILL.md

name
unihiker-k10-micropython
description
Use when programming Unihiker K10 board with MicroPython, uploading code, flashing firmware, or accessing K10 MicroPython APIs (screen, sensors, RGB, audio, AI)

Unihiker K10 - MicroPython

Overview

CLI toolkit for Unihiker K10 board MicroPython programming. Core principle: Follow reference docs exactly—no improvisation.

When to Use

  • Uploading MicroPython code to K10
  • Flashing MicroPython firmware
  • Looking up K10 MicroPython APIs (screen, sensors, RGB, audio, AI)
  • Port detection or connectivity issues

Commands

CommandDescription
k10-micropython upload-mp <file.py>Upload MicroPython
k10-micropython flash-mpFlash MicroPython firmware
k10-micropython portsList serial ports
k10-micropython doctorEnvironment diagnostic

Coding

Basic Template

from unihiker_k10 import screen
screen.init(dir=2)
screen.draw_text(text="Hello", x=10, y=0, font_size=24, color=0xFF0000)
screen.show_draw()

Important:

  • Auto-execution: Only main.py runs automatically on boot. Other filenames (e.g., test.py) must be imported or run via REPL
  • Best practice: Name your entry file as main.py for auto-start
  • Reference: references/micropython-api.md

Common Issues

IssueSolution
MicroPython code doesn't runOnly main.py runs automatically. Rename your file or use REPL to run it
Flash failedMake sure BOOT button is held when connecting USB to enter download mode
mpremote: could not enter raw replK10 is running Arduino, flash MicroPython firmware first
Port not foundk10-micropython ports or hold BOOT while connecting
AI + WiFi conflictUse only one in V0.9.2
Windows PowerShell执行策略限制运行 Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

开发经验教训

2025-03-22 实践总结

与Arduino模式的区别:

  1. 固件互斥: K10不能同时运行Arduino和MicroPython固件,需要刷写对应固件
  2. 入口文件: MicroPython只有main.py会自动运行,其他文件需要手动import
  3. 工具链不同: Arduino使用arduino-cli,MicroPython使用mpremote

刷写MicroPython固件步骤:

  1. 按住BOOT按钮
  2. 按RST按钮重置
  3. 释放BOOT按钮
  4. 运行刷写命令
  5. 等待完成(30-60秒)
  6. 按RST重启

注意事项:

  • V0.9.2固件中AI功能和WiFi不能同时使用,会导致内存溢出
  • 首次刷写后建议先上传简单的main.py测试

Files

unihiker-k10-micropython/
├── SKILL.md                 # This file
└── references/            # MicroPython API docs
    └── micropython-api.md # MicroPython API reference

Manual usage without CLI:

# Upload MicroPython
bash path/to/unihiker-k10-micropython/scripts/upload-micropython.sh main.py /dev/cu.usbmodem2201

# Flash MicroPython firmware
bash path/to/unihiker-k10-micropython/scripts/flash-micropython.sh /dev/cu.usbmodem2201

MicroPython Code Execution

  • Automatic execution: Files named main.py run automatically after upload and reset
  • Manual execution: Other filenames require REPL interaction:
  # Connect to REPL
  mpremote connect /dev/cu.usbmodem2201 repl
  
  # Import and run your module
  >>> import test

File naming best practice:

your_project/
├── main.py          # Entry point - runs automatically on boot
├── test.py          # Test file - must be imported via REPL
└── heart.py         # Other files - import with `import heart`

Flashing MicroPython Firmware

Method 1: Manual (Recommended)

  1. Hold BOOT button on K10
  2. Press RST button on K10
  3. Release BOOT button
  4. Run: k10-micropython flash-mp or k10-micropython flash-mp --port /dev/cu.usbmodem2201
  5. Wait for flash to complete (30-60 seconds)
  6. Press RST button on K10 to restart
  7. Upload Python code with k10-micropython upload-mp file.py

Method 2: Interactive

  1. Run: k10-micropython flash-mp
  2. Follow on-screen prompts
  3. Hold BOOT button, connect USB, release BOOT

Quick Development Workflow

# 1. Create MicroPython script
echo "from unihiker_k10 import screen
screen.init(dir=2)
screen.draw_text(text='Hello K10', x=10, y=0, font_size=24, color=0xFFFFFF)
screen.show_draw()" > main.py

# 2. Upload as main.py for auto-run
k10-micropython upload-mp main.py

# 3. Or test as test.py and run via REPL
k10-micropython upload-mp test.py
mpremote connect /dev/cu.usbmodem2201 repl
>>> import test

Key Features

Screen:

  • Screen initialization and direction control
  • Text drawing with custom font size and color
  • Shape drawing: lines, circles, rectangles, points
  • Image display from TF card
  • QR code generation and display

Sensors:

  • Buttons A/B (callback and status check)
  • Accelerometer (X, Y, Z axes)
  • Temperature & humidity (AHT20)
  • Light sensor (ALS)
  • Microphone (recording to TF card)

RGB LED Control:

  • Individual LED control (0, 1, 2)
  • All LEDs control (-1)
  • Brightness control (0-9)

Audio:

  • Buzzer control (playTone)
  • Microphone recording to TF card

AI Features (V0.9.2):

  • Face Detection: Detect faces, show length, width, center coordinates
  • Face Recognition: Enroll faces, recognize faces, display ID
  • Cat Recognition: Detect and classify cats (with TF card images)
  • Movement Detection: Motion detection with customizable threshold
  • QR Code Scanning: Scan QR codes and display content
  • Speech Recognition: Wake-up command and voice commands

Note on AI:

  • AI functionality is resource-intensive in V0.9.2 firmware
  • AI + WiFi conflict: Use only one at a time to avoid memory overflow

Example: Face Recognition with LED Feedback

import ai
from unihiker_k10 import screen, rgb, button
import time

def callback(data):
    if data == 1:
        screen.draw_text(text="录入中...", x=10, y=90, font_size=24, color=0xFFFF00)
    elif data >= 0:
        screen.draw_text(text=f"人脸ID: {data}", x=10, y=90, font_size=24, color=0x00FF00)
    screen.show_draw()

screen.init(dir=2)
screen.show_bg(color=0x000000)
screen.draw_text(text="A: 录入", x=10, y=50, font_size=18, color=0xFFFF00)
screen.draw_text(text="B: 删除全部", x=10, y=70, font_size=18, color=0xFF0000)
screen.draw_text(text="LED: 红色=未知", x=10, y=110, font_size=18, color=0xFF0000)
screen.draw_text(text="   绿色=已识别", x=10, y=130, font_size=18, color=0x00FF00)
screen.show_draw()

rgb.brightness(9)

ai.init_ai()
ai.camera_start()
ai.face_recognize_start()
ai.send_face_cmd(2)  # Recognition mode
ai.set_asr_callback(callback)

try:
    while True:
        image_data = ai.camera_capture()
        screen.show_camera_img(image_data)
        time.sleep_ms(1)
except KeyboardInterrupt:
    print("Exiting...")
    ai.deinit_ai()
    rgb.brightness(0)
    screen.clear()

Features:

  • Face Enroll (A button): ai.send_face_cmd(1) - Green LED
  • Face Recognition (automatic): Display ID, Green LED
  • Unknown face: Red LED
  • Delete all faces (B button): ai.send_face_cmd(3) - Clear stored faces
  • Camera display: Show real-time camera feed on screen

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

73.92%
按下载量换算1,101

安全审计

VirusTotal

可疑

ClawScan

可疑

Static analysis

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills