Skip to main content
Version: scarthgap_2-x

Configuring Wi-Fi Connectivity

Overview

This guide explains how to configure and connect a Wi-Fi network on a device running Clea OS.
The procedure uses wpa_supplicant, a standard Linux utility for managing wireless network authentication and encryption.

Once configured, the device can connect automatically to the selected Wi-Fi network at startup or on demand.


Requirements

Before starting, ensure that:

  • The device has a supported Wi-Fi interface (for example, wlan0).
  • The wireless driver is loaded and visible through ip link show.
  • You have the SSID and password of the target Wi-Fi network.
note

All commands in this guide are executed on the target device shell, represented by the # prompt.
Do not copy and paste the # to execute commmands.


1. Generate the Configuration File

Create a WPA configuration file using the wpa_passphrase command.
Replace MySSID and MyPassword with your actual Wi-Fi credentials:

# wpa_passphrase MySSID MyPassword > /etc/wpa_supplicant.conf

This command generates a valid configuration file at /etc/wpa_supplicant.conf, including the SSID, password, and corresponding encrypted key.

You can verify the content with:

# cat /etc/wpa_supplicant.conf
info

Do not share or expose the wpa_supplicant.conf file, as it contains sensitive credentials.


2. Start the Wi-Fi Connection

Use the following command to start the Wi-Fi connection in the background:

# wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
  • The option -B runs the process in the background.
  • The option -i specifies the network interface (typically wlan0).
  • The option -c points to the configuration file created earlier.

To verify that wpa_supplicant is running, execute:

# ps | grep wpa_supplicant

If the command returns a process ID, the service is active.


3. Request an IP Address

Once wpa_supplicant has associated with the access point, request an IP address using the DHCP client udhcpc:

# udhcpc -i wlan0

If the connection is successful, you should see messages indicating that an IP address has been assigned.


4. Verify the Connection

Check that the wireless interface has received an IP address:

# ifconfig wlan0

or equivalently:

# ip addr show wlan0

Test the network connection by pinging an external host:

# ping -c 4 8.8.8.8

If replies are received, the Wi-Fi connection is active.


Troubleshooting

If the connection fails, review the following checks.

Check Wi-Fi Interface Availability

Ensure that the interface exists and is not blocked:

# ip link show wlan0

If the interface is missing, verify that your Wi-Fi driver is correctly loaded.

Inspect Logs

Check for errors or authentication issues using journalctl:

# journalctl -u wpa_supplicant

You can also view live logs while reconnecting:

# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -d

Restart the Connection

If the interface was previously connected, try restarting the service:

# pkill wpa_supplicant
# wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf

Then request a new IP address again:

# udhcpc -i wlan0

Tips for Persistent Configuration

tip

To make the Wi-Fi connection persistent across reboots:

  1. Store the wpa_supplicant.conf file permanently under /etc/.
  2. Add the wpa_supplicant and udhcpc commands to a startup script (for example, /etc/rc.local) or create a dedicated systemd service.
  3. Ensure that the network interface is not managed by another network manager that could override the connection.

Summary

You have successfully configured a Wi-Fi connection using wpa_supplicant on a Clea OS device.
The basic workflow includes generating a secure configuration file, starting the connection, obtaining an IP address, and verifying connectivity.
Once verified, the configuration can be automated or managed through scripts for production systems.

By following these steps, Clea OS devices can connect reliably to wireless networks and maintain connectivity across power cycles or reboots.