WiFi Network Testing
The PI-SG565D single-board computer supports QCA1023 SDIO Wifi. This document describes how to connect to a Wi-Fi hotspot using Network Manager.
nmcli is a user-space program and a command-line tool provided by NetworkManager in Linux systems. It is used to manage network connections, especially in environments where a graphical interface is unavailable or for automated scripting. It can configure connections such as Ethernet, Wi-Fi, VLAN, bridging, proxy, and VPN. The following tutorial demonstrates how to connect to a Wi-Fi hotspot using nmcli.
General Steps and Examples for Connecting to WiFi
Enable Wireless Functionality
Use the following command to enable wireless functionality, which is equivalent to "turning on the Wi-Fi switch" in the desktop version:
nmcli radio wifi on
View Available WiFi List
Execute the command to scan and list the Wi-Fi networks detected by the current wireless network card. This command will display nearby WiFi networks along with their names (SSID), signal strength, channels, encryption methods, and other information:
nmcli dev wifi list ifname wlan0
The return result is as follows, showing information about surrounding hotspots:
root@QuecPi:~# nmcli dev wifi list ifname wlan0
IN-USE BSSID SSID MODE CHAN RATE SIGNAL BARS SECURITY
64:09:80:76:42:BE Xiaomi_42BD Infra 11 130 Mbit/s 100 ▂▄▆█ WPA1 WPA2
* F8:5E:3C:01:F8:18 xiupax Infra 11 130 Mbit/s 100 ▂▄▆█ --
9C:9D:7E:F7:30:5E tdz Infra 2 130 Mbit/s 97 ▂▄▆█ WPA1 WPA2
E2:F1:E1:57:D5:C6 gms-wifi Infra 1 0 Mbit/s 95 ▂▄▆█ WPA1 WPA2
E2:F1:E1:57:D5:C8 cit-test-5g Infra 1 0 Mbit/s 94 ▂▄▆█ WPA2
48:5F:08:BB:BA:41 TP-LINK_BA41 Infra 11 270 Mbit/s 87 ▂▄▆█ --
64:09:80:76:42:BF Xiaomi_42BD_5G Infra 157 270 Mbit/s 82 ▂▄▆█ WPA1 WPA2
B4:2F:03:DA:23:B5 5G_RRO_A23B5 Infra 157 135 Mbit/s 79 ▂▄▆_ WPA1 WPA2
A2:A7:90:A7:5B:A0 LSMate30 Infra 149 270 Mbit/s 77 ▂▄▆_ WPA2
A4:00:E2:EF:F7:83 Quectel-HF Infra 1 260 Mbit/s 74 ▂▄▆_ WPA1 WPA2 802.1X
F0:2F:74:2A:41:78 odmtest Infra 1 260 Mbit/s 74 ▂▄▆_ WPA3
2C:CF:67:6B:4A:86 HW-676B4A85 Infra 36 117 Mbit/s 74 ▂▄▆_ WPA1
A4:00:E2:EF:F7:82 Quectel-HF-2.4G Infra 1 260 Mbit/s 72 ▂▄▆_ WPA1 WPA2 802.1X
A4:00:E2:EF:F7:80 Quectel-Customer-2.4G Infra 1 260 Mbit/s 72 ▂▄▆_ WPA1 WPA2
66:D6:9A:C6:6D:21 PAXWIFIAP_2.4G Infra 1 130 Mbit/s 72 ▂▄▆_ WPA2
A4:00:E2:EF:F7:90 Quectel-Customer Infra 44 540 Mbit/s 72 ▂▄▆_ WPA1 WPA2
A4:00:E2:EF:F7:92 Quectel-HF Infra 44 540 Mbit/s 72 ▂▄▆_ WPA1 WPA2 802.1X
9C:9D:7E:F7:30:5F tdz Infra 149 270 Mbit/s 70 ▂▄▆_ WPA1 WPA2
34:CE:00:09:E5:A8 SW_test Infra 6 130 Mbit/s 69 ▂▄▆_ WPA1 WPA2
E2:F1:E1:57:D5:CA gms-wifi_5G Infra 149 270 Mbit/s 69 ▂▄▆_ WPA1 WPA2
E2:F1:E1:57:D5:CE cit-test-5g Infra 149 270 Mbit/s 69 ▂▄▆_ WPA2
F0:2F:74:2A:41:7C odmtest-5G Infra 161 540 Mbit/s 65 ▂▄▆_ WPA2
A4:00:E2:EF:F8:52 Quectel-HF Infra 36 540 Mbit/s 57 ▂▄▆_ WPA1 WPA2 802.1X
A4:00:E2:EF:F8:50 Quectel-Customer Infra 36 540 Mbit/s 57 ▂▄▆_ WPA1 WPA2
3C:7C:3F:0B:94:FC HWTEST Infra 161 540 Mbit/s 52 ▂▄__ WPA2
A4:00:E2:EF:F4:50 Quectel-Customer Infra 149 540 Mbit/s 49 ▂▄__ WPA1 WPA2
A4:00:E2:EF:F4:52 Quectel-HF Infra 149 540 Mbit/s 47 ▂▄__ WPA1 WPA2 802.1X
Connect to a WiFi Network
Select the WiFi network you want to connect to and execute the command nmcli dev wifi connect "your WiFi name" password "your password" to connect to the network. For example, nmcli dev wifi connect "MyHomeWiFi" password "12345678". If the network has no password, the password parameter is not required.
Connect to an encrypted hotspot:
root@QuecPi:~# nmcli dev wifi connect "SSID" password "12345678" ifname wlan0
Device 'wlan0' successfully activated with 'd0ef4183-ac40-41d5-8822-2cc174107c77'.
Connect to an open hotspot:
root@QuecPi:~# nmcli dev wifi connect "SSID" ifname wlan0
Device 'wlan0' successfully activated with 'd0ef4183-ac40-41d5-8822-2cc174107c77'.
Use the ifconfig command to view the network interface address:
root@qcm6490-idp:~# ifconfig
eth0 Link encap:Ethernet HWaddr 32:C0:A2:09:FE:40
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:167 Base address:0x1000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:75 errors:0 dropped:0 overruns:0 frame:0
TX packets:75 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6301 (6.1 KiB) TX bytes:6301 (6.1 KiB)
p2p0 Link encap:Ethernet HWaddr 02:03:7F:D6:00:01
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:3000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan0 Link encap:Ethernet HWaddr 00:03:7F:50:00:01
inet addr:192.168.253.211 Bcast:192.168.253.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3421 errors:0 dropped:0 overruns:0 frame:0
TX packets:61 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3000
RX bytes:151273 (147.7 KiB) TX bytes:7300 (7.1 KiB)
Network Testing
Execute the ping command to verify the network connection:
ping 192.168.1.1
→ If the IP address can be pinged successfully, it indicates a successful network connection (replace the gateway IP with actual values).ping 114.114.114.114
→ If the address can be pinged successfully, it indicates a successful external network connection.ping baidu.com
→ If the address can be pinged successfully, it indicates a successful DNS resolution and external network connection.