{"id":83379,"date":"2020-05-30T19:42:20","date_gmt":"2020-05-30T17:42:20","guid":{"rendered":"https:\/\/prohoster.info\/blog\/administrirovanie\/usb-over-ip-v-domashnih-usloviyah"},"modified":"2020-05-30T19:42:20","modified_gmt":"2020-05-30T17:42:20","slug":"usb-over-ip-v-domashnih-usloviyah","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/usb-over-ip-v-domashnih-usloviyah","title":{"rendered":"USB over IP at home","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Sometimes there is a desire to work with a device connected via USB without keeping it on the table next to the laptop. I have such a device, a Chinese laser engraver with 500 mW, which is quite unpleasant to be near. Besides the immediate danger to the eyes, the laser emits toxic combustion products during operation, so the device should be in a well-ventilated area and preferably isolated from people. But how do you control such a device? I accidentally found the answer while browsing the OpenWRT repository in hopes of finding a worthy use for an old D-Link DIR-320 A2 router. I decided to use the method described earlier on Habr. <b>USB over IP tunnel<\/b>, however, all installation instructions have become outdated, so I am writing my own.<br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><br \/>\nOpenWRT is an operating system that needs no introduction, so I won't describe its installation. For my router, I took the latest stable release OpenWrt 19.07.3 and connected it to the main access point via Wi-Fi as a client, choosing the mode <i>lan<\/i>, so as not to trouble the firewall.<\/p>\n<h2>Server part<\/h2>\n<p>\nWe proceed according to <noindex><a rel=\"nofollow\" href=\"https:\/\/openwrt.org\/docs\/guide-user\/services\/usb.iptunnel\">the official instructions<\/a><\/noindex>. After connecting via ssh, we install the necessary packages.<\/p>\n<pre><code class=\"bash\">root@OpenWrt:~# opkg update\nroot@OpenWrt:~# opkg install kmod-usb-ohci usbip-server usbip-client<\/code><\/pre>\n<p>\nNext, connect our device to the router's USB port (in my case, the devices are: USB hub, flash drive, which contains the router's file system (due to lack of space on the internal storage), and the engraver itself).<\/p>\n<p>Let's try to list the connected devices:<\/p>\n<pre><code class=\"bash\">root@OpenWrt:~# usbip list -l<\/code><\/pre>\n<p>\nEmpty.<\/p>\n<p>Through googling, I found the culprit, which turned out to be the library <b>libudev-fbsd<\/b>.<br \/>\nWe manually extract the last working version from the repository <b>libudev_3.2-1<\/b> from the OpenWRT 17.01.7 release for my architecture, in my case it is libudev_3.2-1_mipsel_mips32.ipk. Using wget\/scp, we upload it to the router's memory and reinstall it<\/p>\n<pre><code class=\"bash\">root@OpenWrt:~# opkg remove --force-depends libudev-fbsd\nroot@OpenWrt:~# opkg install libudev_3.2-1_mipsel_mips32.ipk\n<\/code><\/pre>\n<p>\nChecking:<\/p>\n<pre><code class=\"bash\">root@OpenWrt:~# usbip list -l\n - busid 1-1.1 (090c:1000)\n   Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) : Flash Drive (090c:1000)\n\n - busid 1-1.4 (1a86:7523)\n   QinHeng Electronics : HL-340 USB-Serial adapter (1a86:7523)<\/code><\/pre>\n<p>\nThe Chinese device connected to the USB hub received bsuid <b>1-1.4<\/b>. Remembered.<\/p>\n<p>Now let's start the daemon:<\/p>\n<pre><code class=\"bash\">root@OpenWrt:~# usbipd -D<\/code><\/pre>\n<p>\nand bind the Chinese device<\/p>\n<pre><code class=\"bash\">root@OpenWrt:~# usbip bind -b 1-1.4\nusbip: info: bind device on busid 1-1.4: complete<\/code><\/pre>\n<p>\nChecking that everything works:<\/p>\n<pre><code class=\"bash\">root@OpenWrt:\/home# netstat -alpt\nActive Internet connections (servers and established)\nProto Recv-Q Send-Q Local Address           Foreign Address         State       PID\/Program name\ntcp        0      0 0.0.0.0:3240            0.0.0.0:*               LISTEN      1884\/usbipd<\/code><\/pre>\n<p>\nTo bind the device automatically in the future, let's edit <i>\/etc\/rc.local<\/i>, adding before <i>exit 0<\/i> the following:<\/p>\n<pre><code class=\"bash\">usbipd -D &amp;\nsleep 1\nusbip bind -b 1-1.4<\/code><\/pre>\n<p><\/p>\n<h2>Client side<\/h2>\n<p>\nLet's try to connect the device to Windows 10 using the aforementioned instructions from openwrt.org. I\u2019ll say right away: this attempt is doomed to fail. First, it only considers Windows 7 x64. Secondly, there's a link to a thread on sourceforge.net, which suggests downloading a patched driver from Dropbox from 2014. When trying to run it on Windows 10 and connect to our device, we get the error:<\/p>\n<pre><code class=\"bash\">c:Utilsusbip&gt;usbip -a 192.168.31.203 1-1.4\nusbip for windows ($Id$)\n\n*** ERROR: cannot find device<\/code><\/pre>\n<p>\nThis is due to the fact that the client does not work with a server built on a kernel older than version 3.14.<br \/>\nThe usbip server on OpenWRT 19.07.3 is built on kernel 4.14.180.<\/p>\n<p>Continuing my search, I stumble upon an updated development of the Windows client on <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/cezanne\/usbip-win\">github<\/a><\/noindex>. Okay, Windows 10 x64 support is claimed, but the client is purely experimental, therefore there are a number of limitations.<\/p>\n<p>So, first they ask to install the certificate, and indeed twice. Fine, we place it in Trusted Root Certification Authority and Trusted Publishers.<\/p>\n<p>Next, it is necessary to switch the operating system to test mode. This is done with the command<\/p>\n<pre><code class=\"bash\">bcdedit.exe \/set TESTSIGNING ON<\/code><\/pre>\n<p>\nI couldn't do it the first time due to <b>secure boot.<\/b>To disable it, you need to reboot into UEFI and set secure boot to disable. On some laptop models, you may need to set a supervisor password.<\/p>\n<p>After that, we boot into Windows and do <i>bcdedit.exe \/set TESTSIGNING ON<\/i><br \/>\nWindows says everything is okay. We reboot again and see the Test Mode notice in the bottom right corner, along with the version and build number of the OS. <\/p>\n<p>What are all these manipulations for? To install an unsigned driver <b>USB\/IP VHCI.<\/b>This can be done by downloading the files usbip.exe, usbip_vhci.sys, usbip_vhci.inf, usbip_vhci.cer, usbip_vhci.cat, and executing with administrator rights<\/p>\n<pre><code class=\"bash\">usbip.exe install<\/code><\/pre>\n<p>\nor the second method, installing Legacy Hardware manually. I chose the second option, received a warning about the installation of an unsigned driver, and accepted it.<\/p>\n<p>Next, we check that we can connect to a remote USB device by executing the command:<\/p>\n<pre><code class=\"bash\">usbip.exe list -r<\/code><\/pre>\n<p>\nwe receive the list of devices:<\/p>\n<pre><code class=\"bash\">c:Utilsusbip&gt;usbip.exe list -r 192.168.31.203\nusbip: error: failed to open usb id database\nExportable USB devices\n======================\n - 192.168.31.203\n      1-1.4: unknown vendor : unknown product (1a86:7523)\n           : \/sys\/devices\/ssb0:1\/ehci-platform.0\/usb1\/1-1\/1-1.4\n           : unknown class \/ unknown subclass \/ unknown protocol (ff\/00\/00)<\/code><\/pre>\n<p>\non the error <i>usbip: error: failed to open usb id database<\/i> we do not pay attention, it doesn't affect the work.<\/p>\n<p>Now, binding the device:<\/p>\n<pre><code class=\"bash\">c:Utilsusbip&gt;usbip.exe attach -r 192.168.31.203 -b 1-1.4<\/code><\/pre>\n<p>\nThat's it, Windows has detected a new device, now it can be used as if it were physically connected to the laptop.<\/p>\n<p>I had to struggle a bit with the Chinese engraver, as trying to install its CH341SER driver through the provided installer (yes, the engraver is based on Arduino) caused USB\/IP VHCI to crash Windows into a BSOD. However, installing the CH341SER driver <b>up to<\/b> via usbip.exe solved the problem.<\/p>\n<p>In conclusion: the engraver is buzzing and smoking in the kitchen with the window open and the door closed, I am observing the burning process from another room through the native software that does not sense anything unusual.<\/p>\n<p>Sources used:<\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/openwrt.org\/docs\/guide-user\/services\/usb.iptunnel\">https:\/\/openwrt.org\/docs\/guide-user\/services\/usb.iptunnel<\/a><\/noindex><br \/>\n<noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/cezanne\/usbip-win\">https:\/\/github.com\/cezanne\/usbip-win<\/a><\/noindex><br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/504338\/\">habr.com<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c \u043f\u043e USB, \u043d\u0435 \u0434\u0435\u0440\u0436\u0430 \u0435\u0433\u043e \u043d\u0430 \u0441\u0442\u043e\u043b\u0435 \u0440\u044f\u0434\u043e\u043c \u0441 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u043e\u043c. \u0423 \u043c\u0435\u043d\u044f \u0442\u0430\u043a\u0438\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0438\u0442\u0430\u0439\u0441\u043a\u0438\u0439 \u0433\u0440\u0430\u0432\u0451\u0440 \u0441 \u043b\u0430\u0437\u0435\u0440\u043e\u043c \u043d\u0430 500 \u043c\u0412\u0442, \u0448\u0442\u0443\u043a\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u0430\u044f \u043f\u0440\u0438 \u0431\u043b\u0438\u0437\u043a\u043e\u043c \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0435. \u041f\u043e\u043c\u0438\u043c\u043e \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0433\u043b\u0430\u0437, \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043b\u0430\u0437\u0435\u0440\u0430 \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043a\u0441\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u0433\u043e\u0440\u0435\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u0440\u043e\u0432\u0435\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u043c [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-83379","post","type-post","status-publish","format-standard","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0418\u043d\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c \u043f\u043e USB, \u043d\u0435 \u0434\u0435\u0440\u0436\u0430 \u0435\u0433\u043e \u043d\u0430 \u0441\u0442\u043e\u043b\u0435 \u0440\u044f\u0434\u043e\u043c \u0441 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u043e\u043c.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/usb-over-ip-v-domashnih-usloviyah\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47USB over IP \u0432 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0418\u043d\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c \u043f\u043e USB, \u043d\u0435 \u0434\u0435\u0440\u0436\u0430 \u0435\u0433\u043e \u043d\u0430 \u0441\u0442\u043e\u043b\u0435 \u0440\u044f\u0434\u043e\u043c \u0441 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u043e\u043c.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/usb-over-ip-v-domashnih-usloviyah\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-05-30T17:42:20+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-05-30T17:42:20+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47USB over IP at home | ProHoster","description":"Sometimes there is a desire to work with a USB device without keeping it on the table next to the laptop.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/usb-over-ip-v-domashnih-usloviyah","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47USB over IP \u0432 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 | ProHoster","og:description":"\u0418\u043d\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c \u043f\u043e USB, \u043d\u0435 \u0434\u0435\u0440\u0436\u0430 \u0435\u0433\u043e \u043d\u0430 \u0441\u0442\u043e\u043b\u0435 \u0440\u044f\u0434\u043e\u043c \u0441 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u043e\u043c.","og:url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/usb-over-ip-v-domashnih-usloviyah","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2020-05-30T17:42:20+00:00","article:modified_time":"2020-05-30T17:42:20+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"83379","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 15:19:18","updated":"2022-09-29 17:57:32","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/83379","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=83379"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/83379\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=83379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=83379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=83379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}