Power & Source of Big Ideas

USB to IP redirect

Moderators: chensy, FATechsupport

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.
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?
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?
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.
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 :).
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
... 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.
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.
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 :)

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 2 guests