OpenWrt Forum Archive

Topic: AA atheros repeater (simultaneous ap+sta) workaround

The content of this topic has been archived on 2 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Playing around with legacy hardware recently (FON 2100), I again stumbled upon quite a persistent malfunction [1]; AA atheros all the way through to git r42647 is affected. It isn't fixed by [2] either, although that's backported to AA branch. As AA really is the last resort for this particular hardware (and potentially others with only 16 MB of mem), I'd like to share a workaround with the community.

Bare with me please, the malfunction isn't exactly easy to put into written language ..

First, some background: VAPs with the same underlying physical radio device obviously cannot operate on distinct frequencies. Now, the sta VAP in OpenWrt does follow the host AP channel, it does NOT care the channel configuration in /etc/config/wireless (correctly so). The ap VAP, though, it does NOT follow the sta channel in AA branch.

Now, considering this background information:

1) If you happen to define the (correct) channel of the host AP in /etc/config/wireless, the repeater works; the sta VAP follows the host AP channel, the ap VAP reads its channel out the uci subsystem (or /etc/config/wireless for that matter), the channels match in this case, the repeater works. BUT ..

2) If the channel configuration in /etc/config/wireless does NOT match the host AP channel, the sta VAP works (as it follows the host AP), but the ap VAP does NOT as it tries to operate on distinct frequency (read out the uci subsystem). Problem is: Nowadays, host APs, more often than not, do switch channels dynamically; among other usage scenarios (e.g. autoap).

To make a longer story short, the situation in AA isn't exactly practical. Here is a workaround:

b=`uci get`
while ( true ); do
    if ( iw dev $iface link | grep -iq ssid ); then
        a=`iw dev $iface info | awk '/chan/ {print $2}'`
        if [ "$a" != "$b" ]; then
            uci set$a
    sleep 5

scp this script to /bin and chmod +x it. Then, execute it via /etc/rc.local. First line, you need to adjust the "iface" variable to represent the sta VAP interface, in my case wlan0-1. It initializes the channel out the uci subsystem. Then it checks the actual sta VAP channel every 5 seconds and let the ap VAP follow that very frequency. As a result, you have a working repeater (that can deal with host APs that switches channels dynamically). I hope it is useful to you.


Dear Orange, please write to me a message.
I need your modified script if you still have.
Thank You!

If there's a STA interface involved, leave the 'option channel' line out of the radio block entirely-- do not try to set a channel.  The driver will search all the channels until the STA is acquired.  Then the AP will come up on the same channel.

The discussion might have continued from here.