Skip to main content

a container that mounts remote devices locally using usb-remote

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
Releases https://github.com/epics-containers/usb-remote/releases

Documentation

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

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.0b1.tar.gz (101.2 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.0b1-py3-none-any.whl (27.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: usb_remote-2.1.0b1.tar.gz
  • Upload date:
  • Size: 101.2 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.0b1.tar.gz
Algorithm Hash digest
SHA256 681933b938cbf9dc7b26d08bbf155770a6f7f00d4297d1fa3f32cbc5c19bcfcb
MD5 82c4346e27cb2fd863fdf66ce4c65690
BLAKE2b-256 54efeccc5c290e9e15dd10a43010feb6ef765222056298c7e40a31a88d889596

See more details on using hashes here.

File details

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

File metadata

  • Download URL: usb_remote-2.1.0b1-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.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 212147601c72bcf7efd1f53fc7f1d58f4e32d678caacfbd1ec9a3c29ca356ecb
MD5 21a201ae1f79581b58b65fba700b711b
BLAKE2b-256 13396521a13d2fc3db9472ff0f58dfe5414909d75c0d01422562a4c9b5ac0435

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