Skip to main content

PicoLynx - Attach Microcontrollers to WSL

PicoLynx is a Windows-only TUI (Text-based User Interface) application for attaching and detaching microcontroller devices to WSL (Windows Subsystem for Linux) distributions. It monitors Windows WM_DEVICECHANGE messages with pywin32 and leverages usbipd-win to manage device connections.

The TUI will react to USB Serial and USB Storage device connections and can run usbipd-win commands on any device in its interface.

PicoLynx TUI

PicoLynx TUI

PicoLynx TUI

https://github.com/user-attachments/assets/d5382270-cae8-4eb4-90a6-28ccb96e5250

[!NOTE] If a device is disconnected when attached to WSL or a USB mass storage device is safely removed, it will remain in the connected device table. WM_DEVICECHANGE events under these circumstances are not granular enough, but a manual detach ('d' press) or refresh ('r' press) will trigger an update.

Features

  • Manual control: Easily attach, bind, detach, or unbind devices using keyboard shortcuts.
  • Live device table: View connected and persisted devices in real time.
  • Windows message monitoring: Reacts instantly to hardware changes.
  • Thread-safe: Ensures safe device operations even with concurrent events.
  • Beautiful TUI: Built with Textual for a modern terminal experience & many theme options.
  • Auto-detect: Detects devices as they are connected & disconnected.
  • Auto-attach (TODO): Auto-attachment of persisted devices on connection.

Requirements

Windows 10/11 is the only supported platform, given the nature of this package. PicoLynx requires administrator privileges to interact with USB/Serial devices. If not run as administrator, it will prompt for elevation.

Install usbipd-win

This tool enables sharing locally connected USB devices to other machines, including Hyper-V guests and WSL 2. Full instructions are available at usbipd-win Github. Window package manager can be used to install the tool:

winget install usbipd

Install WSL

Microsoft WSL documentation is available @ learn.microsoft.com. The following Windows features are required, which can be enabled by searching for 'Turn Windows features on or off' in the Start Menu:

  • Virtual Machine Platform
  • Windows Hypervisor Platform
  • Windows Subsystem for Linux

Its worth updating WSL if newly enabled:

wsl --update

To install a Linux distribution, refer to the guide listed above, or see my Void Linux & Alpine Linux WSL repo guides for an example of a manual distro installation.

PicoLynx Installation

Astral uv package manager is recommended for a fast, isolated, and reliable install. To install uv, use the following command:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

You can install PicoLynx globally with the following uv command:

uv tool install picolynx

Or:

uv tool install "git+https://github.com/andyrids/picolynx.git"

You can run PicoLynx without installing, by running the following command:

uvx picolynx

Or:

uvx "git+https://github.com/andyrids/picolynx.git"

Keyboard Shortcuts

The TUI command palette can be opened with ctrl + p, which has options for theme changes and the full command help panel. Tabs can be navigated and switched to with the tab key and tables can be traversed with the arrow keys.

Key Action
a Attach
b Bind
d Detach
u Unbind
r Refresh

Select a device in the table and press the corresponding key to perform the action.

Development

Clone the repository and enter the picolynx directory.

git clone git@github.com:andyrids/picolynx.git
cd picolynx

The just command runner (GitHub page) is a handy way to save and run project-specific commands, which are written in a file called justfile.

If you use just, you can add use the commands below to run PicoLynx in development mode, with the textual console integration.

This command uses uv to sync the package dependencies and create a .venv:

just sync

Alias for:

uv sync

Running the command below in one terminal, will activate the textual console, which listens to a running textual app in --dev mode:

just console

Alias for:

uv run textual console -x EVENT -x SYSTEM

Running this command will run PicoLynx in development mode, with a logging level set to 'DEBUG'.

just dev

Alias for:

uv run textual run --dev src/picolynx/__main__.py --log-level DEBUG

The logging level can be modified in with a --log-level option, which takes the following choices; 'DEBUG', 'INFO', 'WARNING' (default), 'ERROR' & 'CRITICAL'.

uv run textual run --dev src/picolynx/__main__.py --log-level INFO

Acknowledgements

Metadata

Release files for picolynx 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for picolynx 0.1.2
File Size Uploaded
picolynx-0.1.2.tar.gz 4.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for picolynx 0.1.2
File Interpreter ABI Platform
picolynx-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 4.5 MB

Release files / picolynx-0.1.2.tar.gz

Download URL picolynx-0.1.2.tar.gz
Size 4.4 MB
Tags Source
SHA-256 checksum
How to use checksums
89807a0e4558a5788bc8ffa83115ff9c063eba80a9d1081da60ff0bf942d7911
BLAKE2b-256 checksum
How to use checksums
7339e267dd7fdd9234fab1bed53b48817dee2bcb3f8e62ac0a790e83c3accf8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / picolynx-0.1.2-py3-none-any.whl

Download URL picolynx-0.1.2-py3-none-any.whl
Size 38.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
77a0ce20426251b30933cf801fdec689e2856d966447c572c3636869a070e493
BLAKE2b-256 checksum
How to use checksums
13f0092b64486a20463eca074c37554a8e82e17b18bc4eb77ae3aca9986ad692
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page