{"id":3534,"date":"2024-05-02T20:57:19","date_gmt":"2024-05-02T12:57:19","guid":{"rendered":"https:\/\/www.aqwu.net\/wp\/?p=3534"},"modified":"2024-05-02T21:16:45","modified_gmt":"2024-05-02T13:16:45","slug":"openwrt-%e4%bd%bf%e7%94%a8usb%e4%b8%b2%e5%8f%a3%e8%ae%bf%e9%97%ae%e8%ae%be%e5%a4%87","status":"publish","type":"post","link":"https:\/\/www.aqwu.net\/wp\/?p=3534","title":{"rendered":"OpenWrt \u4f7f\u7528USB\u4e32\u53e3\u8bbf\u95ee\u8bbe\u5907"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>1. \u786e\u8ba4USB\u4e32\u53e3\u8bbe\u5907\u5b58\u5728<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1.1. \u5b89\u88c5\u5fc5\u8981\u7684\u5e93<\/strong><\/h3>\n\n\n\n<p>\u53ef\u80fd\u9700\u8981\u5b89\u88c5\u4e0b\u9762\u7684\u6570\u636e\u5305<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">opkg update\nopkg install usbutils\n<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1.2. \u5217\u8868USB\u8bbe\u5907<\/strong><\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">root@OpenWrt:~# lsusb\nBus 001 Device 004: ID 067b:2303 Prolific Technology Inc. USB-Serial Controller D\nBus 002 Device 001: ID 1d6b:0003 Linux 5.15.150 xhci-hcd xHCI Host Controller\nBus 001 Device 007: ID 1a86:7523 USB Serial\nBus 001 Device 008: ID 0fe6:9900 CoreChips USB 10\/100 LAN\nBus 001 Device 006: ID 05c6:90b6 Android Android\nBus 001 Device 003: ID 1a40:0101 USB2.0 HUB\nBus 001 Device 002: ID 2109:3431 USB2.0 Hub\nBus 001 Device 001: ID 1d6b:0002 Linux 5.15.150 xhci-hcd xHCI Host Controller<\/pre><\/div>\n\n\n\n<p>\u63a5\u5165\u7684 Prolific Technology Inc. USB-Serial Controller D \u5c31\u662f USB\u4e32\u53e3\u8bbe\u5907\uff0cID \u4e3a2303<\/p>\n\n\n\n<p>\u63a5\u7740\u67e5\u627e dmesg<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \"> dmesg |grep 2303\n[    0.230300] pci_bus 0000:00: root bus resource [mem 0x600000000-0x63fffffff] (bus address [0xc0000000-0xffffffff])\n[    0.230354] pci 0000:00:00.0: [14e4:2711] type 01 class 0x060400\n[    1.952370] usb 1-1.4: New USB device found, idVendor=067b, idProduct=2303, bcdDevice= 4.00\n[   71.112343] usb 1-1.4: New USB device found, idVendor=067b, idProduct=2303, bcdDevice= 4.00\n<\/pre><\/div>\n\n\n\n<p>\u53ef\u4ee5\u770b\u5230 USB-Serial Controller \u5df2\u7ecf\u88ab\u8bc6\u522b\u51fa\u6765\u4e3aUSB<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1.3. \u5b89\u88c5\u9a71\u52a8 <\/strong><\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">opkg update\nopkg install kmod-usb-serial-pl2303<\/pre><\/div>\n\n\n\n<p>\u52a0\u8f7d\u9a71\u52a8<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">modprobe pl2303\nlsmod | grep pl2303\npl2303                 16384  0\nusbserial              24576  3 pl2303,option,usb_wwan<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1.4. \u786e\u8ba4\u8bbe\u5907\u5b58\u5728<\/strong><\/h3>\n\n\n\n<p>\u67e5\u770b dmesg<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \" >dmesg|grep 2303\n[    0.230300] pci_bus 0000:00: root bus resource [mem 0x600000000-0x63fffffff] (bus address [0xc0000000-0xffffffff])\n[    0.230354] pci 0000:00:00.0: [14e4:2711] type 01 class 0x060400\n[    1.952370] usb 1-1.4: New USB device found, idVendor=067b, idProduct=2303, bcdDevice= 4.00\n[   71.112343] usb 1-1.4: New USB device found, idVendor=067b, idProduct=2303, bcdDevice= 4.00\n[  469.272505] usbcore: registered new interface driver pl2303\n[  469.278118] usbserial: USB Serial support registered for pl2303\n[  469.284091] pl2303 1-1.4:1.0: pl2303 converter detected\n[  469.296258] usb 1-1.4: pl2303 converter now attached to ttyUSB0\n<\/pre><\/div>\n\n\n\n<p>\u67e5\u770b \/dev \u76ee\u5f55\u4e0b\u6709\u6ca1\u6709tttyUSB0<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">ls -l \/dev\/ttyUSB0\ncrw-rw----    1 root     dialout   188,   0 May  2 11:47 \/dev\/ttyUSB0<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>2. \u4f7f\u7528\u4e32\u53e3\u8bbe\u5907<\/strong><\/h2>\n\n\n\n<p>OpenWrt \u4e0b\u6709\u597d\u51e0\u4e2a\u5de5\u5177\u53ef\u4ee5\u8bbf\u95ee\u4e32\u53e3\uff0c\u6bd4\u5982 picocom\u3001minicom\u3001screen<\/p>\n\n\n\n<p>\u5b89\u88c5\u8fd9\u4e9b\u5de5\u5177<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">opkg update\nopkg install picocom\nopkg install minicom\nopkg install screen\n<\/pre><\/div>\n\n\n\n<p>\u4e0b\u9762\u7684\u547d\u4ee4\u662f\u5047\u8bbe\u63a5\u5165\u7684\u4e32\u53e3\u6ce2\u7279\u7387\u662f 9600<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.1. picocom<\/strong><\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">picocom --b 9600 \/dev\/ttyUSB0\n<\/pre><\/div>\n\n\n\n<p>\u53ef\u4ee5\u6309\u4e0bCtrl-A\u7136\u540e\u6309 Ctrl-X\uff0c\u9000\u51fa\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.2. minicom<\/strong><\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">minicom -D \/dev\/ttyUSB0 -b 9600\n<\/pre><\/div>\n\n\n\n<p>\u53ef\u4ee5\u6309\u4e0bCtrl-A\u7136\u540e\u6309 x\uff0c\u6700\u540e\u6309y\u6765\u786e\u8ba4\u9000\u51fa\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.3 screen<\/strong><\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">screen \/dev\/ttyUSB0 9600\n<\/pre><\/div>\n\n\n\n<p>\u53ef\u4ee5\u6309\u4e0bCtrl-A\u7136\u540e\u6309 k\uff0c\u6700\u540e\u6309y\u6765\u786e\u8ba4\u9000\u51fa\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u786e\u8ba4USB\u4e32\u53e3\u8bbe\u5907\u5b58\u5728 1.1. \u5b89\u88c5\u5fc5\u8981\u7684\u5e93 \u53ef\u80fd\u9700\u8981\u5b89\u88c5\u4e0b\u9762\u7684\u6570\u636e\u5305 1.2. \u5217\u8868USB\u8bbe\u5907 \u63a5\u5165 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[43],"tags":[],"class_list":["post-3534","post","type-post","status-publish","format-standard","hentry","category-infoarticle"],"views":2227,"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/3534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3534"}],"version-history":[{"count":8,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/3534\/revisions"}],"predecessor-version":[{"id":3545,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/3534\/revisions\/3545"}],"wp:attachment":[{"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}