Install the agent on a USB/IP host#
The agent runs on a machine with USB devices (typically a Raspberry Pi) and exposes them over the network via USB/IP. The Kubernetes manager polls agents to discover available devices.
Prerequisites#
A Linux machine (Raspberry Pi OS, Debian, Ubuntu, etc.) with USB devices attached
The
usbipkernel module and userspace tools installedcurlavailable for the install scriptRoot access (the installer creates a systemd service)
Install USB/IP tools#
On Debian/Ubuntu/Raspberry Pi OS:
$ sudo apt-get update && sudo apt-get install -y linux-tools-generic
On Raspberry Pi OS the package may be usbip instead:
$ sudo apt-get update && sudo apt-get install -y usbip
Load the kernel module#
$ sudo modprobe usbip_host
To load the module automatically on boot:
$ echo usbip_host | sudo tee /etc/modules-load.d/usbip_host.conf
Install the agent#
The install script downloads the correct binary for your architecture,
installs it to /usr/local/bin/agent, and creates a systemd service:
$ curl -fsSLO https://raw.githubusercontent.com/DiamondLightSource/dra-usbip-driver/main/scripts/install-agent.sh
$ sudo bash install-agent.sh
To install a specific version:
$ sudo bash install-agent.sh 0.1.0
Verify#
Check that the service is running:
$ sudo systemctl status dra-usbip-agent
The agent serves a device list on port 13240. Test it with:
$ curl http://localhost:13240/devices
Uninstall#
$ sudo systemctl stop dra-usbip-agent
$ sudo systemctl disable dra-usbip-agent
$ sudo rm /etc/systemd/system/dra-usbip-agent.service
$ sudo systemctl daemon-reload
$ sudo rm /usr/local/bin/agent