WF(M)200 Concurrent Mode (SoftAP + Station)
Naming Convention
- SoftAP : WF(M)200 configured in Wi-Fi Software-enabled Access Point mode
- Station : WF(M)200 configured in Wi-Fi Station mode
The 'SoftAP' terminology is used to indicate that the WF(M)200 is not a full-featured Wi-Fi access point. It only supports up to 8 stations simultaneously and has limited capabilities.
Introduction
As demonstrated in the LMAC Quick Start Guide Examples and FMAC Quick Start Guide Examples , the WF(M)200 can support both a SoftAP and a Station interface concurrently.
This mode should be used in applications requiring a temporary access for configuration. A perfect fit for this feature is a Wi-Fi device commissioning process . During this phase, a user wants to connect a Wi-Fi device to his home network. To do so, the SoftAP interface can be used to enter the Wi-Fi access point name, security information and confirm the connection has been successful.
Concurrent Mode Considerations
While using the WF(M)200 concurrent mode, keep in mind the following considerations:
- It is NOT possible to have two interfaces running in the same mode (SoftAP/SoftAP or Station/Station).
- In concurrent SoftAP/Station mode, one interface is always active, thus the WF(M)200 is never in sleep mode.
- If the Station and the SoftAP are on different channels, the WF(M)200 firmware forces the Station to go into power save mode (in Fast-PS).
- Since both interfaces are alternatively active, the total measurable throughput in single Station or SoftAP mode is shared between the interfaces. Therefore one should expect lower maximum throughput in concurrent Station/SoftAP mode, especially if heavy traffic flows on both interfaces. This is especially true when the two interfaces are on different channels.
Concurrent Mode using the Full-MAC Driver
Using the FMAC API, the WF(M)200 can be configured in concurrent mode by calling the two APIs below:
- sl_wfx_start_ap_command() to start the WF(M)200 SoftAP interface.
- sl_wfx_send_join_command() to start the WF(M)200 Station interface (connect the WF(M)200 to an AP).
Concurrent Mode using the Low-MAC Driver
Under Linux this is achieved via 2 logical wlan interfaces:
wlan0
and
wlan1
, sharing a single WF(M)200.
-
The
SoftAP
is controlled via
hostapd
-
The
Station
is controlled by
wpa_supplicant
-
SoftAP
/
Station
can use
wlan0
/wlan1
orwlan1
/wlan0
, respectively - The startup order can be SoftAP / Station or Station / SoftAP
Please see below specifics related to starting
Station
on
wlan1
before starting
SoftAP
on
wlan0
.
It is possible to check
nl80211
support of the AP mode using:
iw list
[...]
Supported interface modes:
* IBSS
* managed
* AP
* AP/VLAN
* monitor
[...]
where
-
managed
is the Station mode -
AP
is the SoftAP mode
Support for concurrent STA/SoftAP is also indicated:
[...]
valid interface combinations:
* #{ managed } <= 1, #{ AP } <= 1,
total <= 2, #channels <= 2
[...]
Configuration Details
-
The
SoftAP
needs to be active most of the time, since it needs to send beacons every
beacon_int
(default 100 Tu = 102 ms), with a DTIM present in the beacon everydtim_interval
(1 DTIM sent everybeacon_int
*dtim_interval
) -
To avoid possible issues due to beacons from the
SoftAP
and from the
AP
being transmitted simultaneously, we
recommend slightly changing the
beacon_int
inhostapd
's.conf
file. A value of107
or113
is ok, since these are prime numbers just higher than100
(considering that the external AP is using100
).
Adding 'wlan1' Interface to 'wlan0'
To get two interfaces at the same time, run:
sudo iw dev wlan0 interface add wlan1 type managed
In case you are starting Station on wlan1 before starting SoftAP on wlan0 , also execute:
sudo ip link set dev wlan0 down
Important Note :
sudo ip link set dev wlan0 down
is only needed when starting the Station on wlan1 before starting the SoftAP on wlan0, to avoid this error:
Failed to connect to non-global ctrl_ifname: wlan1 error: No such file or directory
This happens because we are starting the Station on wlan1 first. It looks like a bug in the network layers, since 'sudo ip link show' indicates that wlan0 is already DOWN.
Example Scripts
Example scripts for all 4 cases are available in GitHub .
These scripts use the following packages to configure the interfaces:
-
iw
-
ip
-
hostapd
-
wpa_supplicant
-
dnsmasq