Skip to main content

mpremote -- MicroPython remote control

This CLI tool provides an integrated set of utilities to remotely interact with and 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/path
mpremote disconnect               -- disconnect current device
mpremote mount <local-dir>        -- mount local directory on device
mpremote eval <string>            -- evaluate and print the string
mpremote exec <string>            -- execute the string
mpremote run <file>               -- run the given local script
mpremote 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 device
mpremote 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-mpy
mpremote help                     -- print list of commands and exit

Multiple commands can be specified and they will be run sequentially. Connection and disconnection will be done automatically at the start and end of the execution of the tool, if such commands are not explicitly given. Automatic connection will search for the first available serial device. If no action is specified then the REPL 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 to COM?
  • 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 commands
commands = {
    "c33": "connect id:334D335C3138",
    "bl": "bootloader",
    "double x=4": {
        "command": "eval x*2",
        "help": "multiply by two"
    }
}

Examples:

mpremote
mpremote a1
mpremote connect /dev/ttyUSB0 repl
mpremote ls
mpremote a1 ls
mpremote exec "import micropython; micropython.mem_info()"
mpremote eval 1/2 eval 3/4
mpremote mount .
mpremote mount . exec "import local_script"
mpremote ls
mpremote cat boot.py
mpremote cp :main.py .
mpremote cp main.py :
mpremote cp -r dir/ :
mpremote sha256sum :main.py
mpremote mip install aioble
mpremote mip install github:org/repo@branch
mpremote mip install gitlab:org/repo@branch
mpremote mip install codeberg:org/repo@branch

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mpremote-1.29.0.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mpremote-1.29.0-py3-none-any.whl (38.7 kB view details)

Uploaded Python 3

File details

Details for the file mpremote-1.29.0.tar.gz.

File metadata

  • Download URL: mpremote-1.29.0.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for mpremote-1.29.0.tar.gz
Algorithm Hash digest
SHA256 ab0b6f21059698e573ca076fe9a0299e5fe7bbc3ca3f5b2f00007e22e51c7b80
MD5 e32b5254b0a0147f529e6677fefbb235
BLAKE2b-256 acb78c44eb606b0e53517fd6ddda3f598b3bdb180c181f4e0bcbb9b7743f4cb5

See more details on using hashes here.

File details

Details for the file mpremote-1.29.0-py3-none-any.whl.

File metadata

  • Download URL: mpremote-1.29.0-py3-none-any.whl
  • Upload date:
  • Size: 38.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for mpremote-1.29.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dedac688bcd65b9d4d5b7a66119332f2830000088321107994959333f53e41c8
MD5 9c02795579775909b9238cbe8bbc1f51
BLAKE2b-256 5185f68fbcfe4d1ce32a7f2154a48f68195d4f256e3700b69ad0d5b758ee3b37

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.29.0 This release

2 files

1.28.0

2 files

1.27.0

2 files

1.26.1

2 files

1.26.0

2 files

1.25.0

2 files

1.24.1

2 files

1.24.0

2 files

1.23.0

2 files

1.22.0

2 files

1.21.0

2 files

1.20.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page