查看: 1199|回復: 0
打印 上一主題 下一主題

5G智能網(wǎng)關(guān)功能測試-WIFI功能測試

[復制鏈接]
跳轉到指定樓層
樓主
發(fā)表于 2021-2-25 14:24:15 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
關(guān)鍵詞: 飛凌嵌入式
本文以飛凌嵌入式FCU2303(5G智能網(wǎng)關(guān)3.0)https://www.forlinx.com/product/130.html為基礎講解,本節主要介紹5G智能網(wǎng)關(guān) WIFI功能的測試。關(guān)于FCU2303(5G智能網(wǎng)關(guān)3.0)如果想將4G/5G模塊的流量通過(guò)以太網(wǎng)或者wifi AP模式分享出去的方式在《5G智能網(wǎng)關(guān)功能測試第一章4G/5G 上網(wǎng)測試》中已經(jīng)有所設計,此章節就不在贅述。

一、FCU2303(5G智能網(wǎng)關(guān)3.0)WiFi測試5G智能網(wǎng)關(guān)WiFi天線(xiàn)在外殼上的標識為:


1、板載WiFi 測試FCU2303(5G智能網(wǎng)關(guān)3.0)上可以通過(guò)m.2 Type 2230接口,即E KEY標準接口默認外接INTEL 3168NGW模塊。
系統上電前將模塊插入底板相應卡槽,上電后啟動(dòng)linux后,通過(guò)lspci可以看到對應設備枚舉成功。
root@localhost:~# lspci0000:00:00.0 PCI bridge: Freescale Semiconductor Inc Device 81c0 (rev 10)0001:00:00.0 PCI bridge: Freescale Semiconductor Inc Device 81c0 (rev 10)0001:01:00.0 Network controller: Intel Corporation Device 24fb (rev 10)0002:00:00.0 PCI bridge: Freescale Semiconductor Inc Device 81c0 (rev 10)2、配置WiFi上網(wǎng)輸入ifconfig wlP1p1s0命令查看WiFi網(wǎng)絡(luò )節點(diǎn):
root@localhost:~# ifconfig wlP1p1s0wlP1p1s0: flags=4098ADCAST,MULTICAST>  mtu 1500        ether d8:3b:bf:b9:dd:27  txqueuelen 1000  (Ethernet)        RX packets 0  bytes 0 (0.0 B)        RX errors 0  dropped 0  overruns 0  frame 0        TX packets 0  bytes 0 (0.0 B)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0Ubuntu18 中 wifi 的名稱(chēng)不再是wlan0類(lèi)似的命名方式,而是采用固件版本的形式,如上所示INTEL 3168NGW的名稱(chēng)為 wlP1p1s0。
注意:在FCU2303(5G智能網(wǎng)關(guān)3.0)中,WiFi模塊已經(jīng)配置成AP熱點(diǎn)功能并加入網(wǎng)橋br0中,Wifi熱點(diǎn)名稱(chēng)為wifi_test,密碼為12345678,Wifi熱點(diǎn)的配置文件為:
root@localhost:~# cat /etc/hostapd/hostapd.confinteRFace=wlP1p1s0driver=nl80211ssid=wifi_testchannel=9hw_mode=gmacaddr_acl=0ignore_broadcast_ssid=0auth_algs=1wpa=3wpa_passphrase=12345678wpa_key_mgmt=WPA-PSKwpa_pairwise=TKIPrsn_pairwise=CCMP如果客戶(hù)想關(guān)閉掉WiFi模塊的AP熱點(diǎn)功能,用作STA模式,并將WiFi模塊從網(wǎng)橋中去除,可以執行以下命令:root@localhost:~# rm /etc/systemd/system/multi-user.target.wants/hostapd.serviceroot@localhost:~# rm /etc/systemd/network/wlan0.network二、STA模式測試1、使用簡(jiǎn)易腳本測試為了方便客戶(hù)能夠更快速驗證功能,我們提供了wifi連接的腳本,首先查看wifi_connect.sh的使用說(shuō)明,如下表:
參數
說(shuō)明
-s
準備連接的WIFI的名稱(chēng)
-p
準備連接的WIFI的密碼,如果沒(méi)有加密請使用-p NONE
-a
是否隨開(kāi)機自動(dòng)啟動(dòng),如果是則為ON,如果不是則為OFF,如果沒(méi)有此項則保持原有設置

舉例如下,連接 WIFI 的名稱(chēng)為 resona 密碼為 23456789 的 WIFI:
root@localhost:~# /root/Net_Tools/wifi_connect.sh -s resona -p 23456789 Begain Wireless connect ... -----------------------SSID: resonaPASW: 23456789 ----------------------- Wireless point is  wlP1p1s0 Wireless status is DISCONNECTED Wireless status is SCANNING Wireless status is COMPLETED ----------------------- Wireless connect statusbssid=2a:9a:7d:5f:4e:bbfreq=2462ssid=resonaid=0mode=stationpairwise_cipher=CCMPgroup_cipher=CCMPkey_mgmt=WPA2-PSKwpa_state=COMPLETEDaddress=28:7f:cf:ca:89:9cuuid=2d6ba737-00d3-55c6-ab0b-b10df8ef1d1d ----------------------- Wireless connect done !!! Auto start setting not change此步完成以后則Wifi連接成功
2、使用命令逐步操作測試:下面的方法為使用命令連接wifi的詳細方法,供客戶(hù)后期開(kāi)發(fā)程序使用
首先使用 wifi_wpa.sh 腳本生成 wpa_supplicant 配置文件,首先查看wifi_wpa.sh的使用說(shuō)明,如下表:
參數
說(shuō)明
-s
準備連接的WIFI的名稱(chēng)
-p
準備連接的WIFI的密碼,如果沒(méi)有加密請使用-p NONE
舉例如下,連接 WIFI 的名稱(chēng)為 resona 密碼為 23456789 的 WIFI:
root@localhost:~# /root/Net_Tools/wifi_wpa.sh -s resona -p 23456789ssid resonapasw 23456789生成的配置文件為:/etc/wpa_supplicant.confroot@localhost:~# cat /etc/wpa_supplicant.conf#PSK/TKIPctrl_interface=/var/run/wpa_supplicantp2p_disabLED=1network={ssid="resona"scan_ssid=1psk="23456789"key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONEgroup=CCMP TKIP WEP104 WEP40}連接測試:root@localhost:~# wpa_supplicant -B -c /etc/wpa_supplicant.conf -i wlP1p1s0 &[1] 5173Successfully initialized wpa_supplicant查看連接狀態(tài)root@localhost:~# wpa_cli status -i wlP1p1s0bssid=b6:24:1e:e8:9b:82freq=2462ssid=resonaid=0mode=stationpairwise_cipher=CCMPgroup_cipher=CCMPkey_mgmt=WPA2-PSKwpa_state=COMPLETEDaddress=d8:3b:bf:b9:dd:27uuid=ada8b469-9fb8-5e6d-890a-daf96422b26c獲取IP地址:root@localhost:~# dhclient -i wlP1p1s0測試WiFi
測試WiFi,ping 域名或者IP。
root@localhost:~# dhclient -i wlP1p1s0root@localhost:~# ping www.forlinx.com -c 3 -I wlP1p1s0PING www.a.shifen.com (61.135.169.125) from 192.168.43.143 wlP1p1s0: 56(84) bytes of data.64 bytes from 61.135.169.125 (61.135.169.125): icmp_seq=1 ttl=53 time=39.2 ms64 bytes from 61.135.169.125 (61.135.169.125): icmp_seq=2 ttl=53 time=58.2 ms64 bytes from 61.135.169.125 (61.135.169.125): icmp_seq=3 ttl=53 time=48.9 ms--- www.a.shifen.com ping statistics ---3 packets transmitted, 3 received, 0% packet loss, time 2003msrtt min/avg/max/mdev = 39.216/48.822/58.282/7.784 ms進(jìn)入官網(wǎng)了解更多詳情 https://www.forlinx.com/
您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

關(guān)于我們  -  服務(wù)條款  -  使用指南  -  站點(diǎn)地圖  -  友情鏈接  -  聯(lián)系我們
電子工程網(wǎng) © 版權所有   京ICP備16069177號 | 京公網(wǎng)安備11010502021702
快速回復 返回頂部 返回列表
午夜高清国产拍精品福利|亚洲色精品88色婷婷七月丁香|91久久精品无码一区|99久久国语露脸精品|动漫卡通亚洲综合专区48页