WIFI
Connect to Wi-Fi
First, make sure the antenna is properly connected to the development board; otherwise, it will be unable to scan for or connect to any Wi-Fi networks.

-
Switch to superuser mode:
sudo su -
Scan for available Wi-Fi networks:
nmcli dev wifi -
Connect to a Wi-Fi network (replace "wifi_name" and "wifi_password" with your actual Wi-Fi SSID and password):
nmcli dev wifi connect "wifi_name" password "wifi_password" -
If you see "successfully," it means the wireless network is connected successfully. The board will automatically connect to your specified Wi-Fi network on the next boot.
nmcli dev wifi connect Luckfox-5G password luckfox12345root@aura:/home/aura# nmcli dev wifi connect Luckfox-5G password luckfox12345Device 'wlan0' successfully activated with 'eb3c1765-e312-484c-b71b-740c5b988c34'.
1. Linux Network Interface Naming
In Linux distributions, Debian adopts the "Predictable Network Interface Names" scheme for naming network interfaces. This naming scheme aims to provide a consistent and predictable way of identifying and referencing network interfaces in the system, replacing the traditional irregular naming approach. It determines the names based on interface properties, hardware location, and other identifiers. According to the "Predictable Network Interface Names" scheme, the naming strategy for network interfaces includes the following:
- If the index number of an onboard device provided by Firmware or BIOS is available, it is used for naming, for example, eno1.
- If the index number of a PCI-E expansion slot provided by Firmware or BIOS is available, it is used for naming, for example, ens1.
- If the hardware interface's physical or location information is available, it is used for naming, for example, enp2s0.
- If the network interface's MAC address is available, it is used for naming, for example, enx525400d5e0fb.
- Traditional kernel-native naming, for example, eth0.
Consistent Network Device Naming is a specification used for wireless network interface naming in Linux. It aims to provide a consistent, predictable, and stable way of naming interfaces to reduce potential interface name changes during system reboots or hardware changes. In the consistent network device naming specification, the naming of wireless network interfaces typically includes the following information:
-
Interface Type: The naming uses the prefix "wl" to indicate a wireless network interface.
-
Device Physical Location or Topology: A numeric identifier, such as "0," is used to represent the position or sequence of the wireless network interface in the system. By default, the first detected wireless network interface will be named "wlan0," the second one "wlan1," and so on.
-
Interface Bus and Device Physical Location: A series of characters and numbers are used to represent the bus and physical location of the interface. The following characters and numbers have specific meanings:
w: Represents a wireless network interface.l: Represents a network device in the kernel (Linux).p: Represents the PCI bus.s: Represents the slot.- Number: Represents the bus and slot number.
For example, an interface named "wlp3s0" indicates a wireless network interface connected to the third slot of the PCI bus.
2. Using udev rules to assign user-defined network interface names
-
Display all network interfaces and their MAC addresses:
linaro@linaro-alip:~$ sudo ip link list1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:002: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000link/ether 1a:7a:d7:64:5d:56 brd ff:ff:ff:ff:ff:ff3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DORMANT group default qlen 1000link/ether b8:2d:28:43:ad:b0 brd ff:ff:ff:ff:ff:ff -
Create a file named /etc/udev/rules.d/70-custom-ifnames.rules with the following content:
SUBSYSTEM=="net",ACTION=="add",ATTR{address}=="1a:7a:d7:64:5d:56",ATTR{type}=="1",NAME="RJ-45"SUBSYSTEM=="net",ACTION=="add",ATTR{address}=="b8:2d:28:43:ad:b0",ATTR{type}=="1",NAME="WIFI" -
Restart the device:
sudo reboot -
Verify if the interface names for each MAC address match the values set in the NAME parameter of the rules file:
linaro@linaro-alip:~$ sudo ip link show1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:002: RJ-45: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000link/ether 1a:7a:d7:64:5d:56 brd ff:ff:ff:ff:ff:ff3: WIFI: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DORMANT group default qlen 1000link/ether b8:2d:28:43:ad:b0 brd ff:ff:ff:ff:ff:ff
3. Network Manager Introduction
In the previous tutorial, we learned how to connect to WiFi using nmcli. In this section, we will provide a detailed overview of nmcli and its usage.
Network Manager Command-Line Interface (nmcli) is a command-line tool used to manage network connections on Linux and Unix systems. It serves as the command-line frontend for Network Manager, allowing users to configure and manage networks through the terminal or shell scripts. nmcli can be used to create, display, edit, delete, activate, and deactivate network connections, as well as control and display the status of network devices.
-
Use the "--help" option to view the composition of nmcli commands:
linaro@linaro-alip:~$ nmcli --helpUsage: nmcli [OPTIONS] OBJECT { COMMAND | help }OPTIONS-o[verview] overview mode (hide default values)-t[erse] terse output-p[retty] pretty output-m[ode] tabular|multiline output mode-c[olors] auto|yes|no whether to use colors in output-f[ields] <field1,field2,...>|all|common specify fields to output-g[et-values] <field1,field2,...>|all|common shortcut for -m tabular -t -f-e[scape] yes|no escape columns separators in values-a[sk] ask for missing parameters-s[how-secrets] allow displaying passwords-w[ait] <seconds> set timeout waiting for finishing operations-v[ersion] show program version-h[elp] print this helpOBJECTg[eneral] NetworkManager's general status and operationsn[etworking] overall networking controlr[adio] NetworkManager radio switchesc[onnection] NetworkManager's connectionsd[evice] devices managed by NetworkManagera[gent] NetworkManager secret agent or polkit agentm[onitor] monitor NetworkManager changes -
Common Commands
Command Function nmcli n Display if NetworkManager is controlling the network settings nmcli n on Set NetworkManager to take control of the network nmcli n off Disable NetworkManager's control over the network nmcli c status View brief information about connections nmcli c show View detailed information about connections nmcli c up/down ifname Start/stop the specified connection (ifname refers to the network interface) nmcli c show(s) ifname View detailed information about the connection on the specified network interface (ifname) nmcli c delete(de) wlan0 Delete the specified connection nmcli d status Display the status of all network interface devices nmcli d show View detailed information about devices nmcli d sh wlan0 Display detailed information about a specific device (wlan0) nmcli d connect(c) wlan0 Connect to the device nmcli d disconnect(c) wlan0 Disconnect the device - Here, "c" is an abbreviation for "connection," and "d" is an abbreviation for "device."