Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

mpremote

Directory actions

More options

Directory actions

More options

Latest commit

 

History

History

mpremote

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

This CLI tool provides an integrated set of utilities to remotely interact withand automate a MicroPython device over a serial connection.

The simplest way to use this tool is:

mpremote

This will automatically connect to a USB serial port and provide an interactive REPL.

The full list of supported commands are:

mpremote connect <device>         -- connect to given device                                     device may be: list, auto, id:x, port:x                                     or any valid device name/pathmpremote disconnect               -- disconnect current devicempremote mount <local-dir>        -- mount local directory on devicempremote eval <string>            -- evaluate and print the stringmpremote exec <string>            -- execute the stringmpremote run <file>               -- run the given local scriptmpremote fs <command> <args...>   -- execute filesystem commands on the device                                     command may be: cat, ls, cp, rm, mkdir, rmdir, sha256sum                                     use ":" as a prefix to specify a file on the devicempremote repl                     -- enter REPL                                     options:                                         --capture <file>                                         --inject-code <string>                                         --inject-file <file>mpremote mip install <package...> -- Install packages (from micropython-lib or third-party sources)                                     options:                                         --target <path>                                         --index <url>                                         --no-mpympremote help                     -- print list of commands and exit

Multiple commands can be specified and they will be run sequentially. Connectionand disconnection will be done automatically at the start and end of the executionof the tool, if such commands are not explicitly given. Automatic connection willsearch for the first available serial device. If no action is specified then theREPL will be entered.

Shortcuts can be defined using the macro system. Built-in shortcuts are:

  • a0, a1, a2, a3: connect to/dev/ttyACM?
  • u0, u1, u2, u3: connect to/dev/ttyUSB?
  • c0, c1, c2, c3: connect toCOM?
  • cat, ls, cp, rm, mkdir, rmdir, df: filesystem commands
  • reset: reset the device
  • bootloader: make the device enter its bootloader

Any user configuration, including user-defined shortcuts, can be placed in.config/mpremote/config.py. For example:

# Custom macro commandscommands = {    "c33": "connect id:334D335C3138",    "bl": "bootloader",    "double x=4": {        "command": "eval x*2",        "help": "multiply by two"    }}

Examples:

mpremotempremote a1mpremote connect /dev/ttyUSB0 replmpremote lsmpremote a1 lsmpremote exec "import micropython; micropython.mem_info()"mpremote eval 1/2 eval 3/4mpremote mount .mpremote mount . exec "import local_script"mpremote lsmpremote cat boot.pympremote cp :main.py .mpremote cp main.py :mpremote cp -r dir/ :mpremote sha256sum :main.pympremote mip install aioblempremote mip install github:org/repo@branchmpremote mip install gitlab:org/repo@branch

[8]ページ先頭

©2009-2025 Movatter.jp