Skip to main content

MicroPython deployment & synchronization tool for Raspberry Pi Pico

Project description

Pico Sync Tool

Pico Sync โ€” a compact CLI tool for convenient work with Raspberry Pi Pico / Pico W running MicroPython. Provides commands for file synchronization, file system browsing, basic file operations on the device, log monitoring, and board reset.

Works on top of mpremote. Supports interactive mode with menus, fzf, language selection (UA/EN).

The tool's goal is to make MicroPython development feel as close to working with a local project as possible.

Features:

  • ๐Ÿ”„ Sync โ€” upload files to Pico (src/ or root)
  • ๐Ÿง  SHA-sync โ€” only changed files are uploaded (SHA-256)
  • ๐Ÿ—‘ Auto-delete extra files โ€” files on Pico that don't exist locally are removed
  • ๐Ÿงผ Empty directory cleanup โ€” after sync
  • โ›” .picoignore โ€” file ignoring (like .gitignore)
  • ๐Ÿ“‚ File viewing and editing โ€” interactive browser (pick) or --ls/--cat/--edit (CLI)
  • ๐Ÿ” Auto-detect port โ€” find Pico among serial ports: first by device name (if .piconame is set), then by saved port, otherwise โ€” first available Pico
  • ๐Ÿ”Œ Serial monitor โ€” live log viewer from Pico
  • ๐Ÿ” Reboot โ€” software board reset
  • ๐ŸŒ Interface language โ€” Ukrainian / English
  • ๐Ÿ“ฆ Project management โ€” save projects with settings

๐ŸŒ ะฃะบั€ะฐั—ะฝััŒะบะฐ ะฒะตั€ัั–ั

๐Ÿ“– Details: interactive mode (pick) ยท CLI mode

PyPI version CI


Table of Contents


Installation

Linux

Recommended (pipx):

pipx install pico_sync

Isolation in a separate environment, doesn't pollute the system.

Alternative (pip):

pip install pico_sync

Can use --user:

pip install --user pico_sync

Windows

Via pip:

pip install pico_sync

Requires Python 3.7+ installed and added to PATH.

Via pipx:

pipx install pico_sync

macOS

Via pip:

pip3 install pico_sync

Via pipx:

pipx install pico_sync

From GitHub (any OS)

git clone https://github.com/toldk98/pico_sync.git
cd pico_sync
pip install .

Portable version (no installation)

git clone https://github.com/toldk98/pico_sync.git
cd pico_sync
pip install pyserial mpremote
python pico_sync_portable.py

Dependencies

  • Python 3.7+
  • pyserial โ€” serial port communication
  • mpremote โ€” execute commands on Pico

Optional dependencies (for interactive mode)

  • fzf โ€” convenient menu selection. If not installed, numbered selection is used.

Usage

Launch

  • Pick: picosync or picosync --pick. Opens a menu with fzf (or numbered selection). โ†’ details
  • CLI: picosync <options>. Action flags without interactivity. โ†’ details

Start screen / Help

  • Pick: list of saved projects + [+] add project, [-] remove project, [s] settings, [q] quit. Select project โ†’ main menu.
  • CLI: picosync --help โ€” all options; picosync project --help โ€” project management.

Sync

  • Pick: [d] device โ†’ sync โ†’ filter selection from menu (all/py/py+/nopy/custom).
  • CLI: picosync --sync [--filter py|py+|nopy|.ext,.ext2].

Algorithm (shared by both modes):

  1. Load .picoignore from project root
  2. Take a snapshot of all files on Pico
  3. Walk the local directory (src/ or root), collect files for sync (skip ignored and .piconame)
  4. Run SHA-256 on all Pico files in one request
  5. Compare hashes: match โ†’ skip, missing โ†’ upload, different โ†’ update
  6. Delete files on Pico without local match (respecting filter)
  7. Clean empty directories

Files (view, edit, delete)

  • Pick: [f] files โ€” browser with directory navigation, [*] find โ€” search all files; cat/edit/rm in file context menu. Editor: nano/vim (Linux), TextEdit (macOS), notepad (Windows). โ†’ details
  • CLI: picosync --ls / โ€” list root; picosync --ls /spm โ€” list directory; picosync --cat /main.py โ€” content; picosync --edit /config.py โ€” editing. โ†’ details

Serial monitor

  • Pick: [d] device โ†’ monitor
  • CLI: picosync --monitor

Exit: Ctrl+C. Auto-reconnect on reboot/port change.

Reboot

  • Pick: [d] device โ†’ reboot
  • CLI: picosync --reboot

Software reset via mpremote reset.

Device name (piconame)

  • Pick: [c] config โ†’ port_settings โ†’ piconame โ†’ detect (read from Pico), set (write new), clear (delete + clear config).
  • CLI: picosync --set-name <name> โ€” writes /.piconame to Pico and saves to config.

Project settings

  • Pick: [c] config โ†’ port_settings/baud/piconame/init.
  • CLI: picosync --port /dev/ttyACM0 --sync, picosync --init, picosync --search_port.

Project management

  • Pick: start screen โ€” [+] add project (enter path), [-] remove project (select from list). โ†’ details
  • CLI: picosync project list, picosync project add /path, picosync project remove <name>. โ†’ details

Global settings

  • Pick: [s] settings โ†’ [~] lang (switch UA/EN), [!] check update (check for updates). โ†’ details
  • CLI: picosync --lang ua/en, picosync --check_update, LANG=ua / LANG=en โ€” environment variable. โ†’ details

Configuration

Global settings

File: ~/.config/pico_sync/settings.json

{
  "language": "ua"
}
  • language โ€” interface language: "ua" or "en". Auto-detected: first from file, then from $LANG (if uk* โ†’ "ua", otherwise โ†’ "en"). Changed:
    • Pick: [s] settings โ†’ [~] lang
    • CLI: --lang ua/en
    • Shared: LANG=ua / LANG=en

Project system

File: ~/.config/pico_sync/projects.json

{
  "projects": [
    {
      "name": "my-project",
      "root": "/home/user/projects/my-project",
      "last_used": "2026-06-29T12:00:00"
    }
  ]
}

Each project contains:

  • name โ€” name (basename of root directory)
  • root โ€” absolute path to root
  • last_used โ€” last used date (ISO 8601)

Projects are sorted by last_used descending.

Project file .picosyncconfig

File: <project_root>/.picosyncconfig

{
  "port": "",
  "filter": "all",
  "piconame": ""
}
Field Type Description
port str Pico port (e.g. /dev/ttyACM0). Empty = auto-detect
filter str Sync filter: all, py, py+, nopy, .ext,.ext2
piconame str Device name for name-based search. Empty = not used

Created:

  • Pick: [c] config โ†’ init
  • CLI: picosync --init

.picoignore

Works like .gitignore. Examples:

# ignore secret.py
secret.py

# ignore entire directory
data/

# ignore by extension
*.mpy

Supports:

  • * โ€” any number of characters
  • ? โ€” single character
  • [abc] โ€” character from set
  • ** โ€” any nesting level
  • ! โ€” negation (don't ignore)
  • Lines without / apply to all levels; with / โ€” to a specific path

Default .picoignore:

__pycache__/
*.pyc
.git/
.DS_Store
Thumbs.db
dist/
*.egg-info/
build/
.idea/
*.swp
*.swo

Port

The tool finds Pico in this order:

  1. By .piconame (if set) โ€” iterates all Pico ports, reads /.piconame from each
  2. By port from config โ€” uses saved port
  3. Auto-detect โ€” finds first device with Raspberry Pi USB ID (0x2E8A)
  4. If nothing found:
    • Pick: [c] config โ†’ port_settings โ†’ port for manual selection
    • CLI: picosync --search_port for manual selection

Piconame

Optional device name stored in /.piconame on Pico. Allows identifying a specific board when multiple Picos are connected.

Management:

  • Pick: [c] config โ†’ port_settings โ†’ piconame with options detect (read from Pico), set (write new), clear (delete from Pico and clear config)
  • CLI: picosync --set-name <name> โ€” write name to Pico and save to config

.piconame is automatically excluded from sync (not deleted, not uploaded).

Sync filters

Only affect deletion of extra files from Pico. All files are uploaded regardless of filter.

Filter Description
all All files (deletes extras on Pico)
py Only .py
py+ .py, .txt, .json
nopy Everything except .py
.ext,.ext2 Custom comma-separated extensions

FAQ

Pico not found / port not detected

Make sure Pico is connected with a USB cable (not just power). If auto-detect fails:

  • Pick: [c] config โ†’ port_settings โ†’ port for manual selection from serial port list
  • CLI: picosync --search_port for interactive selection from serial port list

Two Picos connected simultaneously

Auto-detect picks the first one found. To work with a specific device:

  • Pick: [c] config โ†’ port_settings โ†’ piconame โ†’ set, give it a unique name
  • CLI: picosync --set-name <name>, give it a unique name

How to install fzf?

fzf is an optional tool for convenient menu navigation in interactive mode. Without it, numbered input works. Not needed for CLI mode.

Files not syncing

Check .picoignore โ€” the file might match an ignore rule. If src/ exists in root, it is synced; otherwise, the root.

Error "No module named 'pyserial' / 'mpremote'"

Install dependencies: pip install pyserial mpremote (only relevant for portable version without package installation).

How to update Pico Sync?

Check for updates: [s] settings โ†’ [!] check update (pick) or picosync --check_update (CLI). Shows newer version, changelog, and links but does not update automatically.

Install update:

  • Via pipx: pipx upgrade pico_sync
  • Via pip: pip install --upgrade pico_sync

How to get full help?

CLI: picosync --help, picosync project --help

In pick mode, all available actions are shown in the menu.

License

AGPL-3.0

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

pico_sync-1.1.4.tar.gz (53.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pico_sync-1.1.4-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

File details

Details for the file pico_sync-1.1.4.tar.gz.

File metadata

  • Download URL: pico_sync-1.1.4.tar.gz
  • Upload date:
  • Size: 53.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pico_sync-1.1.4.tar.gz
Algorithm Hash digest
SHA256 48e0c8517c64705163f601b91473803feacc741ea33cd7bcfee9ed1d5ff5d3eb
MD5 1cabda54eda31de3f7198a8bbbab7b7a
BLAKE2b-256 c7f4c27f66608640e316ca0bc246e31d942460d4b37547556a08ecac4b18775e

See more details on using hashes here.

File details

Details for the file pico_sync-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: pico_sync-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 44.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pico_sync-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1f578aaae38fdf4b8285a3e1b8783c2c9aa0de84bf7dd194ddf93a9231048c79
MD5 7421b6291de97d87afb12f6a3ec14fad
BLAKE2b-256 ae5f61f40e5b480742863f7b389e122af0c57588654f6020c840e0da4012862f

See more details on using hashes here.

Supported by

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