Wifi SystemdNetworkd

From Variscite Wiki
Revision as of 10:58, 21 October 2024 by Francesco (talk | contribs)
Warning: This page is designed to be used with a 'release' URL parameter.

This page is using the default release mx95-yocto-scarthgap-6.6.23_2.0.0-v1.0.
To view this page for a specific Variscite SoM and software release, please follow these steps:

  1. Visit variwiki.com
  2. Select your SoM
  3. Select the software release
Wireless

DART-MX95 Overview

The DART-MX95 supports the following WiFi modules:

Module Chipset Features Network Interface(s)
Sterling LWB Cypress CYW4343W 802.11 b/g/n wlan0
Sterling LWB5 Cypress CYW43353 802.11 ac/a/b/g/n, wlan0
Murata LBEE5PL2DL NXP IW611 802.11 a/ac/ax/b/g/n wlan0, uap0, wfd0
Murata LBES5PL2EL NXP IW612 802.11 a/ac/ax/b/g/n, 802.15.4 wlan0, uap0, wfd0

This guide demonstrates how to configure WiFi using systemd-networkd. It is important to use the correct network interface for the module assembled on your DART-MX95.

Managing WiFi using systemd-networkd

systemd-networkd is a system daemon that manages network configurations. It detects and configures network devices as they appear.
systemd-networkd's functionality can be useful for both wireless and wired networks.
This guide describes how to use systemd-networkd to configure wireless networks.

Enabling and disabling WiFi

To enable WiFi run

# networkctl up wlan0

To disable WiFi run

# networkctl down wlan0

Configuring WiFi Client

Scanning for available WiFi APs

If WiFi is enabled you can get the list of available APs by running

# iw dev wlan0 scan | grep SSID

Connecting to a protected WiFi network

Create /etc/systemd/network/80-wifi-station.network

# cp /lib/systemd/network/80-wifi-station.network.example /etc/systemd/network/80-wifi-station.network
# echo "" >> /etc/systemd/network/80-wifi-station.network
# echo "[DHCPv4]" >> /etc/systemd/network/80-wifi-station.network
# echo "RouteMetric=9" >> /etc/systemd/network/80-wifi-station.network
# echo "[IPv6AcceptRA]" >> /etc/systemd/network/80-wifi-station.network
# echo "RouteMetric=9" >> /etc/systemd/network/80-wifi-station.network

Create /etc/wpa_supplicant/wpa_supplicant-wlan0.conf

# mkdir -p /etc/wpa_supplicant
# echo "ctrl_interface=/var/run/wpa_supplicant" > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
# echo "eapol_version=1" >> /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
# echo "ap_scan=1" >> /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
# echo "fast_reauth=1" >> /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
# wpa_passphrase <SSID> <password> >> /etc/wpa_supplicant/wpa_supplicant-wlan0.conf

Restart the services

# systemctl restart systemd-networkd.service
# systemctl restart wpa_supplicant@wlan0.service

Wait a few seconds and than make sure wlan0 is up and connected to the AP

# ifconfig wlan0