micropython_append_file
Append text or base64-encoded data to a file on a MicroPython board, such as /main.py, to update code or log data directly on the device.
Instructions
MicroPython ボードのファイルに内容を追記する。
Args:
path: 追記先ファイルのパス (例: "/main.py")
content: 追記するテキスト内容。content_base64 とは排他的
timeout: コード送信から Raw REPL 復帰完了までの全体タイムアウト秒数
encoding: content をバイト列に変換するエンコーディング
content_base64: base64 で表した追記データ。content とは排他的
Returns: ok: 追記に成功したら True path: 追記先パス bytes_written: 今回追記したバイト数 error: エラー時のメッセージ
Notes:
content と content_base64 はどちらか片方のみ指定する。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| content | No | ||
| timeout | No | ||
| encoding | No | utf-8 | |
| content_base64 | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| path | Yes | ||
| error | Yes | ||
| bytes_written | Yes |