[Beijing Xunwei] i.MX6ULL Terminator Linux WIFI driver experiment rtl8723 Wifi networking test

Use the rtl8723 module networking test process on the development board as follows:
① Because the driver of the rtl8723 module is compiled into the kernel, the development board will run the driver after startup.
② First try the ifconfig command to turn off the eth0 device, and then use the ifconfig command to turn on the wlan corresponding to rtl8723 Device, usually wlan0.
③ Use the iwlist command to scan the wifi hotspots of the current environment to test whether the WIFI works normally. Second, check whether the WIFI hotspot you want to connect to can be scanned. If it fails to scan, it will definitely not be able to connect.
④ Use the wpa_supplicant command to connect to the designated wifi hotspot.
We follow the process to execute it step by step. First start the development board, waiting to start completely after the first use of the ifconfig command to close eth0 device eth0 wired network corresponding device, can not cards use the same time, the command is as follows:
ifconfig eth0 down
using the ifconfig command to open the wlan equipment, the command is as follows:
ifconfig wlan0 up
we want to connect "XW "This wifi hotspot, then use the iwlist command to check whether the hotspot information can be scanned, the command is as follows: the
iwlist wlan0 scan
scanning result is shown in Figure 1:
Insert picture description here

figure 1

We can scan the wifi hotspot information to be connected. Then you can use the wpa_supplicant command to connect.
Before using the wpa_supplicant command, create a wpa_supplicant.conf configuration file in the /etc directory of the root file system of the development board. This file is used to configure the wifi hotspot and the password of the wifi hotspot to be connected. For example, if I want to connect to the hot spot "XW", the content of the wpa_supplicant.conf file is as follows:

1 ctrl_interface=/var/run/wpa_supplicant 
2 ap_scan=1 
3 network={
    
     
4  ssid="XW" 
5  psk="xxxxxxxx" 
6 } 

Line 4, ssid is the name of the WIFI hotspot to be connected, here I want to connect to the wifi hotspot "XW".
In line 5, psk is the WIFI hotspot password to be connected, just fill it in according to your actual situation.
Note that the wpa_supplicant.conf file has strict format requirements. There must be no spaces before and after "=", and do not use the TAB key to indent. For example, the indentation of lines 4 and 5 should use spaces, otherwise wpa_supplicant will appear. conf file parsing error. The most important point is that the contents of the wpa_supplicant.conf file must be entered manually by yourself, don't be lazy to copy and paste.
After the wpa_supplicant.conf file is written, create a "/var/run/wpa_supplicant" directory under the open root file system. This directory
mkdir /var/run/wpa_supplicant -p
is used by the wpa_supplicant tool . The command is as follows: After everything is ready, you can use the wpa_supplicant tool to make rtl8723 wifi When the module is connected to the hotspot, enter the following command:
wpa_supplicant -D wext -c /etc/wpa_supplicant.conf -i wlan0 &
When rlt8723 connects to the wifi hotspot, the information shown in Figure 2 will be printed:
Insert picture description here

figure 2

When testing, it is possible that RTL8723 will print a lot of debugging information, which may cause normal operation. Modify the source file drivers/net/wireless/rtl8723BU/include/autoconf.h, and comment out the #define CONFIG_DEBUG statement on line 320, so that rtl8723 is used. There will be no debugging information printed when wifi module. As shown in Figure 54.4.3:
Insert picture description here

image 3

When connected to the WIFI hotspot, it will output "wlan0: CTRL-EVENT-CONNECTED". The next step is the last step, set the IP address of wlan0, here use the udhcpc command to apply for an IP address from the router, enter the following command:
udhcpc -i wlan0 //Obtain an IP address from the router
After the IP address is successfully obtained, as shown in Figure 4:
Insert picture description here

Figure 4

As can be seen from the above figure, wlan0 successfully obtained the IP address, and the IP address is 192.168.1.84. You can use the ifconfig command to view the detailed information of the wlan0 network card.
The
result of ifconfig wlan0 is shown in Figure 5:
Insert picture description here

Figure 5

After the IP address is assigned successfully, you can use the ping command to test whether the network is in normal use, the command is as follows;
ping www.baidu.com -c 4
"-C" specifies the number of communications. The result is shown in Figure 6:
Insert picture description here

Figure 6

The above figure shows that the network communication is normal, and the rtl8723 wifi module is used normally.

Insert picture description here

Guess you like

Origin blog.csdn.net/BeiJingXunWei/article/details/112977341