串口登录后就方便其他操作了。
连接WIFI
开发板和电脑连接同一WIFI后,我们就可以使用无线网进行SSH登录了。
并且开发板也可以上外网了。
wifi_start.sh qiqiqiqi cqmygysdss
打印如下
connect to WiFi ssid: qiqiqiqi, Passwd: cqmygysdss
killall: wpa_supplicant: no process killed
Successfully ini
tialized wpa_supplicant
[ 404.324931] P2P interface registered
[ 404.324974] wl_cfgp2p_add_p2p_disc_if: wdev: 89daccc1, wdev->net: (null)
[ 404.372152] WLC_E_IF: NO_IF set, event Ignored
[ 404.374364] P2P interface started
[root@EASY-EAI-NANO:/]# [ 404.422879] [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 0, bssidx: 0
[ 405.560685] [dhd-wlan0] wl_cfg80211_connect : Connecting with d4:35:38:a2:da:19 ssid "qiqiqiqi", len (8), sec=wpa2psk/tkipaes, channel=10
[ 405.560685]
[ 405.590043] dhd_dbg_start_pkt_monitor, 1724
[ 405.860888] [dhd-wlan0] wl_iw_event : Link UP with d4:35:38:a2:da:19
[ 405.860997] [dhd-wlan0] wl_ext_iapsta_event : [S] Link UP with d4:35:38:a2:da:19
[ 405.861058] [dhd-wlan0] wl_notify_connect_status : wl_bss_connect_done succeeded with d4:35:38:a2:da:19
[ 405.942187] [dhd-wlan0] wl_notify_connect_status : wl_bss_connect_done succeeded with d4:35:38:a2:da:19 vndr_oui: 00-90-4C 00-0C-43
Ping外网确认连接
ping www.baidu.com
打印如下
64 bytes from localhost (183.232.231.174): icmp_seq=1 ttl=54 time=36.2 ms
64 bytes from localhost (183.232.231.174): icmp_seq=2 ttl=54 time=50.8 ms
^C
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 36.269/43.577/50.886/7.311 ms
无线SSH登录
开发板和电脑连接同一WIFI。
ifconfig
查看ip
[root@EASY-EAI-NANO:/]# ifconfig
eth0 Link encap:Ethernet HWaddr D6:6B:41:35:BD:9D
inet addr:192.168.1.168 Bcast:192.168.1.255 Mask:255.255.255.0
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:68
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:184 errors:0 dropped:0 overruns:0 frame:0
TX packets:184 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11488 (11.2 KiB) TX bytes:11488 (11.2 KiB)
wlan0 Link encap:Ethernet HWaddr 08:FB:EA:78:BF:0A
inet addr:192.168.31.49 Bcast:192.168.31.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:72 errors:0 dropped:0 overruns:0 frame:0
TX packets:86 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6016 (5.8 KiB) TX bytes:10540 (10.2 KiB)
[root@EASY-EAI-NANO:/]#
我这里开发板IP是192.168.31.49
电脑ping 开发板
命令行中ping 192.168.31.49
命令行中ipconfig查看电脑ip
无线局域网适配器 WLAN:
连接特定的 DNS 后缀 . . . . . . . :
本地链接 IPv6 地址. . . . . . . . : fe80::3557:1c74:c76f:bc5d%25
IPv4 地址 . . . . . . . . . . . . : 192.168.31.236
子网掩码 . . . . . . . . . . . . : 255.255.255.0
默认网关. . . . . . . . . . . . . : 192.168.31.1
开发板ping电脑
[root@EASY-EAI-NANO:/]# ping 192.168.31.236
PING 192.168.31.236 (192.168.31.236) 56(84) bytes of data.
64 bytes from 192.168.31.236: icmp_seq=1 ttl=128 time=165 ms
64 bytes from 192.168.31.236: icmp_seq=2 ttl=128 time=25.6 ms
^C
--- 192.168.31.236 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 25.668/95.642/165.616/69.974 ms
双向ping通后,可以ssh登录
我这里使用CRT
用户名和密码都是root
登录成功
有线SSH登录
和无线SSH登录类似,开发板eth0默认IP是192.168.1.168 ,电脑需要改为同一网段。
过程就不再赘述了。
背光灯测试
vi brightness.sh
添加如下代码,实现明亮渐变操作。
#!/bin/bash
while true
do
for i in {1..255}
do
echo $i > /sys/class/backlight/backlight/brightness
usleep 10000
done
for i in {1..255}
do
j=$((255-$i))
echo $j > /sys/class/backlight/backlight/brightness
usleep 10000
done
Done
chmod +x brightness.sh
./brightness.sh
可以看到暗区变化快,亮区变化慢,并且也不是线性的。
人脸识别/摄像头测试
/userdata/apps/facialGate/qSolu-facialGate
能实时预览摄像头说明摄像头OK。
声音录放播放MP3
串口rz导入test.mp3
mp3play.sh test.mp3 16000 注意要和实际采样率对应
录放
amixer cset name='Digital Capture Volume' 100,100 调节录音英两最大120
arecord -f cd test.wav 录音
amixer cset name='Master Playback Volume' 255,255 调节播放最大音量最大255
aplay test.wav 播放
配置播放通道
amixer cset name='Playback Path' 'SPK' 喇叭
amixer cset name='Playback Path' 'HP' 耳机
amixer cset name='Playback Path' 'SPK_HP' 耳机和喇叭
amixer cset name='Playback Path' 'OFF' 关闭
访问SD卡/U盘
SD卡挂载在/mnt/sdcard
U盘一般使用下层独立USB HOST2挂载在/media/usbN
上层USB HOST1与ADB复用,需要断开ADB,并且OTG拨码开关要拨向HOST1重启开发板。
总结
经过上面的测试,确认了外设状态,也熟悉了各模块,后面再进行对应的应用开发。