https://github.com/keredson/mwrsync
Micropython WebREPL based file sync tool.
https://github.com/keredson/mwrsync
Last synced: 2 months ago
JSON representation
Micropython WebREPL based file sync tool.
- Host: GitHub
- URL: https://github.com/keredson/mwrsync
- Owner: keredson
- License: gpl-3.0
- Created: 2023-03-06T20:47:41.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-13T20:34:39.000Z (over 3 years ago)
- Last Synced: 2025-09-05T03:36:31.064Z (10 months ago)
- Language: Python
- Homepage:
- Size: 27.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mwrsync
Micropython WebREPL based file sync tool.
This tool will sync your Micropython project directory to your Micropython device over WiFi. This is much faster than serial, and requires no additional code on the device (since it uses Micropython's built-in WebREPL).
Install
-------
```
pip install mwrsync
```
On your device, [enable WebREPL](https://docs.micropython.org/en/latest/esp8266/tutorial/repl.html?highlight=webrepl#webrepl-a-prompt-over-wifi) by running `import webrepl_setup` or adding this to your `boot.py`:
```
import webrepl
webrepl.start(password='secret')
```
Usage
-----
```
mwrsync [:] [--port ] [-p|--password ] [--dry_run] [-v|--verbose]
```
Example:
```
$ mwrsync esp32/ 10.0.0.128 -v
Password:
Remote WebREPL version: (1, 19, 1)
copying: test.py
Sent 5 of 5 bytes
```
`--dry-run` will compute changes but not modify the files on the device. `--verbose` will tell you what it's doing.
Ignoring Files
--------------
Add a file `.mwrsyncignore` to the directory you're syncing. It follows `.gitignore` syntax. It will neither copy or delete files that match.
**WARNING:** If you set up WebREPL with `import webrepl_setup`, don't forget to add `webrepl_cfg.py` to `.mwrsyncignore` (or copy it to your project directory). Otherwise you'll disable WebREPL on your next reset.
Speed
-----
On an ESP32 this will hash files at about 272kb/s (on the device). It will transfer changed files at about 110kb/s. Most of the time a sync takes me about 4 seconds.
How It Works
------------
This tool will compute a SHA1 hash of your local files, a SHA1 hash of any files on your device, and copy or remove files until the two match. It only ever modifies files on the device, never locally.
Security
--------
WebREPL sends everything over clear-text (including the password 😓).