Skip to main content

File System Bridge to facilitate working with files on Micropython devices

Project description

📂 MPBridge Python Version PyPI Version GitHub Workflow Status PyPI - Downloads

CLI tool to synchronise and manage files on a MicroPython running device.

📥 Installation

mpbridge must be installed with sudo or administrator level of permission in order to be accessible in terminal:

  • Windows : Open cmd.exe as administrator and run pip install -U mpbridge
  • Linux / MacOS : Run sudo pip install -U mpbridge

🪄 How to use

You can use mpbridge in several ways based on your needs:

⚜️ Bridge Mode

  • Run mpbridge bridge <PORT>
  • This mode copies all files and folders from your MicroPython board into a temporary directory on your local device and listens for any filesystem events on local directory to apply them on your board. It keeps raw repl open, so you cannot use serial port in other applications simultaneously.

⚜️ Sync Directory

  • Run mpbridge sync <PORT> <DIR_PARH>
  • This command syncs a specified local directory with a MicroPython board. The sync process will push all modified files and folders into board and also pull changes from board and exits.
  • If a conflict occurs, mpbridge will choose the local version of file automatically and overwrites it on connected board.

⚜️ Development Mode

  • Run mpbridge dev <PORT> <DIR_PARH>
  • This mode repeats a loop of tasks in specified directory on MicroPython device as below:
    • SyncPrompt to enter REPLClean SyncStart MicroPython REPL
  • You can also disable prompt with--no-prompt option to speed things:
    • Clean SyncStart MicroPython REPL
  • This mode is useful when you keep switching between different tools to flash and run new codes repeatedly. You can specify your project directory as DIR_PATH and mpbridge will take care of changes when you are developing your project in your desired IDE. You can switch to MicroPython REPL anytime you wish to run the updated code on your board.
  • Automatic reset before entering MicroPython REPL can be enabled with --auto-reset option which can be set to soft (soft reset) or hard (hard reset).

⚜️ Delete all files

  • Run mpbridge clear <PORT>
  • This command deletes all files and directories from MicroPython board and exits.

⚜️ List all connected devices

  • Run mpbridge list
  • This command lists all connected devices.

Note : <PORT> can be the full port path or one of the short forms below :

  • c[n] for COM[n] (c3 is equal to COM3)
  • u[n] for /dev/ttyUSB[n] (u3 is equal to /dev/ttyUSB3)
  • a[n] for /dev/ttyACM[n] (a3 is equal to /dev/ttyACM3)

👀 Ignore files

You can inform mpbridge to ignore syncing specific files or directories. This is useful when you don't want to sync some directories like .git/ or venv/ with your board. To use this feature create a file named mpbridge.ignore in your project directory and specify list of files and directories:

.git/
venv/
tests/test_1.py
tests/test_2.py
  • mpbridge.ignore syntax is not as same as .gitignore files.
  • At this time mpbridge.ignore only supports specifying file and directory paths directly.
  • You should add a slash at the end of directory names: dir1/

✅ Supported platforms

  • Windows
  • MacOS
  • Linux
  • FreeBSD/BSD

📦 Dependencies

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

mpbridge-1.3.2.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

mpbridge-1.3.2-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file mpbridge-1.3.2.tar.gz.

File metadata

  • Download URL: mpbridge-1.3.2.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for mpbridge-1.3.2.tar.gz
Algorithm Hash digest
SHA256 2c72e1cfd49337af751c3668a596be3655ec2ac00b773df905d221f9678f49cf
MD5 ebe31ec763d5664bff20e91439787401
BLAKE2b-256 57284baf87354c190656e0aa73b59e74955fa282461d4193c68242bed7c2bec9

See more details on using hashes here.

File details

Details for the file mpbridge-1.3.2-py3-none-any.whl.

File metadata

  • Download URL: mpbridge-1.3.2-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for mpbridge-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e32a42f555190541c225ad97c636b89fb28bf938c642191ebff22e97fd79bd7b
MD5 de125bef2edc529ad176906d52d62ba4
BLAKE2b-256 8baef16e10c7a64f5a8e9b9aeba4521dd8652c398821f38ce29a5bbdaa481edd

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