【BB-Black测试】+ 第一次亲密接触

2019-07-31 16:02发布

本帖最后由 原野之狼 于 2014-7-12 00:20 编辑

原载于 http://www.21qa.net/questions/213/213


  1. 纯属废话
  2. 手上没有任何文档,对BBB有点心急,想早一点做亲密接触~~~

  3. 不看文档也可以把玩对不对?

  4. 就像把妹一样,凭着最原始的冲动!

  5. 环境介绍
  6. 作为一个Linux粉,开发环境自然是Native Linux了
  7. hugui@nevsayno:~$ sudo lsb_release -a
  8. Distributor ID: Ubuntu
  9. Description:    Ubuntu 12.04.4 LTS
  10. Release:    12.04
  11. Codename:   precise
  12. USB转串口
  13. 之前有个老掉牙的转接线,好久不把玩板子了,竟然不知道塞哪里去了。
  14. 网线
  15. 这个倒是有,我的电脑使用无线上网,剩下的有线网口正好可以和BBB相连接。
  16. USB线
  17. BBB自带,我用它从计算机取电。
  18. 偶然发现
  19. 我的本本只有一个有线网口,但是连接上BBB之后尽然发现多出来一个网口eth2

  20. eth1      Link encap:Ethernet  HWaddr 20:89:84:d3:79:72

  21.           inet addr:192.168.1.144  Bcast:192.168.1.255  Mask:255.255.255.0
  22.           inet6 addr: fe80::2289:84ff:fed3:7972/64 Scope:Link
  23.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  24.           RX packets:67 errors:0 dropped:0 overruns:0 frame:0
  25.           TX packets:819 errors:0 dropped:0 overruns:0 carrier:0
  26.           collisions:0 txqueuelen:1000
  27.           RX bytes:24478 (24.4 KB)  TX bytes:55140 (55.1 KB)
  28.           Interrupt:45 Base address:0x6000

  29. eth2      Link encap:Ethernet  HWaddr 90:59:af:64:38:29

  30.           inet addr:192.168.7.1  Bcast:192.168.7.3  Mask:255.255.255.252
  31.           inet6 addr: fe80::9259:afff:fe64:3829/64 Scope:Link
  32.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  33.           RX packets:324 errors:0 dropped:0 overruns:0 frame:0
  34.           TX packets:564 errors:0 dropped:0 overruns:0 carrier:0
  35.           collisions:0 txqueuelen:1000
  36.           RX bytes:40476 (40.4 KB)  TX bytes:88386 (88.3 KB)

  37. 回想起发过来的BBB包装盒里的一张彩页上写着:

  38. USB接口可以同时提供电源和作为开发接口
  39. 嗯,如此看来,BBB经USB接口插入本本后已经被识别了,且自动虚拟出了一个网口。有以下数据为证!

  40. 看看USB的信息吧:

  41. hugui@nevsayno:~$ lsusb
  42. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  43. Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  44. Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  45. Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
  46. Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
  47. Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
  48. Bus 003 Device 002: ID 17ef:6050 Lenovo
  49. Bus 001 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver
  50. Bus 002 Device 003: ID 5986:02d2 Acer, Inc
  51. Bus 003 Device 006: ID 1d6b:0104 Linux Foundation Multifunction Composite Gadget    # <--- 看这里!
  52. 看看内核打印的消息,哈,尽然还整出了一个块设备sdc

  53. hugui@nevsayno:~$ dmesg -T
  54. [Fri Jul 11 22:59:49 2014] sd 10:0:0:0: [sdc] Synchronizing SCSI cache
  55. [Fri Jul 11 22:59:49 2014] sd 10:0:0:0: [sdc]  Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
  56. [Fri Jul 11 22:59:49 2014] userif-3: sent link down event.
  57. [Fri Jul 11 22:59:49 2014] userif-3: sent link up event.
  58. [Fri Jul 11 22:59:53 2014] ADDRCONF(NETDEV_UP): eth1: link is not ready
  59. [Fri Jul 11 22:59:54 2014] userif-3: sent link down event.
  60. [Fri Jul 11 22:59:54 2014] userif-3: sent link up event.
  61. [Fri Jul 11 22:59:57 2014] r8169 0000:0c:00.0: eth1: link up
  62. [Fri Jul 11 22:59:57 2014] ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
  63. [Fri Jul 11 22:59:57 2014] userif-3: sent link down event.
  64. [Fri Jul 11 22:59:57 2014] userif-3: sent link up event.
  65. 我们来看看这个块设备吧,BBB已经作为一块U盘挂在到了我的本本上。
  66. 嗯,一个USB接口干了三件事了!

  67. hugui@nevsayno:~$ df -h
  68. Filesystem      Size  Used Avail Use% Mounted on
  69. /dev/sda3        19G  9.2G  9.1G  51% /
  70. udev            3.9G  4.0K  3.9G   1% /dev
  71. tmpfs           783M  1.2M  782M   1% /run
  72. none            5.0M     0  5.0M   0% /run/lock
  73. none            3.9G   37M  3.8G   1% /run/shm
  74. /dev/sda1        47M  353K   47M   1% /boot/efi
  75. /dev/sda5       434G  142G  271G  35% /home
  76. /dev/sdc         70M   54M   16M  78% /media/BEAGLEBONE           # <--- 这个就是BBB上的内容了
  77. hugui@nevsayno:~$ ls /media/BEAGLEBONE/
  78. App  autorun.inf  Docs  Drivers  ID.txt  LICENSE.txt  MLO  README.md  START.htm  u-boot.img  uEnv.txt
  79. 测试网络
  80. 查看一下eth2的ip地址

  81. hugui@nevsayno:~$ ifconfig eth2 | grep addr
  82. eth2      Link encap:Ethernet  HWaddr 90:59:af:64:38:29

  83.           inet addr:192.168.7.1  Bcast:192.168.7.3  Mask:255.255.255.252
  84.           inet6 addr: fe80::9259:afff:fe64:3829/64 Scope:Link
  85. 根据以上信息进行猜想~
  86. eth2的ip地址是192.168.7.1,那对端BBB的IP地址是多少呢?
  87. 暂且猜192.168.7.2吧,测试一下看看...
  88. hugui@nevsayno:~$ ping 192.168.7.2 -c 4
  89. PING 192.168.7.2 (192.168.7.2) 56(84) bytes of data.
  90. 64 bytes from 192.168.7.2: icmp_req=1 ttl=64 time=0.525 ms
  91. 64 bytes from 192.168.7.2: icmp_req=2 ttl=64 time=0.412 ms
  92. 64 bytes from 192.168.7.2: icmp_req=3 ttl=64 time=0.381 ms
  93. 64 bytes from 192.168.7.2: icmp_req=4 ttl=64 time=0.328 ms

  94. --- 192.168.7.2 ping statistics ---
  95. 4 packets transmitted, 4 received, 0% packet loss, time 2999ms
  96. rtt min/avg/max/mdev = 0.328/0.411/0.525/0.074 ms
  97. hugui@nevsayno:~$

  98. 我去!果然猜对了!我是不是应该去双 {MOD}球?哈哈~~~

  99. SSH
  100. 继续发散思维!

  101. 既然BBB已经预装系统,那总得整个SSHD上去吧?
  102. 好吧,继续测试一下看看...

  103. hugui@nevsayno:~$ ssh root@192.168.7.2
  104. root@192.168.7.2's password:
  105. -sh: /usr/bin/led_acc: No such file or directory
  106. [1]+  Done(127)               /usr/bin/led_acc
  107. 果然有效!而且密码也被我一次性猜对了,哈哈,看来今天不买双 {MOD}球都不行了!话说,你能猜到密码是什么吗?
  108. 不过从以上信息看貌似还有些小问题,这个暂且不表了。

  109. BBB试玩
  110. 接下来敲些基本的命令玩一玩吧~

  111. root@beaglebone:~# pwd
  112. /home/root
  113. root@beaglebone:~# ls
  114. Desktop
  115. root@beaglebone:~# ls               
  116. ls            ls.coreutils  lsattr        lsb_release   lsblk         lsmod         lsmod.kmod    lsusb         lsusb.py      
  117. root@beaglebone:~# lsb_release -a
  118. Distributor ID: Angstrom
  119. Description:    Angstrom GNU/Linux v2012.12 (Core edition)
  120. Release:        v2012.12
  121. Codename:       Core edition
  122. root@beaglebone:~#
  123. root@beaglebone:~#
  124. root@beaglebone:~#
  125. root@beaglebone:~#
  126. root@beaglebone:~#
  127. root@beaglebone:~#
  128. root@beaglebone:~# pwd
  129. /home/root
  130. root@beaglebone:~# ls
  131. Desktop
  132. root@beaglebone:~# lsb_release -a
  133. Distributor ID: Angstrom
  134. Description:    Angstrom GNU/Linux v2012.12 (Core edition)
  135. Release:        v2012.12
  136. Codename:       Core edition
  137. root@beaglebone:~# cat /proc/cpuinfo
  138. processor   : 0
  139. model name  : ARMv7 Processor rev 2 (v7l)
  140. BogoMIPS    : 297.40
  141. Features    : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls
  142. CPU implementer : 0x41
  143. CPU architecture: 7
  144. CPU variant : 0x3
  145. CPU part    : 0xc08
  146. CPU revision    : 2

  147. Hardware    : Generic AM33XX (Flattened Device Tree)
  148. Revision    : 0000
  149. Serial      : 0000000000000000
  150. root@beaglebone:~# df -h
  151. Filesystem      Size  Used Avail Use% Mounted on
  152. rootfs          1.7G  1.3G  321M  81% /
  153. /dev/root       1.7G  1.3G  321M  81% /
  154. devtmpfs        250M     0  250M   0% /dev
  155. tmpfs           250M  4.0K  250M   1% /dev/shm
  156. tmpfs           250M  200K  250M   1% /run
  157. tmpfs           250M     0  250M   0% /sys/fs/cgroup
  158. tmpfs           250M  4.0K  250M   1% /tmp
  159. /dev/mmcblk0p1   70M   54M   16M  78% /media/BEAGLEBONE
  160. root@beaglebone:~# date
  161. Sat Jan  1 00:32:15 UTC 2000
  162. root@beaglebone:~# ps aux
  163. USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
  164. root         1  0.0  0.5   4768  2632 ?        Ss   00:00   0:00 /sbin/init
  165. root         2  0.0  0.0      0     0 ?        S    00:00   0:00 [kthreadd]
  166. root         3  0.0  0.0      0     0 ?        S    00:00   0:00 [ksoftirqd/0]
  167. root         5  0.0  0.0      0     0 ?        S<   00:00   0:00 [kworker/0:0H]
  168. root         7  0.0  0.0      0     0 ?        S<   00:00   0:00 [kworker/u:0H]
  169. root         8  0.0  0.0      0     0 ?        S    00:00   0:00 [migration/0]
  170. root         9  0.0  0.0      0     0 ?        S    00:00   0:00 [rcu_bh]
  171. root        10  0.0  0.0      0     0 ?        R    00:00   0:00 [rcu_sched]
  172. root        11  0.0  0.0      0     0 ?        S    00:00   0:00 [watchdog/0]
  173. root        12  0.0  0.0      0     0 ?        S<   00:00   0:00 [khelper]
  174. root        13  0.0  0.0      0     0 ?        S    00:00   0:00 [kdevtmpfs]
  175. root        14  0.0  0.0      0     0 ?        S<   00:00   0:00 [netns]
  176. root        15  0.0  0.0      0     0 ?        S    00:00   0:01 [kworker/0:1]
  177. root        16  0.0  0.0      0     0 ?        S    00:00   0:00 [bdi-default]
  178. root        17  0.0  0.0      0     0 ?        S<   00:00   0:00 [kintegrityd]
  179. root        18  0.0  0.0      0     0 ?        S<   00:00   0:00 [kblockd]
  180. root        19  0.0  0.0      0     0 ?        S    00:00   0:00 [khubd]
  181. root        20  0.0  0.0      0     0 ?        S    00:00   0:00 [irq/86-44e0b000]
  182. root        21  0.0  0.0      0     0 ?        S    00:00   0:00 [kworker/u:1]
  183. root        26  0.0  0.0      0     0 ?        S    00:00   0:00 [irq/46-4819c000]
  184. root        35  0.0  0.0      0     0 ?        S<   00:00   0:00 [rpciod]
  185. root        37  0.0  0.0      0     0 ?        S    00:00   0:00 [khungtaskd]
  186. root        38  0.0  0.0      0     0 ?        S    00:00   0:00 [kswapd0]
  187. root        39  0.0  0.0      0     0 ?        S    00:00   0:00 [fsnotify_mark]
  188. root        40  0.0  0.0      0     0 ?        S<   00:00   0:00 [nfsiod]
  189. root        41  0.0  0.0      0     0 ?        S<   00:00   0:00 [crypto]
  190. root        44  0.0  0.0      0     0 ?        S<   00:00   0:00 [pencrypt]
  191. root        45  0.0  0.0      0     0 ?        S<   00:00   0:00 [pdecrypt]
  192. root        52  0.0  0.0      0     0 ?        S<   00:00   0:00 [OMAP UART0]
  193. root        55  0.0  0.0      0     0 ?        S<   00:00   0:00 [kpsmoused]
  194. root        67  0.0  0.0      0     0 ?        S    00:00   0:00 [kworker/u:2]
  195. root        70  0.0  0.0      0     0 ?        S    00:00   0:01 [mmcqd/1]
  196. root        71  0.0  0.0      0     0 ?        S    00:00   0:00 [mmcqd/1boot0]
  197. root        72  0.0  0.0      0     0 ?        S    00:00   0:00 [mmcqd/1boot1]
  198. root        73  0.0  0.0      0     0 ?        S<   00:00   0:00 [deferwq]
  199. root        76  0.0  0.0      0     0 ?        S<   00:00   0:00 [kworker/0:1H]
  200. root        77  0.0  0.0      0     0 ?        S    00:00   0:00 [jbd2/mmcblk0p2-]
  201. root        78  0.0  0.0      0     0 ?        S<   00:00   0:00 [ext4-dio-unwrit]
  202. root        84  0.0  2.0  69072 10336 ?        Ss   00:00   0:01 /lib/systemd/systemd-journald
  203. root        85  0.0  0.3   3580  1560 ?        Ss   00:00   0:00 /lib/systemd/systemd-udevd
  204. root        97  0.0  0.0      0     0 ?        S<   00:00   0:00 [krfcommd]
  205. root       121  0.0  0.2   3008  1200 ?        Ss   00:00   0:00 /usr/sbin/crond -n
  206. avahi      122  0.0  0.3   3328  1612 ?        Ss   00:00   0:00 avahi-daemon: running [beaglebone.local]
  207. root       123  0.0  0.4   5524  2180 ?        Ss   00:00   0:00 /usr/sbin/connmand -n
  208. root       125  0.0  0.2   3012  1332 ?        Ss   00:00   0:00 /bin/sh /usr/bin/g-ether-load.sh
  209. root       126  0.0  1.9  15300  9800 ?        Ss   00:00   0:01 /usr/bin/python gateone.py
  210. root       137  0.0  1.8  38996  9312 ?        Ssl  00:00   0:01 /usr/bin/node autorun.js
  211. root       140  0.2  2.5  52476 12988 ?        Ss   00:00   0:05 /usr/bin/node4 /usr/share/cloud9/bin/cloud9.js -l 0.0.0.0 -w /var/lib/cloud9 -p 3000
  212. root       141  0.0  0.2   3304  1380 ?        Ss   00:00   0:00 /lib/systemd/systemd-logind
  213. 999        142  0.0  0.3   3232  1768 ?        Ss   00:00   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activ
  214. root       143  0.0  0.1   1992   724 tty1     Ss+  00:00   0:00 /sbin/agetty --noclear tty1 38400 linux
  215. root       144  0.0  0.4  15028  2236 ?        Ssl  00:00   0:00 /usr/sbin/gdm-binary -nodaemon
  216. avahi      148  0.0  0.0   3204   464 ?        S    00:00   0:00 avahi-daemon: chroot helper
  217. root       205  0.0  0.0      0     0 ?        S    00:00   0:00 [file-storage]
  218. root       208  0.0  0.6  18688  3560 ?        Sl   00:00   0:00 /usr/libexec/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display1
  219. root       210  0.0  0.2   4644  1224 ?        Ss   00:00   0:00 /usr/sbin/wpa_supplicant -u
  220. root       211  0.0  0.0      0     0 ?        S    00:00   0:00 [flush-179:0]
  221. root       215  0.1  2.1  27936 10780 tty2     Ss+  00:00   0:02 /usr/bin/X :0 -br -verbose -auth /var/run/gdm/auth-for-gdm-CF6Sft/database -nolisten
  222. root       224  0.0  0.1   2152   688 ?        S    00:00   0:00 /usr/sbin/udhcpd -f -S /etc/udhcpd.conf
  223. root       305  0.0  0.6  19848  3524 ?        Ssl  00:00   0:00 /usr/sbin/console-kit-daemon --no-daemon
  224. root       372  0.0  0.7  24976  3584 ?        Sl   00:00   0:00 /usr/libexec/polkitd --no-debug
  225. root       373  0.0  0.1   1992   712 ttyO0    Ss+  00:00   0:00 /sbin/agetty -s ttyO0 115200
  226. root       434  0.0  0.4  15716  2548 ?        Sl   00:00   0:00 /usr/libexec/gdm-session-worker
  227. root       437  0.0  0.6  24960  3116 ?        Sl   00:00   0:00 /usr/libexec/upowerd
  228. root       527  0.0  1.0  26420  5420 ?        Ssl  00:00   0:00 gnome-session
  229. root       538  0.0  0.0   3252   444 ?        Ss   00:00   0:00 /usr/bin/ssh-agent -- gnome-session
  230. root       541  0.0  0.1   2940   656 ?        S    00:00   0:00 dbus-launch --exit-with-session gnome-session
  231. root       542  0.0  0.2   3796  1372 ?        Ss   00:00   0:00 /usr/bin/dbus-daemon --fork --print-pid 4 --print-address 6 --session
  232. root       545  0.0  0.5   6612  2628 ?        S    00:00   0:00 /usr/libexec/gconfd-2
  233. root       553  0.0  0.5  25152  2992 ?        Sl   00:00   0:00 gnome-keyring-daemon --start --components=gpg
  234. root       556  0.0  1.6  89728  8328 ?        Ss   00:00   0:01 /usr/libexec/gnome-settings-daemon
  235. root       558  0.0  0.3   5792  1968 ?        S    00:00   0:00 /usr/libexec/gvfsd
  236. root       564  0.0  0.5  33136  2688 ?        Ssl  00:00   0:00 /usr/libexec//gvfs-fuse-daemon /home/root/.gvfs
  237. root       572  0.0  1.2  18248  6432 ?        S    00:00   0:00 metacity
  238. root       574  0.0  0.6  33948  3500 ?        S    00:00   0:00 /usr/libexec/gvfs-gdu-volume-monitor
  239. root       575  0.0  2.1  56228 10816 ?        Sl   00:00   0:01 gnome-panel
  240. root       576  0.0  0.6  24800  3348 ?        Ssl  00:00   0:00 /usr/libexec/udisks-daemon
  241. root       577  0.0  0.1   5820   712 ?        S    00:00   0:00 udisks-daemon: not polling any devices
  242. root       581  0.0  0.3   6888  2028 ?        S    00:00   0:00 /usr/libexec/gvfs-gphoto2-volume-monitor
  243. root       582  0.1  2.4  42224 12676 ?        Sl   00:00   0:01 nautilus
  244. root       587  0.0  1.9  38084  9788 ?        Sl   00:00   0:00 /usr/libexec/wnck-applet
  245. root       588  0.0  1.2  18096  6136 ?        S    00:00   0:00 gnome-power-manager
  246. root       592  0.0  1.2  18640  6364 ?        S    00:00   0:00 /usr/libexec/gdu-notification-daemon
  247. root       593  0.0  1.4  17968  7264 ?        S    00:00   0:00 connman-applet
  248. root       594  0.0  1.4  17928  7432 ?        S    00:00   0:00 bluetooth-applet
  249. root       596  0.0  2.0  40532 10288 ?        Sl   00:00   0:00 /usr/libexec/clock-applet
  250. root       598  0.0  1.3  35500  7112 ?        Sl   00:00   0:00 /usr/libexec/notification-area-applet
  251. root       605  0.0  0.5   6244  2796 ?        S    00:00   0:00 /usr/libexec/gvfsd-trash --spawner :1.10 /org/gtk/gvfs/exec_spaw/0
  252. root       621  0.2  0.2   3028  1324 ?        Ss   00:24   0:01 /usr/sbin/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key -p 22
  253. root       622  0.0  0.0      0     0 ?        S    00:24   0:00 [kworker/0:2]
  254. root       623  0.0  0.3   3100  1652 pts/0    Ss   00:24   0:00 -sh
  255. root       645  0.0  0.1   2620   968 pts/0    R+   00:32   0:00 ps aux
  256. END
  257. OK! 今天就到这里了!

  258. Good Bye BBB~
复制代码
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
11条回答
原野之狼
1楼-- · 2019-07-31 17:58
排版问题真令人头疼!
沙发
2楼-- · 2019-07-31 22:36
抢沙发!
zhangmangui
3楼-- · 2019-07-31 23:45
 精彩回答 2  元偷偷看……
原野之狼
4楼-- · 2019-08-01 02:23
这么快就沉底了...
zhangmangui
5楼-- · 2019-08-01 04:20
当狼遇上Beaglebone?   现在怎么样了   顶顶顶
原野之狼
6楼-- · 2019-08-01 06:18
zhangmangui 发表于 2014-7-14 22:42
当狼遇上Beaglebone?   现在怎么样了   顶顶顶

慢慢玩  不着急~

或者大家关心啥问题,我可以研究下:lol

一周热门 更多>