Skip to main content

A client-server application for remotely sharing USB devices with usbip

Project description

CI Coverage PyPI License

usb-remote

Client-server software to share USB devices over the network.

Source https://github.com/epics-containers/usb-remote
PyPI pip install usb-remote
Docker docker run ghcr.io/epics-containers/usb-remote:latest
Documentation https://epics-containers.github.io/usb-remote
Releases https://github.com/epics-containers/usb-remote/releases

Multi-Server Configuration

You can configure usb-remote to scan multiple USB device servers automatically. The client discovers configuration files in the following priority order:

  1. Environment variable: USB_REMOTE_CONFIG=/path/to/config.yaml
  2. Project-local config: .usb-remote.config in current directory
  3. User config: ~/.config/usb-remote/usb-remote.config (default)

Create a configuration file with the following format:

servers:
  - localhost
  - raspberrypi
  - 192.168.1.100
  - usb-server-1.local

# Optional: Connection timeout in seconds (default: 5.0)
timeout: 5.0

See usb-remote.config.example for a sample configuration file.

Config File Discovery Examples

# Use default config from ~/.config/usb-remote/usb-remote.config
usb-remote list

# Use project-specific config from current directory
cd /path/to/project
echo "servers: [myserver]" > .usb-remote.config
usb-remote list

# Use environment variable (useful in CI/CD)
export USB_REMOTE_CONFIG=/etc/usb-remote/production.config
usb-remote list

Connection Timeout

The timeout setting controls how long to wait when connecting to each server before giving up. This prevents the client from hanging when a server is unreachable. The default is 5 seconds, but you can adjust it based on your network conditions:

  • Fast local network: Use a shorter timeout (e.g., 2.0 seconds)
  • Slow or remote servers: Use a longer timeout (e.g., 10.0 seconds)

When a server times out, it's logged as a warning and skipped, allowing other servers to be queried.

Behavior

  • list: Without --host, queries all configured servers and displays devices grouped by server
  • attach/detach: Without --host, scans all servers to find a matching device
    • Fails if no match is found across all servers
    • Fails if multiple matches are found across different servers (unless --first is used)
    • Succeeds if exactly one match is found (reports which server it was found on)
    • With --first flag: Attaches the first matching device found, even if multiple servers have matching devices
  • --host flag: When specified, only queries that specific server (ignores config file)

Examples

# List devices on all configured servers
usb-remote list

# List devices on a specific server
usb-remote list --host raspberrypi

# Attach a device (scans all servers, fails if multiple matches)
usb-remote attach --desc "Camera"

# Attach first matching device across servers
usb-remote attach --desc "Camera" --first

# Attach a device from a specific server
usb-remote attach --desc "Camera" --host 192.168.1.100

# Detach with first match (if same device attached from multiple servers)
usb-remote detach --desc "Camera" --first

Installing as a Service

You can install the usb-remote server as a systemd service to run automatically at boot.

System Service (Recommended)

Install as a system service (runs at boot, before login):

# Install as system service (requires sudo)
sudo usb-remote install-service --system

# Enable and start
sudo systemctl enable usb-remote.service
sudo systemctl start usb-remote.service

# Check status
sudo systemctl status usb-remote.service

User Service (Not Recommended)

Install as a user service (runs when you log in) useful for testing if you don't have sudo access:

# Install the service
usb-remote install-service

# Enable it to start on login
systemctl --user enable usb-remote.service

# Start the service now
systemctl --user start usb-remote.service

# Check status
systemctl --user status usb-remote.service

# View logs
journalctl --user -u usb-remote.service -f

Uninstalling

# Uninstall user service
usb-remote uninstall-service

# Uninstall system service (requires sudo)
sudo usb-remote uninstall-service --system

See https://epics-containers.github.io/usb-remote for more detailed documentation.

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

usb_remote-2.1.0b3.tar.gz (136.7 kB view details)

Uploaded Source

Built Distribution

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

usb_remote-2.1.0b3-py3-none-any.whl (27.9 kB view details)

Uploaded Python 3

File details

Details for the file usb_remote-2.1.0b3.tar.gz.

File metadata

  • Download URL: usb_remote-2.1.0b3.tar.gz
  • Upload date:
  • Size: 136.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for usb_remote-2.1.0b3.tar.gz
Algorithm Hash digest
SHA256 a06db1edb7e188dce6712806adc7f48ecbfefefd7a452ab6bd9359ca1fca6127
MD5 1c1ea138a4e58a8b11a3e73c75f28595
BLAKE2b-256 bd9d8aba5b3ad445788f848c8c74a206b713d4731fcf3314f4fe212e34cab93a

See more details on using hashes here.

File details

Details for the file usb_remote-2.1.0b3-py3-none-any.whl.

File metadata

  • Download URL: usb_remote-2.1.0b3-py3-none-any.whl
  • Upload date:
  • Size: 27.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for usb_remote-2.1.0b3-py3-none-any.whl
Algorithm Hash digest
SHA256 a0c457414c60d6e4796739a7eb77b7f564da334a9088e042f7fa7467656399ef
MD5 26ac97a2e30e86a98d432b1070a4ddc8
BLAKE2b-256 a7874d62fd45b624ba698d8522af29762f764edcda64b8cc5765f610d3568f90

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