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.
Configure the driver mode
To customize the default driver interfaces, edit the file /etc/udev/scripts/load_iw612.sh and specify the driver mode.
#!/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
The DRIVER_MODE value is a bit field.
For instance:
-
To configure Station only (STA):
DRIVER_MODE=1(b'001) -
To configure Access point only (AP):
DRIVER_MODE=2(b'010) -
To configure Wi-Fi direct only:
DRIVER_MODE=4(b'100) -
To configure Station + Access point + P2P:,
DRIVER_MODE=7(b'111)
Save the file 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:
|
Enable Access Point mode
Manually enable uap0
The uap0 interface is disabled by default to improve the performance of the wlan0 interface in client infrastructure mode.
You can bring it up manually with the following command:
# ifup uap0
Enable automatic bring-up
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 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:
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
802.11a/n/ac WPA2-PSK authentication with CCMP/AES encryption
This is the default configuration used by Digi Embedded Yocto.
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
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
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
Automatic Channel Selection (ACS)
ACS (Automatic Channel Selection) automatically selects the best Wi-Fi channel for an Access Point based on the detected RF environment.
On ConnectCore 93 Development Kit, Automatic Channel Selection (ACS) in Access Point (AP) mode is handled directly by hostapd.
Automatic Channel Selection (ACS) using hostapd
The WLAN driver and firmware expose the required capabilities to userspace, allowing hostapd to perform the channel scan and automatically select the most appropriate operating channel.
Enable ACS
To enable ACS, set channel=0 in ./etc/hostapd_{br-wifi-interface}.conf configuration file:
# Enable Automatic Channel Selection
channel=0
When channel=0 is configured, hostapd performs an initial scan at startup and automatically selects the operating channel based on the scan results.
After updating the hostapd configuration file, restart the Access Point service to apply the changes.
systemctl restart hostapd@{br-wifi-interface}.service