Debian Codegraph @

PKG-INFO

raw
1 Metadata-Version: 2.4
2 Name: mpremote
3 Version: 1.26.0
4 Summary: Tool for interacting remotely with MicroPython devices
5 Project-URL: Homepage, https://github.com/micropython/micropython
6 Author-email: Damien George <[email protected]>
7 License: MIT
8 License-File: LICENSE
9 Keywords: hardware,micropython
10 Classifier: Intended Audience :: Developers
11 Classifier: License :: OSI Approved :: MIT License
12 Classifier: Operating System :: OS Independent
13 Classifier: Programming Language :: Python :: 3
14 Classifier: Topic :: Software Development :: Embedded Systems
15 Classifier: Topic :: System :: Hardware
16 Requires-Python: >=3.4
17 Requires-Dist: importlib-metadata>=1.4; python_version < '3.8'
18 Requires-Dist: platformdirs>=4.3.7
19 Requires-Dist: pyserial>=3.3
20 Description-Content-Type: text/markdown
21
22 # mpremote -- MicroPython remote control
23
24 This CLI tool provides an integrated set of utilities to remotely interact with
25 and automate a MicroPython device over a serial connection.
26
27 The simplest way to use this tool is:
28
29 mpremote
30
31 This will automatically connect to a USB serial port and provide an interactive REPL.
32
33 The full list of supported commands are:
34
35 mpremote connect <device> -- connect to given device
36 device may be: list, auto, id:x, port:x
37 or any valid device name/path
38 mpremote disconnect -- disconnect current device
39 mpremote mount <local-dir> -- mount local directory on device
40 mpremote eval <string> -- evaluate and print the string
41 mpremote exec <string> -- execute the string
42 mpremote run <file> -- run the given local script
43 mpremote fs <command> <args...> -- execute filesystem commands on the device
44 command may be: cat, ls, cp, rm, mkdir, rmdir, sha256sum
45 use ":" as a prefix to specify a file on the device
46 mpremote repl -- enter REPL
47 options:
48 --capture <file>
49 --inject-code <string>
50 --inject-file <file>
51 mpremote mip install <package...> -- Install packages (from micropython-lib or third-party sources)
52 options:
53 --target <path>
54 --index <url>
55 --no-mpy
56 mpremote help -- print list of commands and exit
57
58 Multiple commands can be specified and they will be run sequentially. Connection
59 and disconnection will be done automatically at the start and end of the execution
60 of the tool, if such commands are not explicitly given. Automatic connection will
61 search for the first available serial device. If no action is specified then the
62 REPL will be entered.
63
64 Shortcuts can be defined using the macro system. Built-in shortcuts are:
65
66 - a0, a1, a2, a3: connect to `/dev/ttyACM?`
67 - u0, u1, u2, u3: connect to `/dev/ttyUSB?`
68 - c0, c1, c2, c3: connect to `COM?`
69 - cat, ls, cp, rm, mkdir, rmdir, df: filesystem commands
70 - reset: reset the device
71 - bootloader: make the device enter its bootloader
72
73 Any user configuration, including user-defined shortcuts, can be placed in
74 .config/mpremote/config.py. For example:
75
76 # Custom macro commands
77 commands = {
78 "c33": "connect id:334D335C3138",
79 "bl": "bootloader",
80 "double x=4": {
81 "command": "eval x*2",
82 "help": "multiply by two"
83 }
84 }
85
86 Examples:
87
88 mpremote
89 mpremote a1
90 mpremote connect /dev/ttyUSB0 repl
91 mpremote ls
92 mpremote a1 ls
93 mpremote exec "import micropython; micropython.mem_info()"
94 mpremote eval 1/2 eval 3/4
95 mpremote mount .
96 mpremote mount . exec "import local_script"
97 mpremote ls
98 mpremote cat boot.py
99 mpremote cp :main.py .
100 mpremote cp main.py :
101 mpremote cp -r dir/ :
102 mpremote sha256sum :main.py
103 mpremote mip install aioble
104 mpremote mip install github:org/repo@branch
105 mpremote mip install gitlab:org/repo@branch