blueman2
Posts: 10
Joined: Mon Aug 29, 2016 2:11 am

usbip / Linux-tools for 4.14?

Sun Sep 09, 2018 9:44 pm

I wanted to try using 'usbip' to remotely monitor a solar panel that uses a USB dongle. Usbip has been moved into linux-tools. I tried installing linux-tools-generic but none was found. And there is no linux-tools for v4.14. Anyone found a way to get linux-tools installed on Stretch 4.14??
Last edited by blueman2 on Mon Sep 10, 2018 7:17 pm, edited 2 times in total.

DirkS
Posts: 9220
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Linux-tools for 4.14?

Mon Sep 10, 2018 2:26 am

Which OS + version?
And where did you find that information?

usbip is available for Raspbian Stretch: https://packages.debian.org/stretch/usbip
linux-tools is actually a dummy package.

blueman2
Posts: 10
Joined: Mon Aug 29, 2016 2:11 am

Re: Linux-tools for 4.14?

Mon Sep 10, 2018 4:26 am

Thanks for the pointer. I installed usbip, but it fails due to an issue of the kernel not being consistent with the usbip version. It appears to be an issue that others have run in to. Here is what happens:

Code: Select all

[email protected]:~ $ sudo su
[email protected]:/home/pi# modprobe vhci-hcd
[email protected]:/home/pi# modprobe usbip-core
[email protected]:/home/pi# modprobe usbip-host
[email protected]:/home/pi# usbip bind -b 1-1.1.2
usbip: info: bind device on busid 1-1.1.2: complete
[email protected]:/home/pi# usbipd -D
[email protected]:/home/pi# usbip --debug attach -r 127.0.0.1 -b 1-1.1.2
usbip: debug: usbip.c:141:[run_command] running command: `attach'
libusbip: error: udev_device_new_from_subsystem_sysname failed
usbip: error: open vhci_driver
usbip: error: query
Several people have reported this based on googling the error message. Seems to be an issue with newer kernel versions.

My OS version is 4.14.62-v7+ (correction: kernel version)
the usbip versions shows as:

Code: Select all

[email protected]:/home/pi# usbip version
usbip (usbip-utils 2.0)
Running on RPi 3B+.

When I try to connect from an XP machine, I also get an error:

Code: Select all

C:\Users\Bob\Desktop\usbip>usbip --list 192.168.1.136
- 192.168.1.136
usbip err: usbip_network.c: 121 (usbip_recv_op_common) recv op_common, -1
usbip err:       usbip.c: 216 (query_exported_devices) recv op_common
usbip err:       usbip.c: 288 (show_exported_devices) query
I was hoping to be able to get this running with current kernel.
Last edited by blueman2 on Mon Sep 10, 2018 5:42 pm, edited 1 time in total.

hortimech
Posts: 171
Joined: Wed Apr 08, 2015 5:52 pm

Re: Linux-tools for 4.14?

Mon Sep 10, 2018 12:21 pm

Two things wrong there, your OS version isn't 4.14.62-v7+, that's the kernel version, also you are still using XP, just in case you missed it, XP is dead.

blueman2
Posts: 10
Joined: Mon Aug 29, 2016 2:11 am

Re: Linux-tools for 4.14?

Mon Sep 10, 2018 3:37 pm

Correct on both accounts. I listed Kernel because that is the main issue with usbip. As for XP, that is the only OS that usbip reliably works on. I have also tried Win 7 with same result. Win 10 is not supported.

And I already know your snarky next response: don't use dead software like usbip. Probably correct again, though! ;)

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5805
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Linux-tools for 4.14?

Mon Sep 10, 2018 4:18 pm

Yuck - a userspace app that has hard dependencies on the kernel.
The source does appear to be part of the Linxu kernel tree, so
- checking out the main Pi kernel from https://github.com/raspberrypi/linux
- cd tools/usb/usbip/
- Follow the build instructions of
[Install]
0. Generate configuration scripts.
$ ./autogen.sh

1. Compile & install the userspace utilities.
$ ./configure [--with-tcp-wrappers=no] [--with-usbids-dir=<dir>]
$ make install

2. Compile & install USB/IP drivers.
should do the job for you.

I'll ping ShiftPlusOne over this - it really doesn't fit with the normal approach of distributions being independent of the kernel, so the normal approach of using the Debian package appears to be fundamentally flawed.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

hortimech
Posts: 171
Joined: Wed Apr 08, 2015 5:52 pm

Re: Linux-tools for 4.14?

Mon Sep 10, 2018 4:33 pm

Would I tell you not to use software that hasn't been updated for years, doesn't seem to use any security and seems to have been abandoned ?

The answer to that is yes.

Why you think anybody here can help with usbip, when even the people that wrote it in the first place don't care ?

Your only hope, as far as I can see, is to clone the code and try and sort out the problem yourself.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5805
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Linux-tools for 4.14?

Mon Sep 10, 2018 4:41 pm

hortimech wrote:
Mon Sep 10, 2018 4:33 pm
Would I tell you not to use software that hasn't been updated for years, doesn't seem to use any security and seems to have been abandoned ?

The answer to that is yes.

Why you think anybody here can help with usbip, when even the people that wrote it in the first place don't care ?

Your only hope, as far as I can see, is to clone the code and try and sort out the problem yourself.
Abandoned on Windows possibly, but unless I'm mistaken then it's part of the mainline Linux kernel, is listed as maintained, and has had a fair number of recent updates.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

blueman2
Posts: 10
Joined: Mon Aug 29, 2016 2:11 am

Re: Linux-tools for 4.14?

Mon Sep 10, 2018 5:38 pm

6by9 wrote:
Mon Sep 10, 2018 4:18 pm
Yuck - a userspace app that has hard dependencies on the kernel.
...
I'll ping ShiftPlusOne over this - it really doesn't fit with the normal approach of distributions being independent of the kernel, so the normal approach of using the Debian package appears to be fundamentally flawed.
Yes, YUCK! I will not argue my questionable judgement in using this software, but I need it for a temporary situation. Thanks so much for the lead. I will try that and report back.

blueman2
Posts: 10
Joined: Mon Aug 29, 2016 2:11 am

Re: Linux-tools for 4.14?

Mon Sep 10, 2018 6:55 pm

6by9,

I compiled and installed from the tree as you recommended. All seemed to go OK, but I am unable to run usbip. I get this result:

Code: Select all

[email protected]:/usr/local/lib $ usbip
usbip: error while loading shared libraries: libusbip.so.0: cannot open shared object file: No such file or directory
[email protected]:/usr/local/lib $ ls
libusbip.a  libusbip.la  libusbip.so  libusbip.so.0  libusbip.so.0.0.1  pypy2.7  python2.7  python3.5
[email protected]:/usr/local/lib $
Only difference from what you list is that I ran the command "./configure" rather than "/configure [--with-tcp-wrappers=no] [--with-usbids-dir=<dir>]" since I was not sure what <dir> value should be. As you can see, the libusbip.so.0 file is there, but usbip does not know that. Any suggestions? Thanks again for the help.

EDIT: Doh! The library file that was located in usbip/src/lib/.libs needed to be copied to /usr/lib. That solved it as far as running usbip. Now to see if this works any better!

DirkS
Posts: 9220
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Linux-tools for 4.14?

Mon Sep 10, 2018 7:07 pm

blueman2 wrote:
Mon Sep 10, 2018 6:55 pm
EDIT: Doh! The library file that was located in usbip/src/lib/.libs needed to be copied to /usr/lib. That solved it as far as running usbip. Now to see if this works any better!
Thanks. I was just about to check where they had hidden that lib :)

blueman2
Posts: 10
Joined: Mon Aug 29, 2016 2:11 am

Re: Linux-tools for 4.14?

Mon Sep 10, 2018 7:16 pm

Wow, it actually appears to work now!!! Thanks so very much @6by9 and @DirkS!!!

blueman2
Posts: 10
Joined: Mon Aug 29, 2016 2:11 am

Re: usbip / Linux-tools for 4.14?

Tue Sep 11, 2018 1:27 am

Well, I mostly got there. It seems to work from linux to linux, but not linux to windows. Here is the error I get on Windows 10 machine (client) talking to my pi (server). I did finally find a version of usbip that runs on pretty much any windows machine so long as you turn of signed driver requirement.

Code: Select all

C:\Users\Bob\Desktop\usbip-201>usbip --debug --attach 192.168.1.136 1-1.1.2
usbip for windows ($Id$)

usbip dbg: usbip_network.c: 268 (tcp_connect ) trying 192.168.1.136 port 3240

usbip dbg: usbip_network.c: 288 (tcp_connect ) connected to 192.168.1.136:3240
usbip dbg:       usbip.c: 139 (query_interface0) exportable 1 devices
usbip dbg:       usbip.c: 156 (query_interface0)  1-1.1.2: unknown vendor : unknown product (1a86:7523)
usbip dbg:       usbip.c: 157 (query_interface0)         : /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2
usbip dbg:       usbip.c: 158 (query_interface0)         : unknown class / unknown subclass / unknown protocol (ff/00/00)
usbip dbg:       usbip.c: 178 (query_interface0)         :  0 - unknown class / unknown subclass / unknown protocol (ff/01/02)
usbip dbg:       usbip.c: 181 (query_interface0)
usbip dbg: usbip_network.c: 268 (tcp_connect ) trying 192.168.1.136 port 3240

usbip dbg: usbip_network.c: 288 (tcp_connect ) connected to 192.168.1.136:3240
request failed at peer, 1
*** ERROR: recv op_common
*** ERROR: query
I think I need to compile usbip myself on my windows machine, using the source from 4.14 kernal.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5805
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: usbip / Linux-tools for 4.14?

Tue Sep 11, 2018 10:10 am

I've had a brief exchange with one of the Raspbian maintainers, and the simple answer is that there isn't an easy/clean way to package up an updated version within Raspbian.
The simplest advice is that people need to build it for themselves should they require it - by the sounds of it that isn't too difficult and does work.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

blueman2
Posts: 10
Joined: Mon Aug 29, 2016 2:11 am

Re: usbip / Linux-tools for 4.14?

Wed Sep 12, 2018 8:30 pm

6by9 wrote:
Tue Sep 11, 2018 10:10 am
I've had a brief exchange with one of the Raspbian maintainers, and the simple answer is that there isn't an easy/clean way to package up an updated version within Raspbian.
The simplest advice is that people need to build it for themselves should they require it - by the sounds of it that isn't too difficult and does work.
Thanks again for the followup, 6by9. The version that I compiled from the 4.14 Linux kernel tree is working just fine. And it just took a few minutes to compile using the steps you outlined. So definitely an option for those who need it.

As for the windows binary, that is another issue. The latest I could find was https://www.dropbox.com/s/oox021z1d7zbl ... p.zip?dl=0. That installs and runs in Windows 10 64 bit environments. It will allow me to view binded devices, but will not attach them in Windows. I tried to do a compile in gcc and visual studio of the 4.14 kernet tree souce, but I am not familiar with these tools and kept getting failures I did not understand.

lonelycowboy
Posts: 1
Joined: Thu Oct 18, 2018 1:35 pm

Re: usbip / Linux-tools for 4.14?

Thu Oct 18, 2018 1:41 pm

Has anyone had any luck running the linux client on a raspberry pi 3 b+? I am trying to share a joystick over my LAN with VirtualHere. I am able to get the server running on my Windows 7 machine no prob, but can't figure out the usbip installation for the client on the pi.

paulr
Posts: 15
Joined: Tue Feb 17, 2015 10:59 am

Re: usbip / Linux-tools for 4.14?

Tue Nov 06, 2018 3:31 pm

lonelycowboy wrote:
Thu Oct 18, 2018 1:41 pm
Has anyone had any luck running the linux client on a raspberry pi 3 b+? I am trying to share a joystick over my LAN with VirtualHere. I am able to get the server running on my Windows 7 machine no prob, but can't figure out the usbip installation for the client on the pi.
Does this help?
viewtopic.php?f=36&t=226355&p=1388848#p1388848

Return to “Advanced users”