Configuring Wi-Fi on Raspberry Pi OS

1 Overview

This document explains how to configure Wi-Fi on Raspberry Pi OS using graphical tools or command-line methods.

1.1 Background

Users of ED-CM4SEN, ED-CM4IND, ED-IPC series, ED-HMI series, and other Wi-Fi-enabled products may face challenges configuring Wi-Fi due to unfamiliarity with Raspberry Pi's Debian-based system. This guide provides detailed instructions to resolve this issue.

1.2 Applicability

Applies to Wi-Fi-enabled products including ED-CM4SEN, ED-CM4IND, ED-IPC series, and ED-HMI series.

2 Configuration Guide

Raspberry Pi OS has Desktop and Lite editions. Configuration steps for both are described below.

2.1 Configuring Wi-Fi on Raspberry Pi OS (Desktop)

For Desktop editions, enable Wi-Fi via the desktop interface and connect using either the GUI or NetworkManager.

2.1.1 Enabling Wi-Fi

Wi-Fi is disabled by default and requires setting a country code to activate.

Steps:

  1. Left-click theimage-20240605105202872icon in the top-right corner. Select "Click here to set Wi-Fi country".
image-20241126174314132
  1. In the Wireless LAN Country window, select your country.
image-20240605105230131
  1. Click OK to save.

2.1.2 Connecting Wi-Fi via Desktop Icon

Preparation:

  • Wi-Fi is enabled.

Steps:

  1. Left-click the image-20240605105435147icon. Select your target Wi-Fi network.
image-20241126174353062
  1. Enter the Wi-Fi password in the Password field.
image-20240605105456533
  1. Click "Connect". After connection, verify Wi-Fi status via the top-right icon.

2.1.3 Connecting Wi-Fi via NetworkManager

Preparation:

  • Wi-Fi is enabled.
  • Know the SSID and password of Wi-Fi.

Steps:

  1. Execute the following command to scan for available networks.
sudo nmcli device wifi
image-20240605105531840
  1. Execute the following command to connect to the target network.
sudo nmcli device wifi connect SSID password password
  • SSID is the name of target network, password is the password of target network.
  1. Execute the following command to enable auto-connect.
sudo nmcli connection modify SSID connection.autoconnect yes
  • SSID is the name of target network.

2.2 Configuring Wi-Fi on Raspberry Pi OS (Lite)

For Lite editions, use raspi-config to enable Wi-Fi and connect Wi-Fi via raspi-config or NetworkManager.

2.2.1 Enabling Wi-Fi

Wi-Fi is disabled by default and requires setting a country code to activate.

Steps:

  1. Open the terminal and run the following command, open the Raspberry Pi Software Configuration Tool (raspi-config) windows.
sudo raspi-config
  1. Select "5 Localisation Options", and press Enter.
Localisation Options
  1. Select "L4 WLAN Country", and press Enter.
L4 WLAN Country
  1. Choose your country code (e.g., CN for China), and press Enter.
country_code
  1. In the Wireless LAN country set to CN windows, press Enter.
Wireless LAN country set to CN

2.2.2 Connecting Wi-Fi via raspi-config

Preparation:

  • Wi-Fi is enabled.
  • Know the SSID and password of Wi-Fi.

Steps:

  1. Open the terminal and run the following command, open the Raspberry Pi Software Configuration Tool (raspi-config) windows.
sudo raspi-config
image-20240605105636339
  1. Select "1 System Options", and press Enter, then select "S1 Wireless LAN" in the opened windows.
image-20240605105646571
  1. Press Enter, input the SSID of the target network in the Please enter SSID windows.
image-20240605105656511
  1. Press Enter, input the password of the target network in the Please enter passphrase windows.

TIP

If the Wi-Fi has no password, press Enter directly.

image-20240605105710881
  1. Press Enter to connect to Wi-Fi. Once the Wi-Fi connection is established, select "Finish" and press Enter to complete the setup, returning to the command-line window.

  2. Execute the following command to restart the device and activate the configuration settings.

sudo reboot
  1. Execute the following command to verify whether the Wi-Fi connection is successful.
ifconfig
  • If the returned results include wlan0 with details showing inet: 192.168.XX.XX, the Wi-Fi connection is successful.
  • If the results do not include wlan0, the Wi-Fi connection has failed.
wlan0

2.2.3 Connecting Wi-Fi via NetworkManager

Preparation:

  • Wi-Fi is enabled.
  • Know the SSID and password of Wi-Fi.

Steps:

  1. Execute the following command to scan for available networks.
sudo nmcli device wifi
image-20240605105531840
  1. Execute the following command to connect to the target network.
sudo nmcli device wifi connect SSID password password
  • SSID is the name of target network, password is the password of target network.
  1. Execute the following command to enable auto-connect.
sudo nmcli connection modify SSID connection.autoconnect yes
  • SSID is the name of target network.