Digi Embedded Yocto uses the hostapd package to manage the software access point (SoftAP) mode. When configured in this mode, client stations can connect to the device to communicate with other stations on the same Basic Service Set (BSS). The default configuration includes SoftAP mode by adding a uap0 entry in /etc/network/interfaces. The hostapd daemon is started when the interface is brought up and stopped when it is brought down.

The uap0 interface is disabled by default to improve the performance of the wlan0 interface in client infrastructure mode.

To customize the default driver interfaces, edit the file /etc/udev/scripts/load_iw612.sh and specify the driver mode.

# head -n 8 /etc/udev/scripts/load_iw612.sh
#!/bin/sh

# The bit settings of drv_mode are:
#    Bit 0 :  STA
#    Bit 1 :  uAP
#    Bit 2 :  WIFIDIRECT
# eg, for STA + uAP + WIFIDIRECT, set 7 (b'111)
DRIVER_MODE=1  # Only STA

To configure STA + AP + P2P mode, set DRIVER_MODE to 7 (b'111) and reboot your device.

The MAC addresses assigned to the additional interfaces are composed by swapping some bytes of the main MAC address. If you require unique MAC addresses for additional interfaces, you can set them with a standard Linux command:

ifconfig wfd0 hw ether aa:bb:cc:dd:ee:ff

You can bring it up manually with the following command:

# ifup uap0

You can also enable automatic bring-up by uncommenting the "auto uap0" line in /etc/network/interfaces.

Digi Embedded Yocto provides a mechanism to support a different configuration file per Wi-Fi interface, allowing you to run multiple hostapd instances at the same time.

The hostapd@.service systemd service automatically selects the appropriate configuration file /etc/hostapd_X.conf (where X is the interface that is passed to the service) for each interface.

The hostapd package provides a default configuration file /etc/hostapd.conf as a reference for the different available settings. This file is not used by Digi Embedded Yocto init scripts.

See http://w1.fi/cgit/hostap/tree/hostapd/hostapd.conf for a reference of all hostapd configuration options.

For example, a static uap0 configuration entry configured in SoftAP mode would be:

/etc/network/interfaces
auto uap0
iface uap0 inet static
        address 192.168.46.30
        netmask 255.255.255.0
        post-up systemctl start hostapd@uap0.service
        pre-down systemctl stop hostapd@uap0.service

This configures uap0 to run the hostapd@uap0.service systemd service. This service launches the hostapd daemon using the configuration file /etc/hostapd_uap0.conf. SoftAP configuration examples are described below.

802.11a/n/ac WPA2-PSK authentication with CCMP/AES encryption

This is the default configuration used by Digi Embedded Yocto.

/etc/hostapd_uap0.conf
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
interface=uap0
driver=nl80211

# WPA2-AES encryption
ssid=ap-uap0-wpa2aes-a
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
wpa_passphrase=password-wpa2aes

# IEEE 802.11ac channel 36
hw_mode=a
channel=36
ieee80211ac=1
ieee80211n=1

802.11ax mixed WPA2-AES/WPA3-SAE authentication

/etc/hostapd_uap0.conf
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
interface=uap0
driver=nl80211

# SSID to identify the network
ssid=ap-uap0-9983

# 802.11a (5 GHz) mode
hw_mode=a

# Specify the channel to use. If 0 (ACS), channel will be automatically selected
channel=44

# IEEE 802.11i, mixed WPA2-AES/WPA3-SAE encryption
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK SAE
wpa_pairwise=CCMP
wpa_passphrase=password-wpa2aes
sae_password=password-wpa3sae

# IEEE 802.11n (Wi-Fi 4) features
ieee80211n=1
ht_capab=[HT20][HT40+][HT40-][SHORT-GI-20][SHORT-GI-40]

# IEEE 802.11ac (Wi-Fi 5) features
ieee80211ac=1
vht_oper_chwidth=0
vht_capab=[SHORT-GI-80]

# IEEE 802.11ax (Wi-Fi 6) features
ieee80211ax=1
he_su_beamformer=1
he_su_beamformee=1

802.11ax only WPA3-SAE authentication

/etc/hostapd_uap0.conf
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
interface=uap0
driver=nl80211

# SSID to identify the network
ssid=ap-uap0-9983

# 802.11a (5 GHz) mode
hw_mode=a

# Set the channel to use. If 0 (ACS), channel will be automatically selected
channel=44

# IEEE 802.11i, only WPA3 encryption with SAE authentication
ieee80211w=2
rsn_pairwise=CCMP
wpa_key_mgmt=SAE
wpa_passphrase=password-wpa3only

# IEEE 802.11n (Wi-Fi 4) features
ieee80211n=1
ht_capab=[HT20][HT40+][HT40-][SHORT-GI-20][SHORT-GI-40]

# IEEE 802.11ac (Wi-Fi 5) features
ieee80211ac=1
vht_oper_chwidth=0
vht_capab=[SHORT-GI-80]

# IEEE 802.11ax (Wi-Fi 6) features
ieee80211ax=1
he_su_beamformer=1
he_su_beamformee=1