Skip to content

Wireless LAN

Test

Scan for wireless networks:

ifconfig wlan0 up
iw dev wlan0 scan | grep SSID

For persistent station-mode configuration on Debian Bookworm, see WiFi using systemd-networkd.

Manual WPA Connection

Find your network from the scan command, then create a wpa_supplicant configuration:

mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.org
wpa_passphrase <YourAP> <YourPassword> > /etc/wpa_supplicant.conf
wpa_supplicant -B -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf

Check the link:

iw dev wlan0 link

If required, disable wired interfaces before requesting an address on WiFi:

ifconfig eth0 down
ifconfig eth1 down
udhcpc -iwlan0
ifconfig wlan0

Check link speed with iperf3:

iperf3 -s

On the other side of the link:

iperf3 -c <IP_ADDRESS_OF_IPERF_SERVER>

Access Point

This example configures the board as an access point and forwards packets from wlan0 to eth0.

Create /etc/udhcpd.conf:

start           192.168.5.20
end             192.168.5.25
interface       wlan0
opt             dns     8.8.8.8 8.8.4.4
option          subnet  255.255.255.0
opt             router  192.168.5.1
option          lease   864000

Create /etc/hostapd.conf:

ssid=VARI_AP
wpa=2
rsn_pairwise=CCMP
wpa_passphrase=12345678
wpa_key_mgmt=WPA-PSK
ieee80211n=1

Ensure that other WiFi services are not holding the device:

killall wpa_supplicant
killall hostapd

Enable IP forwarding and start the access point:

echo 1 > /proc/sys/net/ipv4/ip_forward
ifconfig wlan0 192.168.5.1
hostapd -B /etc/hostapd.conf -P /var/run/hostapd.pid
udhcpd /etc/udhcpd.conf
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Configuring WiFi Regulatory Domain

According to the SOM mounting option, the kernel loads dedicated firmware files from /lib/firmware/brcm.

Mounting option WiFi chip Firmware files
WB Sterling LWB brcmfmac43430-sdio.bin / brcmfmac43430-sdio.txt
WBD Sterling LWB5 brcmfmac4339-sdio.bin / brcmfmac4339-sdio.txt

Each text file contains the ccode parameter selecting the regulatory domain. For Sterling LWB5 only, the regrev parameter must also be changed according to the ccode. It is always zero for Sterling LWB.

By default, the BSP ships firmware configurations matching the FCC regulatory domain, one of the most restrictive in terms of available channels.

For Sterling LWB5 and FCC:

ccode=US
regrev=911

The following table reports the valid options for ccode and regrev.

Regulatory authority Sterling LWB Sterling LWB5
ccode regrev ccode regrev
FCC US 0 US 911
ETSI EU 0 EU 116
ISED US* 0 CA 938
MIC JP 0 JP 101

ISED for Sterling LWB is managed using ccode=US; this is expected.