Found USB Server to be very useful program, however i faced a problem.
On my openwrt MIPS router, I am able to get run vhusbdmipsel - as USB Server.
However unable to run vhclientmipsel - as USB Client on the same router.
Both Console only mode or as background daemon mode does work.
the executable are store at /usr/bin/vhusbd, set chmod +x
./vhclientmipsel -n
./vhclientmipsel -t list
Message returns: "An existing client is not running. Start the client first so it can be connected to"
Wonder if Michael can help? Or any past version of vhclientmipsel that I can try?
Thanks
.
have a look in logread. Seems like you probably dont have vhci_hcd (USB/IP) compiled into the kernel or a module. The virtualhere client uses that driver
Thank you Michael, what to
Thank you Michael, what to look for in logread?
I am using openwrt chaos calmer 15.05.01, for this kernel, only 2 related USBIP package are kmod-usbip & kmod-usbip-client are installed; vhci_hcd not found installation nor kernel add-on contain download for vhci_hcd. So where can i get the correct version of vhci_hcd to install?
.
You need to build openwrt yourself and include those kernel modules in the make menuconfig configuration
Michael thk you earlier to
Michael thk you earlier to help troubleshoot - now I managed to include those 2 kernel modules on my router, now router is running as
USB Client (vhclientmipsel)
/dev# lsmod | grep vhci
--------------------------------------------
usb_common 1740 2 vhci_hcd
usbcore 119492 35 vhci_hcd
usbip_core 4848 1 vhci_hcd
vhci_hcd 12227 0 [permanent]
So my scenario is this:
Android Phone - running USB Server (USB thumbdrive) --> Router - as USB Client
vhclientmipsel -t "USE,localhost.1002".
ok
vhclientmipsel -t "LIST"
--------------------------------------------
VirtualHere Client IPC, below are the available devices:
(Value in brackets = address, * = Auto-Use)
Openwrt (localhost:7575)
--> USB 2.0 SD/MMC READER (localhost.1002) (In-use by you)
Auto-Find currently on
Auto-Use All currently off
Reverse Lookup currently off
Reverse SSL Lookup currently off
VirtualHere Client not running as a service
---
/dev# lsusb
--------------------------------------------
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
As you can see, on Router USB Client does not show-up usb thumbdrive, thus no way to mount it.
(when connect directly to Router USB port, this thumbdrive shows up as USB device, successfully mounted)
Can you help advice?
.
When you try to connect the device via virtualhere on the client side. Run
logread
and see what message it says.
Thk Michael for advicing,
Thk Michael for advicing, here you go:
--------------------------------------------
/www# /usr/bin/vhusbd/vhclientmipsel_v4.5.9 -t "LIST"
--------------------------------------------
VirtualHere Client IPC, below are the available devices:
(Value in brackets = address, * = Auto-Use)
WhiteKnight-Truth (localhost:7575)
--> USB 2.0 SD/MMC READER (localhost.1002)
Auto-Find currently on
Auto-Use All currently off
Reverse Lookup currently off
Reverse SSL Lookup currently off
VirtualHere Client not running as a service
--------------------------------------------
/www# /usr/bin/vhusbd/vhclientmipsel_v4.5.9 -t "USE,localhost.1002"
--------------------------------------------
OK
--------------------------------------------
/www# /usr/bin/vhusbd/vhclientmipsel_v4.5.9 -t "LIST"
--------------------------------------------
VirtualHere Client IPC, below are the available devices:
(Value in brackets = address, * = Auto-Use)
WhiteKnight-Truth (localhost:7575)
--> USB 2.0 SD/MMC READER (localhost.1002) (In-use by you)
Auto-Find currently on
Auto-Use All currently off
Reverse Lookup currently off
Reverse SSL Lookup currently off
VirtualHere Client not running as a service
--------------------------------------------
/www# logread
--------------------------------------------
on Oct 1 22:20:35 2018 kern.alert VirtualHere Client: VirtualHere Client 4.5.9 starting (Compiled: Sep 24 2018 15:12:00)
Mon Oct 1 22:20:35 2018 kern.alert VirtualHere Client: Using config at /root/.vhui
Mon Oct 1 22:20:35 2018 kern.alert VirtualHere Client: IPC available at /tmp/vhclient
Mon Oct 1 22:20:35 2018 kern.alert VirtualHere Client: Auto-find using Bonjour - on
Mon Oct 1 22:20:35 2018 kern.alert VirtualHere Client: Auto-find using Bonjour SSL - on
Mon Oct 1 22:20:36 2018 kern.alert VirtualHere Client: VirtualHere USB Server Trial Edition (192.168.2.236:7575)
Mon Oct 1 22:21:04 2018 kern.info kernel: [ 250.810000] vhci_hcd vhci_hcd: rhport(0) sockfd(11) devid(4) speed(3) speed_str(high-speed)
--------------------------------------------
/www# lsusb
--------------------------------------------
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
.
I think you need to use a distribution newer than chaos calmer. I think your uspip driver has a bug in it. Use the latest code possible or build the distribution from git if you can
I found and try installing 18
I found and try installing 18.06 which is the latest, insmod usbip it ran fine, insmod usbip-client - hangs the whole router.
Do you happen to know which after chaos calmer distribution is the usbip fixed?
.
Ok that is quite surprising, usbip modules work fine on intel and arm e.g pi, but i havent actually tried it on mipsel.
You dont need to insmod anything, just run the virtualhere client and see what happens. Did you try that first. Dont need to insmod usbip-client.
usbip & usbip-client kernel
usbip & usbip-client kernel modules are consider optional on openwrt, need to install via opkg and insmod to activate use them.
Maybe if you can help by try out on mipsel to see which after chaos calmer version works. Really appreciate.
.
Ok ill give this a test in the next few days with my mipsel gl-inet mt300nv2 router...
.
Ok it does work, i did this for my gl-inet mt300nv2 router so you should do the same for your openwrt build
I did this on my gl-inet mt300nv2 running
and then the usb stick appeared connected to my gl-mt300nv2 even though the stick was plugged into another virtualhere server
And incidentally i could then use the stick via the VirtualHere server again running on the gl-inet mt300nv2 to re-share the device to another client! I just had to disable usb reset by right clicking on the device and selecting "Custom Event Handler..." and entering "onReset.$VENDOR_ID$.$PRODUCT_ID$="
So it worked like this
VirtualHere running on MR3020 with usb stick plugged in-> Wifi->GL-INET MT300NV2 running virtualhere client (and server) -> Wifi -> Windows 10 64-bit . The usb stick could mount and be read/written to like normal. So this proves it does work. I had to reshare the stick from the mt300nv2 because the mt300nv2 doesnt have usb storage drivers compiled into it so the usb disk couldnt be mounted.
However if you want to use your usb device on your router you will need to compile in whatever drivers are needed to actually use the device. E.g usb-storage if its a usb stick etc.
Appreciate Michael for extra
Appreciate Michael for extra effort to build openwrt firmware for your gl-inet mt300nv2 & test out the client function.
1 question now: could you advice me which Linux distro and version you used to build the firmware, I can mimic as close as possible to your setup, this helpfully will reduce issues as I build openwrt for router.
.
Michael, what i mean was the
Michael, what i mean was the parent Linux OS which you use to build Lede.
.
OK it was ubuntu 18.04 64-bit however its not relevant because lede/openwrt builds its own toolchain before it compiles the image so its not connected with anything on the compilation host
git pull
git pull
Michael, as a reference, what did you use for ?
git pull <latest openwrt>
git pull <latest openwrt>
Michael, as a reference, what did you use for <latest openwrt>?
https://github.com/lede
https://github.com/lede-project/source.git
Thk for quick response;
Thk for quick response;
sudo git pull https://github.com/lede-project/source.git
fatal: not a git repository (or any of the parent directories): .git
Must be something i dint notice or missed.
.
to update:
Thks Michael for the hand
Thks Michael for the hand-holding, this is what is showing on my ubuntu-18.04.1 64bit:
git clone https://github.com/lede-project/source.git [No errors]
cd source [Done]
git pull [Already up to date]
make menuconfig
[Long list of 'ok', but among these had failed:
Checking 'gcc'... failed.
Checking 'working-gcc'... failed.
Checking 'g++'... failed.
Checking 'working-g++'... failed.
Checking 'ncurses'... failed.
Checking 'awk'... failed.
Checking 'python'... failed.
ending shows:
/home/ubuntu18/Downloads/source/include/prereq-build.mk:156: recipe for target '/home/ubuntu18/Downloads/source/staging_dir/host/bin/mkhash' failed
Prerequisite check failed. Use FORCE=1 to override.
/home/ubuntu18/Downloads/source/include/toplevel.mk:167: recipe for target 'staging_dir/host/.prereq-build' failed
make: *** [staging_dir/host/.prereq-build] Error 1
]
Sorry for the above, Hope you have a great wkend!
Oops ~ sorry, just came to
Oops ~ sorry, just came to mind ~ those failed, i shld install them , and see if it helps.
Hold-on 1st, will response back in a short-while.
Ah-ha, by installing missing
Ah-ha, by installing missing prog. modules - I managed to clear up all the failures, made good progress.
There are some warnings - I think i can ignore right? unless you think i need to look into it.
[WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a build dependency on 'libpam', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libgnutls', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libopenldap', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libidn2', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libssh2', which does not exist
WARNING: Makefile 'package/boot/kexec-tools/Makefile' has a dependency on 'liblzma', which does not exist
WARNING: Makefile 'package/network/services/lldpd/Makefile' has a dependency on 'libnetsnmp', which does not exist
WARNING: Makefile 'package/network/utils/nftables/Makefile' has a dependency on 'jansson', which does not exist]
make menuconfig: Brings me to the menu for config, besides selecting Target System & Sub-target for my router, what other config selection i need to perform ? then how to complete this menuconfig?
make -jnumberofcpus: Does the jnumberofcpus refer to number of cpu processor on my router? or does it refers to cpu processors on my ubuntu (Intel Dual Core - 2 processors each core- gives 4 processors) ?
.
I don't know what you need to select, you will have to research that on the internet for your router. j flag is number of CPUs to use when compiling, your Ubuntu PC cpus
Latest openwrt 18.06.1 router: vhclientmipsel Illegal instructn
Michael, thk you for tracking this issue, after quite abit of effort I finally gotten the latest openwrt 18.06.1 running on my router:
root@openwrt:/www# lsmod | grep vhci
usb_common 2176 2 vhci_hcd,usbcore
usbcore 119376 5 vhci_hcd,ohci_platform,ohci_hcd,ehci_platform,ehci_hcd
usbip_core 4480 1 vhci_hcd
vhci_hcd 14672 0
root@openwrt:/www# /usr/bin/vhusbd/vhclientmipsel_v4.5.9 &
root@openwrt:/www# ps | grep vh
1852 root 16508 R /usr/bin/vhusbd/vhclientmipsel_v4.5.9
1854 root 1200 S grep vh
root@openwrt:/www# ps | grep vh
1856 root 1200 S grep vh
[1]+ Illegal instruction /usr/bin/vhusbd/vhclientmipsel_v4.5.9
Nothing interesting shows-up at logread:
Mon Nov 19 16:31:13 2018 daemon.info dnsmasq-dhcp[1631]: read /etc/ethers - 0 addresses
Mon Nov 19 16:31:15 2018 authpriv.info dropbear[1818]: Child connection from 192.168.3.154:6984
Mon Nov 19 16:31:16 2018 authpriv.notice dropbear[1809]: Password auth succeeded for 'root' from 192.168.3.154:6976
Preliminary info seems to point to some incompatible code error of vhclientmipsel encounter in openwrt 18.06.1
.
See here https://www.virtualhere.com/node/955
this issue was fixed in 4.6.1 so you need to use that version of the client or later