CLI tool to synchronise and manage files on a MicroPython running device.
mpbridge
must be installed with sudo
or administrator
level of permission in order to be accessible from terminal:
cmd.exe
or powershell.exe
as administrator and run pip install -U mpbridge
.sudo pip install -U mpbridge
.You can use mpbridge
in several ways based on your needs:
mpbridge bridge [PORT]
.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.mpbridge sync [PORT] [DIR_PARH]
.MicroPython
board. The sync process will push
all modified files and folders into board and also pull changes from board and exits.mpbridge
will choose the local version of file automatically and
overwrites it on connected board.--use-hashtable
which allows mpbridge to cache calculated hashes
on remote device. By using hashtable you won't be able to track files which are modified by remote
device because hash is calculated at uploading stage.mpbridge dev [PORT] [DIR_PARH]
.MicroPython
device as below:
--no-prompt
option to speed things:
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.DIR_PATH
.--auto-reset
option which can be set to
soft
(soft reset) or hard
(hard reset).--use-hashtable
But you won't be able to track files which are modified
by remote device itself. Use this option if only host is modifying files.mpbridge clear [PORT]
.MicroPython
board and exits.mpbridge list
.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
).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.mpbridge.ignore
only supports specifying file and directory paths directly.dir1/
.sync
with --dry-run
flag can be helpful for debugging your ignore files.