Skip to main content

Communicate and transfer files from and to MicroyPython boards via REPL

Project description

docs: https://mpy-repl-tool.readthedocs.io/en/latest

Transfer files via Python REPL (Read Evaluate Print Loop). This tool was developed to transfer files from and to MicroPython boards.

This is yet an other tool, there are now several similar tools but not all have the same features.

Key features of this one:

  • detect serial ports and MicroPython boards.

  • run temporary scripts.

  • pull get files and directories from the target filesystem.

  • push files and directories on the target filesystem.

  • mount target as filesystem (FUSE).

  • --interactive mode (terminal).

  • set RTC

  • All of the above, and more, via the serial REPL connection to a MicroPython board.

Usage

Here is the output of python3 -m there --help:

usage: __main__.py [-h] [-p PORT] [-b BAUDRATE] [-c COMMAND] [-i]
                  [--reset-on-connect] [--reset] [-u USER] [-w PASSWORD] [-v]
                  [--develop]
                  {detect,run,ls,hash,cat,pull,push,rm,df,mount} ...

Do stuff via the MicroPython REPL

positional arguments:
  {detect,run,ls,hash,cat,pull,push,rm,df,mount}
                        sub-command help
    detect              help locating a board
    run                 execute file contents on target
    ls                  list files
    hash                hash files
    cat                 print contents of one file
    pull                file(s) to copy from target
    push                file(s) to copy onto target
    rm                  remove files on target
    df                  Show filesystem information
    mount               Make target files accessible via FUSE

optional arguments:
  -h, --help            show this help message and exit
  -p PORT, --port PORT  set the serial port
  -b BAUDRATE, --baudrate BAUDRATE
                        set the baud rate
  -c COMMAND, --command COMMAND
                        execute given code on target
  -i, --interactive     drop to interactive shell at the end
  --reset-on-connect    do a soft reset as first operation (main.py will not
                        me executed)
  --reset               do a soft reset on the end
  -u USER, --user USER  response to login prompt
  -w PASSWORD, --password PASSWORD
                        response to password prompt
  -v, --verbose         show diagnostic messages, repeat for more
  --develop             show tracebacks on errors (development of this tool)

The -c option executes the given string after running all the actions. The -i option enters a miniterm session at the end of all other actions.

The tool automatically selects a USB port for communication, it may take the wrong one if multiple USB serial devices are connected. In that case, use there detect to list all devices and then -p PORT to specify the port to use on the other calls.

Use python3 -m there <action> --help to get help on sub-commands.

Requirements

This tool requires Python 3.

It depends on pySerial for communication and the mount function requires fusepy. Those dependencies are automatically installed when using pip, see installation notes in documentation.

Project details


Download files

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

Source Distribution

mpy-repl-tool-0.9.tar.gz (41.9 kB view details)

Uploaded Source

Built Distribution

mpy_repl_tool-0.9-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file mpy-repl-tool-0.9.tar.gz.

File metadata

  • Download URL: mpy-repl-tool-0.9.tar.gz
  • Upload date:
  • Size: 41.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.18.1 setuptools/36.0.1 requests-toolbelt/0.8.0 tqdm/4.14.0 CPython/2.7.12

File hashes

Hashes for mpy-repl-tool-0.9.tar.gz
Algorithm Hash digest
SHA256 65401cc6651e995a52cbe0f4b91828906ecb4e0736cff48f07dd97733e605a2e
MD5 3cd8ead484f8cd73110d3203041222e8
BLAKE2b-256 2a45b4ce2bb0bff114cf9e74829aeaf11b9fa968687e1074596c5410b5e28038

See more details on using hashes here.

File details

Details for the file mpy_repl_tool-0.9-py3-none-any.whl.

File metadata

  • Download URL: mpy_repl_tool-0.9-py3-none-any.whl
  • Upload date:
  • Size: 33.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.18.1 setuptools/36.0.1 requests-toolbelt/0.8.0 tqdm/4.14.0 CPython/2.7.12

File hashes

Hashes for mpy_repl_tool-0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 08c598ae56d152da07cc48edaedd1d2f2fa344c309ddf5c20b954f87fca03392
MD5 ac19ac6b68e719b99432ec4dcdce23d1
BLAKE2b-256 0fa133a23b68173c4af19dd73918d0143e6c4e1b45aaba3e39d58b0486b91853

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page