Skip to content

1.9 How to connect Wi-Fi

Prerequisites:

  • Smart Pi One: Ensure your Smart Pi One is powered on and has a Wi-Fi module or dongle connected.
  • NetworkManager and nmcli: These should be installed by default on most Linux distributions for Smart Pi One. If not, install them using your package manager.

Steps:

1. Open a Terminal: Access the terminal on your Smart Pi One. You can do this directly if you have a monitor and keyboard connected, or via SSH if your Smart Pi One is already on the network.

2. Check if NetworkManager is Running: Ensure that NetworkManager is running. Start it if necessary:

sudo systemctl start NetworkManager
sudo systemctl enable NetworkManager

3. Check Wi-Fi Device Status: List all network devices to find your Wi-Fi device:

nmcli device status
Look for your Wi-Fi device, which should be listed as wifi type (e.g., wlan0).

4. Turn On the Wi-Fi Device: If your Wi-Fi is off, turn it on using:

nmcli radio wifi on

5. List Available Wi-Fi Networks: Scan for available Wi-Fi networks:

nmcli device wifi list
This command lists all visible Wi-Fi networks. If this command runs indefinitely, for stop it by pressing Ctrl + C.

6. Connect to a Wi-Fi Network: Use the following command to connect to your desired Wi-Fi network. Replace YOUR_SSID with the network name and YOUR_PASSWORD with the Wi-Fi password:

nmcli device wifi connect YOUR_SSID password YOUR_PASSWORD

7. Verify the Connection: Ensure your Smart Pi One is connected to the Wi-Fi network:

nmcli connection show --active
for stop it by pressing Ctrl + C.

Identify the Wi-Fi IP Address:

The output of the hostname -I command might include multiple IP addresses if you have more than one network interface (e.g., Ethernet, Wi-Fi, VPNs, Docker interfaces). You will need to identify which one is the IP address of your Wi-Fi connection.

$ hostname -I
192.168.1.2 172.17.0.1