USB-redirector est un logiciel gratuit, mais pas libre, qui permet de partager un périphérique USB par le réseau, comme le propose USBIP, qui lui est libre.
Liens :
http://www.incentivespro.com/usb-server.html
http://usbip.sourceforge.net/
Pour installer le driver tusbv
, il faut avoir la bonne version du noyau Linux, ainsi que les headers correspondants, qui permettront de compiler le module.
Pour connaitre la version du noyau installé sur la Rpi :
uname -a
Il suffit de chercher la version qui convient sur cette page : https://github.com/Hexxeh/rpi-firmware/commits/master
On cherche le commit Bump 3.10.34
. Il se trouve au 25 Mars 2014.
Il faut récupérer le hash complet du commit qui s'affiche à droite : 707c7000d1cc3bc826120b83fb7e2089d18be064
.
Ce hash va nous servir à préciser à rpi-update quelle version du noyau installer.
sudo rpi-update 707c7000d1cc3bc826120b83fb7e2089d18be064
Il faut regarder sur cette page : http://www.niksula.hut.fi/~mhiienka/Rpi/linux-headers-rpi - Mirroir.
Une fois la version correspondante trouvée, on télécharge le fichier :
wget http://www.niksula.hut.fi/~mhiienka/Rpi/linux-headers-rpi/linux-headers-3.10.34+_3.10.34+-2_armhf.deb
On installe le paquet :
sudo dpkg -i linux-headers-3.10.34+_3.10.34+-2_armhf.deb
Et enfin, on installe les dépendances éventuellement manquantes :
sudo apt-get -f install
Le périphérique USB à partager est branché sur le serveur.
On récupère les sources ARM pour le Raspberry Pi :
mkdir build
cd build
wget http://www.incentivespro.com/usb-redirector-linux-arm.tar.gz
On décompresse et on installe :
tar xzf usb-redirector-linux-arm.tar.gz
cd usb-redirector-linux-arm/
sudo ./installer.sh install-server
*** Installing USB Redirector for Linux v.3.0
*** Destination dir: /usr/local/usb-redirector
*** Checking installation...
*** Detecting system...
*** distribution: debian
*** kernel: 3.10.34+
*** Compiling kernel module...
*** Kernel module succesfully compiled
*** Creating directories...
*** Preparing scripts...
*** Copying files...
*** Setting up init script...
*** Starting daemon...
*** Please allow incoming connections on 32032 port for USB Sever to be able to accept connections from remote clients.
*** INSTALLATION SUCCESSFUL! To uninstall, run /usr/local/usb-redirector/uninstall.sh
On vérifie que ça marche :
sudo files/usbsrv -l
================= USB SERVER OPERATION SUCCESSFUL ===============
List of local USB devices:
1: USB Device vendor_id 0424 - product_id ec00
Vid: 0424 Pid: ec00 Port: 1-1.1
Status: plugged
2: Dell USB Keyboard Dell USB Human Interface Device - Keyboard
Vid: 413c Pid: 2003 Port: 1-1.3
Status: in use by 192.168.10.3
===================== ======================= ===================
On récupère les valeurs Vid, Pid et Port dans le résultat de la commande précédente.
sudo files/usbsrv -share -vid 413c -pid 2003 -usbport 1-1.3
Le client est la machine qui aura accès au périphérique partagé par le serveur.
On récupère les sources pour le client Linux : 32bits - 64 bits - ARM
mkdir build
cd build
wget http://www.incentivespro.com/usb-redirector-linux-$ARCHITECTURE.tar.gz
On décompresse et on installe :
tar xzf usb-redirector-linux-*.tar.gz
cd usb-redirector-linux-*/
sudo ./installer.sh install-client
On vérifie que ça marche :
sudo files/usbsrv -l
Où :
On ajoute le serveur à la liste sur le client:
sudo .files/usbclnt -a $IP:32032
On connecte le client au serveur :
sudo .files/usbclnt -connect -server $IP:32032 -vid $VID -pid $PID -usbport $PORT
On vérifie que le périphérique est reconnu sur le client :
lsusb
./usbclnt
USB Redirector Client for Linux v.3.0
Usage:
usbclnt <command>
Where <command> is one of the following:
-a,-addserver <address:port>
Add remote usb server into configuration.
-r, -remserver <address:port> | <serverid>
Remove remote usb server from configuration and disconnect all devices
from that server.
-c, -connect <server> <device> | <serverid>-<deviceid>
Connect a specified device from a specified server. Server should be
added to your configuration first.
-u, -disconnect <server> <device> | <serverid>-<deviceid>.
Disconnect a specified device on a specified server.
-addexclude <server> <device> | <serverid>-<deviceid>
Add specified device to exclusion list.
-remexclude <server> <device> | <serverid>-<deviceid>
Remove specified device from exclusion list.
-autoconnect on|off <server> [<device>] | <serverid>[-<deviceid>]
Enable or disable automatic connection of a single device or all
devices on the specified server.
-l, -list
Show a list of all usb servers and devices in your configuration.
-i, -info
Show information about the software.
-version
Display software version.
<device> is [-vid <vendorid>] [-pid <productid>] [-usbport <port>]
[-serial <serial>] [-devname "<name>"]
-vid Vendor ID of the USB device.
-pid Product ID of the USB device.
-usbport USB port number as displayed by -list command.
-serial Serial number of USB device.
-devname Device name as displayed by -list command.
The name must be enclosed in double quotes.
<server> is -server <address:port>
-server remote usb server address and port
Examples:
To connect a device by hardware id:
usbclnt -connect -server 192.168.0.10:32032 -vid 0441 -pid 0012 -usbport 3-1
To connect a device by server id and device id:
usbclnt -connect 1-2
To add a server:
usbclnt -addserver 192.168.0.10:32032
Copyright 2007-2013 SimplyCore LLC - Leading USB Solutions
This new unique software product allows to share any USB devices
to use them over local network or Internet.
http://www.incentivespro.com
sudo files/usbsrv
USB Redirector for Linux v.3.0
Usage:
usbsrv <command>
where <command> is one of the following:
-s,-share <device>
Share specified device.
-t,-unshare <device>
Unshare specified device.
-addexclude <device>
Add specified device to exclusion list.
-remexclude <device>
Remove specified device from exclusion list.
-createcallback <address:port>
Create callback connection to remote USB client.
-closecallback <address:port> | <callbackid>
Close callback connection to remote USB client.
-l,-list [devices | clients]
Display a list of all USB devices attached to USB server
or a list of connected clients. Default is to display devices.
-i,-info
Display information about USB server state.
-settcpport <port>
Change TCP port number used to accept incoming connections.
-autoshare on|off
Enable or disable automatic sharing of USB devices.
-nickname "<nickname>" <device>
Set nickname for a device.
Specify empty string to remove nickname.
-timeout <value> <device>
Set inactivity timeout for a device. Timeout value is in seconds.
Set to zero to disable inactivity timeout.
-version
Display software version.
<device> is <deviceid> | [-vid <vendorid>] [-pid <productid>] [-usbport <port>]
[-serial <serial>] [-devname "<name>"]
-vid Vendor ID of the USB device.
-pid Product ID of the USB device.
-usbport USB port number as displayed by -list command.
-serial Serial number of USB device.
-devname Device name as displayed by -list command.
The name must be enclosed in double quotes.
Examples:
To share a device by vid, pid and port number:
usbsrv -share -vid 0441 -pid 0012 -usbport 1-2
To share a device by port number only:
usbsrv -share -usbport 1-2
To share a device by id:
usbsrv -share 8
To enable auto-sharing mode:
usbsrv -autoshare on
To create a callback connection to remote USB client:
usbsrv -createcallback 192.168.0.10:32032
To close a callback connection to remote USB client by id:
usbsrv -closecallback 3
Copyright 2007-2013 SimplyCore LLC - Leading USB Solutions
This new unique software product allows to share any USB devices
to use them over local network or Internet.
http://www.incentivespro.com
Sources : http://www.incentivespro.com/usb-server-usage.html
Compilé le 06-04-2014 - Linux 3.10.34+ : http://fichiers.arthus.net/divers/rpi/usbredirector-binaries-rpi.tar.gz