Page 1 of 1

USB to IP redirect

Posted: Mon Feb 24, 2020 8:44 am
by bigbeer
Hi everybody
There is well-known software for x86 processors. It consists of a usbip utility, usbip-core and usbip-host lkernel modules and usbipd daemon. This software is installed by the "apt-get install linux-tools-"kernel version" command. Is there the same software for nanopi neo2? I did not find anything. Maybe badly searched?
Help me please.

Re: USB to IP redirect

Posted: Sat Feb 29, 2020 7:37 am
by guidol
bigbeer wrote:
Hi everybody
There is well-known software for x86 processors. It consists of a usbip utility,
Help me please.


on armbian I did only find the usbip-package:

Code: Select all

root@npi-neo2 :~# uname -a
Linux npi-neo2-24 5.5.0-sunxi64 #trunk SMP Mon Feb 17 18:21:22 +03 2020 aarch64 GNU/Linux

root@npi-neo2 :~# apt-cache search usbip
usbip - USB device sharing system over IP network


maybe there is more if I had the Linux-headers installed?

Re: USB to IP redirect

Posted: Sat Feb 29, 2020 9:26 am
by bigbeer
Thank you. You did my search in the right direction.
This is output "apt-cache search usbip":

Code: Select all

libusbip-dev - USB device sharing system over IP network (development files)
libusbip0 - USB device sharing system over IP network (shared library)
usbip - USB device sharing system over IP network
usbip-source - USB device sharing system over IP network (kernel module source)

If I understand correctly, kernel modules only exist in the source code and need compilation?

Re: USB to IP redirect

Posted: Tue Mar 03, 2020 4:42 pm
by guidol
you can check that if you only install usbip - if you could fine then the complied modules on your system.

It look like this package does have the modules compiled from the source-package.

Re: USB to IP redirect

Posted: Wed Mar 04, 2020 7:50 am
by bigbeer
That is what I found out:
1. There is a USBIP utility and a USBIPD daemon on my FrienlyELEC.
2. When daemon starting up:

Code: Select all

fa@NanoPi-NEO2:~$ sudo usbipd -D
usbip err: stub_driver.c:  33 (open_sysfs_stub_driver) usbip_common_mod.ko and usbip.ko must be loaded

** (process:29628): ERROR **: driver open failed
Trace/breakpoint trap

Ok, try loading kernel modules:

Code: Select all

fa@NanoPi-NEO2:~$ sudo modprobe usbip_common_mod
modprobe: FATAL: Module usbip_common_mod.ko not found in directory /lib/modules/4.14.111

and

Code: Select all

fa@NanoPi-NEO2:~$ sudo modprobe usbip
modprobe: FATAL: Module usbip.ko not found in directory /lib/modules/4.14.111

Thus, there are no suitable kernel modules on my system. Compilation from source is higher magic for me :).

Re: USB to IP redirect

Posted: Wed Mar 04, 2020 8:07 am
by igorp
bigbeer wrote:
Thus, there are no suitable kernel modules on my system. Compilation from source is higher magic for me :).


... which is why Armbian exist.

You can download ready made images (they are significantly higher quality)
https://www.armbian.com/download/?tx_maker=friendlyelec
or build your image / kernel without any higher magic:
https://github.com/armbian/build

Re: USB to IP redirect

Posted: Wed Mar 04, 2020 1:19 pm
by bigbeer
... which is why Armbian exist.

You can download ready made images (they are significantly higher quality)
https://www.armbian.com/download/?tx_maker=friendlyelec
or build your image / kernel without any higher magic:
https://github.com/armbian/build


Thank you i will try it.

Re: USB to IP redirect

Posted: Thu Mar 05, 2020 3:21 pm
by bigbeer
There are two Armbian's builds - Bionic and Buster
Let's start with Bionic:

Code: Select all

root@nanopineo2:~# apt-get install usbip
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package usbip

root@nanopineo2:~# apt-get install linux-tools-5.4.20-sunxi64
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-tools-5.4.20-sunxi64
E: Couldn't find any package by glob 'linux-tools-5.4.20-sunxi64'
E: Couldn't find any package by regex 'linux-tools-5.4.20-sunxi64'

Fail. No packages in Bionic.
But there is a suitable package "USBIP" in Buster repository.
Install and run:

Code: Select all

root@nanopineo2:~# modprobe usbip-core
root@nanopineo2:~# modprobe usbip-host
root@nanopineo2:~# modprobe vhci-hcd
root@nanopineo2:~# usbipd -D
root@nanopineo2:~# usbip list -l
 - busid 3-1 (12d1:1446)
   Huawei Technologies Co., Ltd. : HSPA modem (12d1:1446)
root@nanopineo2:~# usbip bind -b 3-1
usbip: info: bind device on busid 3-1: complete

That's what we need. USB device sharing server started up.

Re: USB to IP redirect

Posted: Fri Mar 06, 2020 6:45 am
by igorp
bigbeer wrote:
There are two Armbian's builds - Bionic and Buster
Let's start with Bionic:

Code: Select all

root@nanopineo2:~# apt-get install usbip
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package usbip

root@nanopineo2:~# apt-get install linux-tools-5.4.20-sunxi64
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-tools-5.4.20-sunxi64
E: Couldn't find any package by glob 'linux-tools-5.4.20-sunxi64'
E: Couldn't find any package by regex 'linux-tools-5.4.20-sunxi64'

Fail. No packages in Bionic.
But there is a suitable package "USBIP" in Buster repository.
Install and run:

Code: Select all

root@nanopineo2:~# modprobe usbip-core
root@nanopineo2:~# modprobe usbip-host
root@nanopineo2:~# modprobe vhci-hcd
root@nanopineo2:~# usbipd -D
root@nanopineo2:~# usbip list -l
 - busid 3-1 (12d1:1446)
   Huawei Technologies Co., Ltd. : HSPA modem (12d1:1446)
root@nanopineo2:~# usbip bind -b 3-1
usbip: info: bind device on busid 3-1: complete

That's what we need. USB device sharing server started up.


Great!

This is yet another example of why we provide both Debian and Ubuntu under the same kernel. Its hard and expensive to catch and patch things like this. If one doesn't work, other will :)