File System Bridge to facilitate working with files on Micropython devices
Reason this release was yanked:
There's a bug in version1.0.0 which prevent closing serial port in dev mode.
Project description
📂 MPBridge
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 runpip 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 :- Sync files → Wait for changes (Develop your project) → Sync files → Hard reset → Start 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
andmpbridge
will take care of changes when you are developing your project in your desired IDE. You can switch toMicroPython REPL
anytime you wish to run the updated code on your board.
Note : <PORT>
can be the full port path or one of the short forms below :
c[n]
forCOM[n]
(c3
is equal toCOM3
)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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mpbridge-1.0.0.tar.gz
.
File metadata
- Download URL: mpbridge-1.0.0.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | acbdec8f7f63ef2c565dab55fb98a94aec21de4d2efaa14bcf8c9c7e434e86e3 |
|
MD5 | 6355d73eb4e262260da052d60796ee84 |
|
BLAKE2b-256 | fef2be9c175c1f0eeda1e8396c1c7bf2293542d27857cd0b1432e67f60defe2d |
File details
Details for the file mpbridge-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: mpbridge-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec53f7e36893eb3646adebb1328ee4f1a03aef7ae60fb5030fb2f6a51094b7af |
|
MD5 | 3fd12b4c054d4d1e2feb01ca40da9346 |
|
BLAKE2b-256 | d5beefdc0cae119ec05ffb44eee95366d61b1118f1bfbdce0c3a5db2dcd58c8b |