Wykres commitów

25 Commity (12ca918eb2ac062f6e6df0772e528eef9d050cb7)

Autor SHA1 Wiadomość Data
Jim Mussared 12ca918eb2 tools/mpremote: Add `mpremote mip install` to install packages.
This supports the same package sources as the new `mip` tool.
 - micropython-lib (by name)
 - http(s) & github packages with json description
 - directly downloading a .py/.mpy file

The version is specified with an optional `@version` on the end of the
package name. The target dir, index, and mpy/no-mpy can be set through
command line args.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-01 22:44:24 +10:00
Jim Mussared 68d094358e tools/mpremote: Use argparse for command line parsing.
No functional change other than to allow slightly more flexibility in how
--foo arguments are specified.

This removes all custom handling for --foo args in all commands and
replaces it with per-command argparse configs.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-01 22:44:24 +10:00
Jim Mussared 413a69b94b tools/mpremote: Simplify dispatch of commands.
No functional change.

This makes each built-in command defined by just a handler method and
simplifies a lot of the logic around tracking the board state.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-01 22:44:24 +10:00
Damien George 2e386bcf76 tools/mpremote: Print nicer errors for unsupported 'cp -r' arguments.
Also document support for 'cp :a :b'.

Signed-off-by: Damien George <damien@micropython.org>
2022-08-26 13:30:03 +10:00
Damien George 858707181d tools/mpremote: Print a nicer error when a filesystem command fails.
Signed-off-by: Damien George <damien@micropython.org>
2022-08-26 13:30:03 +10:00
Jim Mussared 59e3348c10 tools/mpremote: Add "edit" command.
This allows a remote file to be edited locally by copying it over, running
the local editor, then copying it back.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-18 22:29:13 +10:00
Jim Mussared a311e9e3d4 tools/mpremote: Allow + terminator for fs commands.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-18 22:22:36 +10:00
Damien George 80bc9b3dee tools/mpremote: Don't be verbose when using cat command.
Fixes issue #8828.

Signed-off-by: Damien George <damien@micropython.org>
2022-07-08 22:28:26 +10:00
Damien George 646fcdadbf tools/mpremote: Add command to print the version.
Signed-off-by: Damien George <damien@micropython.org>
2022-06-07 23:22:04 +10:00
Rob Knegjens d3d862769a tools/mpremote: Add option to mount cmd to allow "unsafe" symlinks.
Specifying the option `--unsafe-links` (or `-l`) to `mpremote mount` will
allow symlinks to be followed in the local directory that point outside of
the base directory path.

For the unsafe case the `path_check()` method of `PyboardCommand` still
checks for a common path but without expanding symlinks.  While this check
is currently redundant, it makes the purpose of the method clearer for
possible future uses or extensions.
2022-04-11 15:15:04 +10:00
Rob Knegjens 56978c3dde tools/mpremote: Show progress indicator when copying large files.
When copying large files (> 2048 bytes) to or from a device with
`mpremote cp` a progress bar and percentage counter are temporarily shown.
2022-04-11 15:04:20 +10:00
Damien George d6564a3159 tools/mpremote: Add "umount" command.
Signed-off-by: Damien George <damien@micropython.org>
2022-02-25 13:10:45 +11:00
Damien George ad1f523e7e tools/mpremote: Add "resume" and "soft-reset" commands.
This makes the auto soft-reset behaviour of mpremote more logical, and now
configurable via these new commands.

Signed-off-by: Damien George <damien@micropython.org>
2022-02-25 13:09:28 +11:00
Damien George fecfd52696 tools/mpremote: Fix special handling of ctrl-D when host FS is mounted.
Changes are:
- decision to remount local filesystem on remote device is made only if
  "MPY: soft reboot" is seen in the output after sending a ctrl-D
- a nice message is printed to the user when the remount occurs
- soft reset during raw REPL is now handled correctly

Fixes issue #7731.

Signed-off-by: Damien George <damien@micropython.org>
2022-02-07 13:21:29 +11:00
Andrew Leech b1519845f5 tools/mpremote: Accept both --help and help to show usage. 2022-02-04 15:11:04 +11:00
Andrew Leech 1f84440538 tools/mpremote: Fix "fs cp -r" on Windows.
A backslash in the directory name will end up being passed through to the
device and becoming a backslash in a filename, rather than being
interpreted as directories.  This makes "cp -r" problematic on Windows.
Changing to simply "/",join() fixes this.
2022-02-04 14:58:29 +11:00
Damien George ce4f8b49ce tools/mpremote: Use machine instead of umachine in commands.
Because bare-metal boards will have machine but not always umachine.

Signed-off-by: Damien George <damien@micropython.org>
2022-01-20 16:35:49 +11:00
Damien George 028776d97b tools/mpremote: Add link to mpremote docs URL in help message.
Signed-off-by: Damien George <damien@micropython.org>
2021-12-29 23:35:24 +11:00
Sergei Silnov 74e995dfd2 tools/mpremote: Add help command.
Fixes issue #7480
2021-12-29 09:46:33 +01:00
Damien George 162bf3c5d8 tools/mpremote: Add "devs" shortcut for "connect list".
See issue #7480.

Signed-off-by: Damien George <damien@micropython.org>
2021-08-14 00:13:35 +10:00
Damien George 1f48934312 tools/mpremote: Fix connect-list in case VID/PID are None.
Which can be the case on Windows and macOS for certain serial devices.

Fixes issue #7636.

Signed-off-by: Damien George <damien@micropython.org>
2021-08-14 00:13:35 +10:00
Andrew Scheller d1decdfa93 tools/mpremote: Swap order of PID and VID in connect-list output.
Fixes issue #7481.
2021-07-02 23:27:07 +10:00
Damien George d2dcd05adc tools/mpremote: Use signal to capture and handle ctrl-C on Windows.
Now a ctrl-C will not stop mpremote, rather this character will be passed
through to the attached device.

The mpremote version is also increased to 0.0.5.

Signed-off-by: Damien George <damien@micropython.org>
2021-06-15 13:52:31 +10:00
Damien George 77c529e8be tools/mpremote: Use available ports instead of auto-connect list.
Using just the list of available ports, instead of a hard-coded list of
possible ports, means that all ports will be available for auto connection.
And the order that they will be attempted in will match what's printed by
"mpremote connect list" (and will be the same as before, trying ACMx before
USBx).  Auto-connect will also now work on Mac, and will allow all COM
ports on Windows.

Signed-off-by: Damien George <damien@micropython.org>
2021-06-15 13:52:31 +10:00
Damien George a60ad33641 tools/mpremote: Add new CLI utility to interact with remote device.
This has been under development since April 2017.  See #3034 and #6375.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-29 17:17:22 +10:00