04 WIFI
1 WIFI Module Overview
GM-3568JHF development board integrates RTL8723DU wireless network module, providing complete IEEE 802.11 b/g/n wireless network connection function. The module connects to the main control chip via USB interface, supporting 2.4GHz frequency band wireless communication, providing flexible wireless network access capabilities for the development board.
1.1 RTL8723DU Module Technical Specifications
| Parameter | Specification |
|---|---|
| Chip Model | Realtek RTL8723DU |
| Interface Type | USB 2.0 |
| Wireless Standard | IEEE 802.11 b/g/n |
| Working Frequency | 2.4GHz (2.412~2.484GHz) |
| Transmission Rate | Max 150Mbps (802.11n) |
| Modulation | OFDM, CCK, BPSK, QPSK, 16-QAM, 64-QAM |
| Antenna Configuration | 1T1R (One Transmit One Receive) |
| Transmit Power | Max 20dBm |
| Receive Sensitivity | -70dBm @ 150Mbps |
| Encryption Support | WEP, WPA/WPA2-PSK, WPA/WPA2-Enterprise |
1.2 Performance Indicators
| Mode | Max Rate | Typical Range | Power Consumption |
|---|---|---|---|
| 802.11b | 11Mbps | 100m | Low |
| 802.11g | 54Mbps | 50m | Medium |
| 802.11n | 150Mbps | 30m | Medium High |
2 WIFI Connection Configuration
The development board uses the RTL8723DU module, and the system has pre-adapted the WIFI driver and related software components.
2.1 Connecting to WIFI
As shown in the figure, find the network icon in the upper right corner of the system and click to connect to WIFI. 
Use ifconfig command to view IP address and other information.
root@linaro-alip:/# ifconfig
···
wlx78228877b4a5: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.137.149 netmask 255.255.255.0 broadcast 192.168.137.255
inet6 fe80::d175:3cd1:73ca:ecc8 prefixlen 64 scopeid 0x20<link>
ether 78:22:88:77:b4:a5 txqueuelen 1000 (Ethernet)
RX packets 69 bytes 954099 (931.7 KiB)
RX errors 0 dropped 143 overruns 0 frame 0
TX packets 72 bytes 116372 (113.6 KiB)
TX errors 0 dropped 23 overruns 0 carrier 0 collisions 02.2 Connectivity Test
Execute the following command to check the obtained IP address, and test whether the communication between the development board and the PC is normal via the ping command. 192.168.49.85 is the actual IP address of the PC. Please ensure that the development board and the PC are in the same local area network.
root@linaro-alip:/# ping 192.168.49.85 -I wlx78228877b4a5 -c 8
ping 192.168.49.85 -I wlx78228877b4a5 -c 8
PING 192.168.49.85 (192.168.49.85) from 192.168.137.149 wlx78228877b4a5: 56(84) bytes of data.
64 bytes from 192.168.49.85: icmp_seq=1 ttl=127 time=5.14 ms
64 bytes from 192.168.49.85: icmp_seq=2 ttl=127 time=3.66 ms
64 bytes from 192.168.49.85: icmp_seq=3 ttl=127 time=2.83 ms
64 bytes from 192.168.49.85: icmp_seq=4 ttl=127 time=2.81 ms
64 bytes from 192.168.49.85: icmp_seq=5 ttl=127 time=9.44 ms
64 bytes from 192.168.49.85: icmp_seq=6 ttl=127 time=2.77 ms
64 bytes from 192.168.49.85: icmp_seq=7 ttl=127 time=3.46 ms
64 bytes from 192.168.49.85: icmp_seq=8 ttl=127 time=3.09 ms
--- 192.168.49.85 ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 7011ms
rtt min/avg/max/mdev = 2.771/4.150/9.442/2.128 ms2.3 TCP Bandwidth Test
Use the iperf3 tool to test the network communication bandwidth between the development board and the PC as follows.
Server Side
Connect the development board to the Internet and install the iperf3 tool, executing the following commands:
root@linaro-alip:/# sudo apt update
root@linaro-alip:/# sudo apt install iperf3The development board acts as the server, executing the following command:
root@linaro-alip:/# iperf3 -s
-----------------------------------------------------------
Server listening on 5201 (test #1)
-----------------------------------------------------------Client Side
The iperf3 tool for Windows can be obtained from the test toolkit.
Open PowerShell in Windows system, enter the path where the iperf3 tool is located. Use Windows as the client to send data by executing the following command:
.\iperf3.exe -c 192.168.137.149 // 192.168.137.149 is the server IP address2.4 Test Results
Server Side
root@linaro-alip:/# iperf3 -s
-----------------------------------------------------------
Server listening on 5201 (test #1)
-----------------------------------------------------------
Accepted connection from 192.168.137.1, port 65396
[ 5] local 192.168.137.149 port 5201 connected to 192.168.137.1 port 65397
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 4.88 MBytes 40.9 Mbits/sec
[ 5] 1.00-2.00 sec 5.40 MBytes 45.3 Mbits/sec
[ 5] 2.00-3.00 sec 5.22 MBytes 43.8 Mbits/sec
[ 5] 3.00-4.00 sec 5.36 MBytes 45.0 Mbits/sec
[ 5] 4.00-5.00 sec 5.14 MBytes 43.1 Mbits/sec
[ 5] 5.00-6.00 sec 5.22 MBytes 43.8 Mbits/sec
[ 5] 6.00-7.00 sec 5.40 MBytes 45.3 Mbits/sec
[ 5] 7.00-8.00 sec 5.12 MBytes 43.0 Mbits/sec
[ 5] 8.00-9.00 sec 5.38 MBytes 45.1 Mbits/sec
[ 5] 9.00-10.00 sec 5.24 MBytes 43.9 Mbits/sec
[ 5] 10.00-10.05 sec 266 KBytes 45.9 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate
[ 5] 0.00-10.05 sec 52.6 MBytes 43.9 Mbits/sec receiver
-----------------------------------------------------------Client Side

3 Command Line WIFI Configuration
3.1 Connecting WIFI with wpa_supplicant
1) Scanning for Available Networks
# Enable WIFI interface
sudo ifconfig wlx78228877b4a5 up
# Scan available WIFI networks
sudo iwlist wlx78228877b4a5 scan | grep ESSID
# Or use iw command
sudo iw dev wlx78228877b4a5 scan | grep SSID2) Creating wpa_supplicant Configuration File
# Create configuration file
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
# Add the following content
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1
country=CN
# WPA/WPA2-PSK Network Configuration
network={
ssid="YourWiFiName"
psk="YourPassword"
key_mgmt=WPA-PSK
priority=1
}
# Open Network Configuration
network={
ssid="OpenWiFi"
key_mgmt=NONE
priority=2
}
# WEP Network Configuration
network={
ssid="WEPNetwork"
wep_key0="your_wep_key"
key_mgmt=NONE
wep_tx_keyidx=0
}3) Connecting to WIFI Network
# Start wpa_supplicant
sudo wpa_supplicant -B -i wlx78228877b4a5 -c /etc/wpa_supplicant/wpa_supplicant.conf
# Obtain IP Address
sudo dhclient wlx78228877b4a5
# Check Connection Status
wpa_cli -i wlx78228877b4a5 status3.2 Managing WIFI with NetworkManager
Command Line Tool nmcli
# View WIFI Status
nmcli radio wifi
# Scan WIFI Networks
nmcli dev wifi list
# Connect to WIFI Network
nmcli dev wifi connect "SSID" password "PASSWORD"
# View Saved Connections
nmcli connection show
# Disconnect WIFI
nmcli dev disconnect wlx78228877b4a5
# Delete Saved Connection
nmcli connection delete "SSID"4 WIFI Hotspot Mode (AP Mode)
4.1 Installing hostapd
sudo apt-get update
sudo apt-get install hostapd dnsmasq4.2 Configuring hostapd
# Create hostapd configuration file
sudo nano /etc/hostapd/hostapd.conf
# Add the following content
interface=wlx78228877b4a5
driver=nl80211
ssid=GM-3568JHF-AP
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=12345678
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP4.3 Configuring DHCP Service
# Backup original configuration
sudo cp /etc/dnsmasq.conf /etc/dnsmasq.conf.backup
# Edit dnsmasq configuration
sudo nano /etc/dnsmasq.conf
# Add the following content
interface=wlx78228877b4a5
dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h4.4 Configuring Network Interface
# Set Static IP
sudo ifconfig wlx78228877b4a5 192.168.4.1 netmask 255.255.255.0
# Enable IP Forwarding
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
# Configure NAT Rules
sudo iptables -t nat -A POSTROUTING -o end0 -j MASQUERADE
sudo iptables -A FORWARD -i end0 -o wlx78228877b4a5 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlx78228877b4a5 -o end0 -j ACCEPT4.5 Starting Hotspot Service
# Start hostapd
sudo hostapd /etc/hostapd/hostapd.conf &
# Start dnsmasq
sudo systemctl start dnsmasq
# Check Service Status
sudo systemctl status hostapd
sudo systemctl status dnsmasq5 Troubleshooting
1) WIFI Module Not Recognized
Check Steps:
# Check USB Device
lsusb | grep Realtek
# Check Kernel Module
lsmod | grep rtl
# Manually Load Driver
sudo modprobe rtl8xxxu
# Check Firmware Files
ls /lib/firmware/rtlwifi/2) Unable to Connect to WIFI Network
Possible Causes and Solutions:
# Check Network Interface Status
ip link show wlx78228877b4a5
# Restart Network Interface
sudo ifconfig wlx78228877b4a5 down
sudo ifconfig wlx78228877b4a5 up
# Check wpa_supplicant Log
sudo journalctl -u wpa_supplicant
# Reconfigure Network
sudo wpa_cli -i wlx78228877b4a5 reconfigure3) Weak Signal or Unstable Connection
Optimization Suggestions:
# Check Signal Strength
iwconfig wlx78228877b4a5 | grep "Signal level"
# Scan Channel Usage
sudo iwlist wlx78228877b4a5 scan | grep Frequency
# Change Channel (AP Mode)
sudo iwconfig wlx78228877b4a5 channel 6
# Adjust Transmit Power
sudo iwconfig wlx78228877b4a5 txpower 204) Slow Network Speed
Diagnosis and Optimization:
# Check Current Connection Rate
iwconfig wlx78228877b4a5 | grep "Bit Rate"
# Check Network Congestion
ping -c 10 8.8.8.8
# Test Bandwidth with iperf3
iperf3 -c speedtest.server.com
# Optimize TCP Window Size
echo 'net.core.rmem_max = 16777216' >> /etc/sysctl.conf
echo 'net.core.wmem_max = 16777216' >> /etc/sysctl.conf5) Hotspot Mode Issues
Common Issues Resolution:
# Check hostapd Status
sudo systemctl status hostapd
# View hostapd Log
sudo journalctl -u hostapd
# Check Firewall Settings
sudo iptables -L
# Restart Related Services
sudo systemctl restart hostapd
sudo systemctl restart dnsmasq