一、iMX6ULL開發板 WIFI 功能測試
WiFi支持:
模塊 |
支持 |
RTL8188EUS |
WiFi |
RTL8723BU |
WiFi |
RTL8723DU |
WiFi |
1、 USB WIFI RTL8188eus使用
說明: USB WIFI無線局域網卡是選配模塊 ,如若有需求,請聯系飛凌嵌入式官網在線客服。
以下對wifi模塊在STA模式下,連接到無線網絡的測試:
步驟1:iMX6ULL開發板上電,啟動Linux系統。
步驟2:連接USBWIFI到飛凌iMX6ULL開發板的USB Host接口
步驟 3 :按照如下格式輸入相應的參數:
-i表示wifi型號;
-s表示wifi熱點名稱;
-p表示密碼,若無密碼輸入-p NONE;
路由器采用wpa加密方式。具體操作指令可查看wifi.sh腳本。
連接打印內容如下:
root@fl-imx6ull:~#fltest_cmd_wifi.sh -i 8188 -s forlinx -p xxxx |
打印信息如下:
wifi 8188 ssid forlinx pasw xxxx usbcore: deregistering interface driver rtl8723bu RTL871X: module exit start usbcore: deregistering interface driver rtl8188eu RTL871X: rtw_ndev_uninit(wlan1) usb 1-1.3: reset high-speed USB device number 7 using ci_hdrc RTL871X: module exit success RTL871X: module init start RTL871X: rtl8188eu v4.3.0.9_15178.20150907 RTL871X: build time: Mar 25 2020 02:23:46 bFWReady == _FALSE call reset 8051... RTL871X: rtw_ndev_init(wlan0) usbcore: registered new interface driver rtl8188eu RTL871X: module init ret=0 ==> rtl8188e_iol_efuse_patch IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready ps: invalid option -- 'f' BusyBox v1.24.1 (2019-04-27 02:24:01 CST) multi-call binary.
Usage: ps Successfully initialized wpa_supplicant rfkill: Cannot open RFKILL controRTL871X: set bssid:00:00:00:00:00:00 l device RTL871X: set ssid [g?isQ?J?)?????F|?T??vZ.c3????????] fw_state=0x00000008 ioctl[SIOCSIWAP]: Operation not permitted ioctl[SIOCGIWSCAN]: Resource temporarily unavailable ioctl[SIOCGIWSCAN]: Resource temporarily unavailable RTL871X: indicate disassoc wlan0: Trying to associate with 04:d7:a5:84:fa:40 (SSID='forlinx' freq=2437 MHz) RTL871X: set ssid [forlinx] fw_state=0x00000008 RTL871X: set bssid:04:d7:a5:84:fa:40 RTL871X: start auth RTL871X: auth success, start assoc RTL871X: assoc success IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready RTL871X: recv eapol packet wlan0: Associated with 04:d7:a5:84:fa:40 RTL871X: send eapol packet RsvdPageNum: 8 udhcpc (v1.24.1) started RTL871X: recv eapol packet RTL871X: send eapol packet RTL871X: recv eapol packet RTL871X: send eapol packet RTL871X: set pairwise key camid:4, addr:04:d7:a5:84:fa:40, kid:0, type:AES wlan0: WPA: Key negotiation completed with 04:d7:a5:84:fa:40 [PTKRTL871X: set group key camid:5, addr:04:d7:a5:84:fa:40, kid:2, type:AES =CCMP GTK=CCMP] wlan0: CTRL-EVENT-CONNECTED - Connection to 04:d7:a5:84:fa:40 completed [id=0 id_str=] Sending discover... Sending select for 192.168.4.129... Lease of 192.168.4.129 obtained, lease time 36000 /etc/udhcpc.d/50default: Adding DNS 222.222.202.202 /etc/udhcpc.d/50default: Adding DNS 222.222.222.222 Finshed! |
腳本運行完,能自動分配ip并添加DNS,則wifi連接成功。
步驟5:ping ip或者域名,命令如下。
root@fl-imx6ull:~# ping -c 4 www.baidu.com PING www.baidu.com (220.181.38.149): 56 data bytes 64 bytes from 220.181.38.149: seq=0 ttl=51 time=26.648 ms 64 bytes from 220.181.38.149: seq=1 ttl=51 time=13.529 ms 64 bytes from 220.181.38.149: seq=2 ttl=51 time=15.656 ms 64 bytes from 220.181.38.149: seq=3 ttl=51 time=26.249 ms
--- www.baidu.com ping statistics --- 4 packets transmitted, 4 packets received, 0% packet loss round-trip min/avg/max = 13.529/20.520/26.648 ms |
步驟6:卸載已經加入內核的模塊。
root@fl-imx6ull:~#rmmod 8188eu |
打印信息如下:
RTL871X: module exit start usbcore: deregistering interface driver rtl8188eu RTL871X: indicate disassoc RTL871X: rtw_cmd_thread: DriverStopped(1) SurpriseRemoved(0) break at line 478 wlan0: CTRL-EVENT-DISCONNECTED bssid=04:d7:a5:84:fa:40 reason=3 locally_generated=1 RTL871X: rtw_ndev_uninit(wlan0) RTL871X: rtw_dev_unload: driver not in IPS usb 1-1.3: reset high-speed USB device number 7 using ci_hdrc RTL871X: module exit success |
2、 板載WIFI的使用
說明:
l wifi頻率為2.4G
l 兼容8723bu和8723du兩種wifi驅動
l 默認路由器采用wpa加密方式。
如果開發板有板載的WIFI無線局域網卡,則焊接在評估板如圖所示位置(下圖為8723du):
步驟1:檢查iMX6ULL開發板是否已經焊接該模塊,正確焊接如上圖。連接上天線。
步驟2:iMX6ULL開發板上電,啟動Linux系統,先使用lsmod查看模塊加載狀態:
root@fl-imx6ull:~#lsmod Module Size Used by mx6s_capture 14876 0 8723 du 1313893 0 //默認wifi自動加載,8723du已加載成功 ov9650_camera 12446 0 |
注意:若 飛凌iMX6ULL 開發板上焊接的是8723 b u,使用lsmod會顯示8723 b u
以下以8723du為例進行測試描述:
步驟3:測試
? STA模式
該模式即作為一個站點,連接到無線網絡中,操作方法如下:
-i表示wifi型號;-s表示wifi熱點名稱;-p表示密碼,若無密碼輸入-p NONE;路由器采用wpa加密方式,具體操作指令可查看wifi.sh腳本
root@fl-imx6ull:~#fltest_cmd_wifi.sh -i 8723du -s forlinx -p xxx //執行測試腳本 |
打印信息如下:
wifi 8723du ssid forlinx pasw xxx usbcore: deregistering interface driver rtl8723du usbcore: registered new interface driver rtl8723du IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready Successfully initialized wpa_supplicant rfkill: Cannot open RFKILL control device udhcpc (v1.24.1) started Sending discover... wlan0: CTRL-EVENT-REGDOM-CHANGE init=BEACON_HINT type=UNKNOWN wlan0: Trying to associate with 04:d7:a5:f9:26:1d (SSID='forlinx' freq=2427 MHz) wlan0: Associated with 04:d7:a5:f9:26:1d IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready wlan0: WPA: Key negotiation completed with 04:d7:a5:f9:26:1d [PTK=CCMP GTK=TKIP] wlan0: CTRL-EVENT-CONNECTED - Connection to 04:d7:a5:f9:26:1d completed [id=0 id_str=] nf_conntrack: automatic helper assignment is deprecated and it will be removed soon. Use the iptables CT target to attach helpers instead. Sending discover... Sending select for 192.168.5.186... Lease of 192.168.5.186 obtained, lease time 1800 /etc/udhcpc.d/50default: Adding DNS 222.222.202.202 /etc/udhcpc.d/50default: Adding DNS 222.222.222.222 WLAN Finshed! |
腳本運行完,能自動分配ip并生成DNS,則wifi連接成功。
ping ip或者域名,命令如下:
root@fl-imx6ull:~#ping -c 5 www.baidu.com |
打印信息如下:
PING 192.168.4.1 (192.168.4.1): 56 data bytes 64 bytes from 192.168.4.1: seq=0 ttl=128 time=39.783 ms 64 bytes from 192.168.4.1: seq=1 ttl=128 time=81.529 ms 64 bytes from 192.168.4.1: seq=2 ttl=128 time=15.236 ms 64 bytes from 192.168.4.1: seq=3 ttl=128 time=12.076 ms 64 bytes from 192.168.4.1: seq=4 ttl=128 time=16.300 ms
--- 192.168.4.1 ping statistics --- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max = 12.076/32.984/81.529 ms |
wifi信號
查看WiFi信號方法如下:
root@fl-imx6ull:~#cat /proc/net/wireless | grep wlan0 | awk '{print $3}'//獲取信號強度 78. root@fl-imx6ull:~#cat /proc/net/wireless | grep wlan0 | awk '{print $4}'//獲取信號質量,單位dBm -68. root@fl-imx6ull:~#cat /proc/net/wireless | grep wlan0 | awk '{print $5}'//網口背景噪聲,單位dBm -256. |
AP模式
說明:
l 本模塊支持AP模式,理論最大連接用戶為8個。
l 本例為以太網eth0連接路由器說明,配置完以太網后,需要測試eth0是否可以連接外網,如果可以連接外網(方法參考 “有線網卡”章節),請繼續按照操作步驟執行,如果不可以請檢查以太網或者路由器連接是否正常。
工作在AP模式下,手機等設備可以直接連接模塊。
設置以太網IP,配置網絡防火墻:
root@fl-imx6ull:~#udhcpc -i eth0 //自動分配IP,若以測試eth0網絡正常,可不操作此步 root@fl-imx6ull:~#echo 1 > /proc/sys/net/ipv4/ip_forward //打開 IP 轉發 root@fl-imx6ull:~#iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE//設置轉發規則 |
設置WiFi的模式與IP
確保模塊8723bu已經加載。
root@fl-imx6ull:~# ifconfig wlan0 up //打開WiFi root@fl-imx6ull:~# ifconfig wlan0 192.168.0.10 netmask 255.255.255.0 //設置IP與子網掩碼 root@fl-imx6ull:~# ifconfig wlan0 promisc //設置 wlan0 為混雜模式 |
開啟AP
root@fl-imx6ull:~# udhcpd /etc/udhcpd/udhcpd.conf & //WiFi 地址、網關等配置信息 root@fl-imx6ull:~# hostapd -d /etc/hostapd/hostapd.conf & //加密方式、用戶名、密碼等設置 |
hostapd.conf文件中:ssid為用戶名,/為密碼
手機等移動終端可以通過WiFi連接到開發板的AP熱點,iMX6ULL開發板默認使用以下用戶名和密碼:
熱點名:forlinxtest密碼:1234567890
步驟4:卸載已經加入內核的模塊:
root@fl-imx6ull:~# rmmod 8723du usbcore: deregistering interface driver rtl8723du wlan0: CTRL-EVENT-DISCONNECTED bssid=04:d7:a5:f9:26:1d reason=0 |
FETMX6ULL-C核心板是飛凌基于NXP i.MX6U系列處理器推出的第三款核心板,成熟的技術方案,帶來穩定可靠的全新體驗。核心板尺寸僅40*29mm,并采用2mm合高的板對板連接器,將小體積、便于拆卸的優勢集一身。
審核編輯:符乾江
-
單片機
+關注
關注
6042文章
44617瀏覽量
637491 -
ARM
+關注
關注
134文章
9156瀏覽量
368559 -
嵌入式
+關注
關注
5090文章
19173瀏覽量
306847 -
編程
+關注
關注
88文章
3637瀏覽量
93903
發布評論請先 登錄
相關推薦
評論