Relayd, WiFi Extender: AP does not start unless client is connected?

I have successfully followed these instructions:
https://openwrt.org/docs/guide-user/network/wifi/relay_configuration

All works well.

But I have noticed that if the Client WiFi interface is not connected to another AP, then the AP in the extender/repeater does not run (can not be seen when scanning for networks)

Once the client connects .. then the AP interface starts up and can be seen.

Just wondering if this is expected behaviour? And can it be changed (ie AP runs even if Client is not connected?)

Here is /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11g'
        option path 'pci0000:00/0000:00:00.0'
        option htmode 'HT40'
        option channel 'auto'
        option disabled '0'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option key 'MyAP'
        option ssid 'MyAP'
        option encryption 'psk2'

config wifi-iface 'wifinet1'
        option encryption 'psk-mixed'
        option device 'radio0'
        option mode 'sta'
        option network 'wwan'
        option key 'ChangeMe'
        option ssid 'ChangeMe'

Rob

Expected, can't be changed, but can be cleverly worked around by using Travelmate

1 Like

I have submitted a small patch to override this default behaviour by explicitly setting option start_disabled 0 on the AP interface: https://github.com/openwrt/openwrt/pull/12499

Please test the patch with your configuration and let me know if it works :smiley:

If you read why start_disabled was introduced in the first place, I think this change is not useful or functional
https://patchwork.ozlabs.org/project/hostap/patch/1373546762-20952-1-git-send-email-sujith@msujith.org/

In a AP/STA concurrent setup, if the STA interface is continually
scanning, trying to connect to a network, the AP interface
is basically broken since beaconing would be erratic.

I have tried this on my router, with a beacon interval of 1000 TUs and it is barely noticeable whether the radio is continuously scanning or not. There are no connection drops on devices connected to the AP interface. There are however some infrequent spikes in latency when testing using continuous ping.

Do you know if there's any way to control the scanning frequency on the radio so it scans for its client interface only after every X beacons on the AP?

Also, I don't fully agree with not letting the AP interface start initially, to work around this problem because the behaviour would be similar even if the client interface connects initially and disconnects later (for example if the target AP shuts down or goes out of range) - the radio would again be continuously scanning, but the AP interface won't shut down.
Then what's the point of causing this inconvenience only for the initial start of the radio when a similar situation might occur later on?

I wouldn’t know enough to comment accurately, but it’s exactly why this plug-in exists, to get around such a problem (and a host of other tricks it can do)

To answer my own question:

The scanning interval of wpad can be set using wpa_cli:

wpa_cli -i <wifi-device> scan_interval <time-in-seconds>

This can be added to a script and triggered to run as soon as the WiFi interface is up using the net hotplug.

The default scan interval in wpad is every 1 second as enforced by this patch - 310-rescan_immediately.patch. In my opinion, this is too frequent and unnecessary unless you are using a portable router and would want it to instantly connect.