USB tshaj IP tom tsev

Qee lub sij hawm koj xav ua haujlwm nrog lub cuab yeej txuas nrog ntawm USB yam tsis tau khaws nws ntawm lub rooj ntawm koj lub laptop. Kuv lub cuab yeej yog Suav engraver nrog 500 mW laser, uas yog qhov tsis kaj siab heev thaum nyob ze. Ntxiv rau qhov txaus ntshai tam sim ntawd rau lub qhov muag, cov khoom siv hluav taws xob tua hluav taws raug tso tawm thaum lub sijhawm ua haujlwm laser, yog li cov cuab yeej yuav tsum nyob rau hauv qhov chaw muaj cua zoo, thiab nyiam dua los ntawm tib neeg. Koj tuaj yeem tswj cov cuab yeej li no li cas? Kuv nrhiav tau cov lus teb rau lo lus nug no thaum tshawb nrhiav OpenWRT chaw cia khoom hauv kev cia siab ntawm kev nrhiav kev tsim nyog siv rau D-Link DIR-320 A2 router qub. Txhawm rau txuas, kuv txiav txim siab siv qhov uas tau piav qhia ntawm Habre ua ntej. USB hla ​​IP qhov, txawm li cas los xij, tag nrho cov lus qhia rau kev txhim kho nws tau poob lawv qhov tseeb, yog li kuv sau kuv tus kheej.

OpenWRT yog ib qho kev khiav hauj lwm uas xav tau tsis muaj kev taw qhia, yog li kuv yuav tsis piav txog nws qhov kev teeb tsa. Rau kuv lub router, kuv coj qhov tseeb ruaj khov tso tawm ntawm OpenWrt 19.07.3, thiab txuas nws mus rau lub ntsiab Wi-Fi nkag mus rau tus neeg siv khoom, xaiv hom lan, kom tsis txhob tsim txom lub firewall.

Server part

Peb ua raws li lus qhia. Tom qab txuas ntawm ssh, nruab cov pob tsim nyog.

root@OpenWrt:~# opkg update
root@OpenWrt:~# opkg install kmod-usb-ohci usbip-server usbip-client

Tom ntej no, peb txuas peb lub cuab yeej mus rau lub router USB chaw nres nkoj (hauv kuv rooj plaub, cov khoom siv: USB hub, flash drive uas lub router cov ntaub ntawv kaw lus tau teeb tsa (vim tsis muaj qhov chaw ntawm qhov chaw cia), thiab ncaj qha, engraver).

Cia peb sim ua kom pom cov npe ntawm cov khoom siv txuas nrog:

root@OpenWrt:~# usbip list -l

Npua.

Los ntawm googling tus neeg ua txhaum tau pom, nws tau tig los ua ib lub tsev qiv ntawv libudev-fbsd.
Peb rub tawm qhov tseeb ua haujlwm version ntawm lub chaw cia khoom los ntawm tes libudev_3.2-1 los ntawm OpenWRT 17.01.7 tso tawm rau koj cov architecture, hauv kuv rooj plaub nws yog libudev_3.2-1_mipsel_mips32.ipk. Siv wget / scp, rub nws mus rau hauv lub router lub cim xeeb thiab rov nruab nws

root@OpenWrt:~# opkg remove --force-depends libudev-fbsd
root@OpenWrt:~# opkg install libudev_3.2-1_mipsel_mips32.ipk

Peb tshawb xyuas:

root@OpenWrt:~# usbip list -l
 - busid 1-1.1 (090c:1000)
   Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) : Flash Drive (090c:1000)

 - busid 1-1.4 (1a86:7523)
   QinHeng Electronics : HL-340 USB-Serial adapter (1a86:7523)

Ib tug txiv neej Suav txuas nrog USB hub tau txais bsuid 1-1.4. Nco ntsoov.

Tam sim no cia peb pib lub daemon:

root@OpenWrt:~# usbipd -D

thiab khi cov Suav

root@OpenWrt:~# usbip bind -b 1-1.4
usbip: info: bind device on busid 1-1.4: complete

Cia peb xyuas tias txhua yam ua haujlwm:

root@OpenWrt:/home# netstat -alpt
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:3240            0.0.0.0:*               LISTEN      1884/usbipd

Txhawm rau khi lub cuab yeej txuas ntxiv, cia peb hloov kho /etc/rc.locallos ntawm kev ntxiv ua ntej tawm ntawm 0 Cov hauv qab no:

usbipd -D &
sleep 1
usbip bind -b 1-1.4

Cov neeg siv khoom sab

Cia peb sim txuas lub cuab yeej rau Windows 10 siv cov lus qhia saum toj no los ntawm openwrt.org. Kuv mam li hais tam sim ntawd: lub tswv yim yog doomed rau kev ua tsis tiav. Ua ntej, tsuas yog Windows 7 x64 raug txiav txim siab. Qhov thib ob, qhov txuas tau muab rau cov xov ntawm sourceforge.net, uas qhia tias rub tawm tus tsav tsheb patched hauv 2014 los ntawm Dropbox. Thaum peb sim khiav nws hauv Windows 10 thiab txuas rau peb lub cuab yeej, peb tau txais qhov yuam kev hauv qab no:

c:Utilsusbip>usbip -a 192.168.31.203 1-1.4
usbip for windows ($Id$)

*** ERROR: cannot find device

Qhov no yog vim qhov tseeb tias tus neeg siv khoom tsis ua haujlwm nrog lub server tsim rau lub ntsiav laus dua li version 3.14.
Lub usbip neeg rau zaub mov rau OpenWRT 19.07.3 yog tsim los ntawm kernel 4.14.180.

Txuas ntxiv kuv tshawb nrhiav, Kuv tuaj hla kev txhim kho tam sim no ntawm tus neeg siv Windows rau github. Ok, kev txhawb nqa rau Windows 10 x64 tau hais, tab sis tus neeg siv khoom tsuas yog tus neeg siv khoom sim, yog li muaj ntau qhov kev txwv.

Yog li, ua ntej lawv thov kom nruab daim ntawv pov thawj, thiab ob zaug. Ok, cia peb muab tso rau hauv Trusted Root Certification Authority thiab Trusted Publishers.

Tom ntej no, koj yuav tsum tso lub operating system mus rau hauv kev sim hom. Qhov no yog ua los ntawm ib pab neeg

bcdedit.exe /set TESTSIGNING ON

Kuv ua tsis tau tiav thawj zaug, kuv tau txais txoj hauv kev nyab xeeb khau raj. Txhawm rau lov tes taw nws, koj yuav tsum rov pib dua rau hauv UEFI thiab teeb tsa kev ruaj ntseg khau raj kom lov tes taw. Qee lub laptop qauv yuav xav tau kev teeb tsa tus thawj saib xyuas tus password.

Tom qab ntawd, qhib lub Windows thiab ua bcdedit.exe /set TESTSIGNING RAU
Vinda hais tias txhua yam zoo. Peb rov pib dua, thiab peb pom hauv kaum sab xis ntawm cov lus Test Mode, version thiab OS tsim tus lej.

Tag nrho cov manipulations yog dab tsi? Txhawm rau nruab ib tus tsav tsheb tsis tau kos npe USB/IP VHCI. Nws raug nquahu kom ua qhov no los ntawm rub tawm cov ntaub ntawv usbip.exe, usbip_vhci.sys, usbip_vhci.inf, usbip_vhci.cer, usbip_vhci.cat, thiab khiav nrog cov cai tswj hwm

usbip.exe install

los yog txoj kev thib ob, txhim kho Legacy Hardware manually. Kuv xaiv qhov kev xaiv thib ob, tau txais lus ceeb toom txog kev txhim kho tus tsav tsheb tsis tau kos npe thiab pom zoo nrog nws.

Tom ntej no, peb xyuas tias peb muaj peev xwm txuas mus rau tej thaj chaw deb USB ntaus ntawv los ntawm kev ua raws li cov lus txib:

usbip.exe list -r <ip вашего роутера>

peb tau txais ib daim ntawv teev cov khoom siv:

c:Utilsusbip>usbip.exe list -r 192.168.31.203
usbip: error: failed to open usb id database
Exportable USB devices
======================
 - 192.168.31.203
      1-1.4: unknown vendor : unknown product (1a86:7523)
           : /sys/devices/ssb0:1/ehci-platform.0/usb1/1-1/1-1.4
           : unknown class / unknown subclass / unknown protocol (ff/00/00)

rau qhov yuam kev usbip: yuam kev: ua tsis tau tejyam qhib usb id database Peb tsis xyuam xim, nws tsis cuam tshuam rau kev ua haujlwm.

Tam sim no peb khi lub cuab yeej:

c:Utilsusbip>usbip.exe attach -r 192.168.31.203 -b 1-1.4

Ntawd yog nws, Windows tau kuaj pom lub cuab yeej tshiab, tam sim no koj tuaj yeem ua haujlwm nrog nws zoo li nws tau txuas lub cev rau lub laptop.

Kuv yuav tsum raug kev txom nyem me ntsis nrog Suav engraver, vim hais tias thaum kuv sim nruab nws CH341SER tsav tsheb los ntawm lub installer uas tuaj nrog lub engraver (yog, ib tug Arduino engraver), USB / IP VHCI poob Windows rau BSOD. Txawm li cas los xij, txhim kho CH341SER tsav tsheb rau txuas lub cuab yeej ntawm usbip.exe daws qhov teeb meem.

Cov kab hauv qab: tus engraver ua suab nrov thiab haus luam yeeb hauv chav ua noj nrog lub qhov rais qhib thiab lub qhov rooj kaw, Kuv saib cov txheej txheem kub ntawm lwm chav los ntawm kuv tus kheej software, uas tsis hnov ​​​​tsw.

Cov ntaub ntawv siv:

https://openwrt.org/docs/guide-user/services/usb.iptunnel
https://github.com/cezanne/usbip-win

Tau qhov twg los: www.hab.com

Ntxiv ib saib