我想通过C ++ more or less using this way中的USB连接我的Beaglebone Black。
为了做到这一点,我需要在BBB和笔记本电脑上找到端口。
我的BBB挂在与主机相同的网络上,也通过USB连接。我尝试使用lsusb
和ifconfig
(下面的结果)找到该端口。
知道如何找到设备吗?
操作系统:在两个系统上都是ubuntu
在主机上有文件:
/dev/ttyS[0-31]
/dev/ttyprintk
/dev/ttyACM0
/dev/tty[0-63]
/dev/tty
在BBB上有文件:
/dev/ttyS[0-3]
/dev/ttyGS0
/dev/ttyO0
/dev/tty[0-63]
/dev/tty
lsusb
@ host:
Bus 001 Device 004: ID 1d6b:0104 Linux Foundation Multifunction Composite Gadget
Bus 003 Device 002: ID 0483:2016 SGS Thomson Microelectronics Fingerprint Reader
Bus 005 Device 002: ID 046d:c016 Logitech, Inc. Optical Wheel Mouse
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
lsusb
@ BBB:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
ifconfig
@ host:
eth0 Link encap:Ethernet HWaddr 00:21:86:98:da:67
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:20 Memory:fe200000-fe220000
eth1 Link encap:Ethernet HWaddr 90:59:af:5b:50:ca
inet addr:192.168.7.1 Bcast:192.168.7.3 Mask:255.255.255.252
inet6 addr: fe80::9259:afff:fe5b:50ca/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3777 errors:0 dropped:0 overruns:0 frame:0
TX packets:4763 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:958652 (958.6 KB) TX bytes:1113836 (1.1 MB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1687 errors:0 dropped:0 overruns:0 frame:0
TX packets:1687 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:154459 (154.4 KB) TX bytes:154459 (154.4 KB)
wlan0 Link encap:Ethernet HWaddr 00:13:e8:c0:1f:fd
inet addr:192.168.1.102 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::213:e8ff:fec0:1ffd/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:23129 errors:0 dropped:0 overruns:0 frame:0
TX packets:14663 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:18413433 (18.4 MB) TX bytes:2312100 (2.3 MB)
ifconfig
@ BBB:
eth0 Link encap:Ethernet HWaddr 90:59:af:5b:50:c8
inet addr:192.168.1.103 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::9259:afff:fe5b:50c8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4216 errors:0 dropped:0 overruns:0 frame:0
TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1467748 (1.4 MB) TX bytes:3232 (3.2 KB)
Interrupt:56
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
usb0 Link encap:Ethernet HWaddr fa:82:fc:fe:32:05
inet addr:192.168.7.2 Bcast:192.168.7.3 Mask:255.255.255.252
inet6 addr: fe80::f882:fcff:fefe:3205/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4715 errors:0 dropped:0 overruns:0 frame:0
TX packets:3737 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:834726 (834.7 KB) TX bytes:1170046 (1.1 MB)
答案 0 :(得分:1)
我猜你要与之交谈的端口是/dev/ttyACM0
。
我怀疑“1d6b:0104 Linux基础多功能复合小工具”是对应于Beaglebone的条目。
拔掉Beaglebone时,1d6b条目和ttyACM0会消失吗?你可以在将Beaglebone插入USB后立即运行dmesg并向我们展示与您的笔记本电脑识别Beaglebone相对应的线路,以及之后的所有内容吗?