OpenWRT fails to bring local WLAN up if WLAN to be redistributed fails/is not available

4

I am trying to setup my TP-Link TL-MR3020 running OpenWRT to to redistribute a wireless network, e.g. for when traveling and being in a hotel.

So far, my setup works pretty well - if the wireless network is actually available and ready to be connected to. If it is not, or I have e.g. a typo in the SSID or WPA key somewhere, OpenWRT not only fails to bring the network to be redistributed up, but also does not get the 'local' WLAN up. This is not so bad if I have a laptop with an Ethernet jack available - but would be pretty horrible if I'm traveling with only an iPad at my disposal.

My relevant (AFAIK) configuration files are as follows:

/etc/config/network

config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config interface 'lan'
    option ifname 'eth0'
    option type 'bridge'
    option proto 'static'
    option ipaddr '192.168.1.1'
    option netmask '255.255.255.0'

config interface 'wan'
    option proto 'dhcp'
    option 'ifname' 'wlan0-1'

/etc/config/wireless

config wifi-device 'radio0'
    option type 'mac80211'
    option macaddr '64:70:02:6a:03:ae'
    option hwmode '11ng'
    option htmode 'HT20'
    list ht_capab 'SHORT-GI-20'
    list ht_capab 'SHORT-GI-40'
    list ht_capab 'RX-STBC1'
    list ht_capab 'DSSS_CCK-40'
    option country 'DE'
    option channel '13'
    option txpower '20'

config wifi-iface
    option network 'lan'
    option ssid 'tlmr3020'
    option device 'radio0'
    option mode 'ap'
    option encryption 'psk2'
    option key '....'
    option disabled '0'
    option wmm '1'

config wifi-iface
    option network 'wan'
    option ssid '....'
    option encryption 'psk2'
    option device 'radio0'
    option mode 'sta'
    option key '....'
    option disabled '0'
    option wmm '1'

A wifi up while having a typo in the SSID to be redistributed gets me the following output:

command failed: Device or resource busy (-16)
Configuration file: /var/run/hostapd-phy0.conf
Using interface wlan0 with hwaddr 64:70:02:6a:03:ae and ssid "tlmr3020"
Successfully initialized wpa_supplicant

No really obvious error message here, the command failed always comes up (even on successful connects), doesn't seem to have any impact whatsoever.

logread seems to indicate that netifd tries to get some IP via DHCP for the wan interface, which of course will now fail. It never seems to timeout/do something else, though.

Jan 15 12:14:54 tlmr3020 daemon.notice netifd: wan (13582): udhcpc (v1.19.4) started
Jan 15 12:14:54 tlmr3020 daemon.notice netifd: wan (13582): Sending discover...
Jan 15 12:14:57 tlmr3020 daemon.notice netifd: wan (13582): Sending discover...
Jan 15 12:15:00 tlmr3020 daemon.notice netifd: wan (13582): Sending discover...

This way, the tlmr3020 wireless network never comes up, removing my ability to connect to the MR3020 over-the-air - pretty inconvenient to say the least.

Anyone got an idea what to do here to let the 'host' wlan connection fail gracefully, not impacting the 'local' network? I searched for and tried pretty much everything I could think of, getting nowhere.

Thanks!

azmo

Posted 2013-01-15T11:24:41.570

Reputation: 71

Answers

3

Since asking the question I was able to workaround the issue thanks to information found in the openwrt forums.

As this ticket states

If wpa_supplicant looses the connection it will go into an active scan cycle which renders the wiphy unusable for ap mode operation, therefore the ap is taken down if the sta looses its association. That is nothing that can be fixed easily and there are no current plans to solve this.

To make the router work for me I had to implement a solution suggested by forum member warchild - one that works very well for me. It uses the WPS button to disable the failing client network. If that network is brought down, the scan cycle is broken and the ap works as expected; one can connect to the WLAN, fix the issues (like a new SSID to connect to/changed password) and bring the network to be redistributed back up.
The script as well as pointers to the button configuration can be found in this post (with additional information further up in the thread).

azmo

Posted 2013-01-15T11:24:41.570

Reputation: 71

0

As far as I see, the TL-MR3020 running with openwrt does not support to use channel 13. I had the same problem. Channel 11 seems to run ok.

Helios

Posted 2013-01-15T11:24:41.570

Reputation: 1

Actually, that wasn't the problem in this case. Thanks to this patch I was able to open up channels 12 and 13 for use - which is perfectly okay since I live in Germany and they are allowed here. Thanks to some openwrt forum members I was able to workaround the issue. I'll answer my question later on.

– azmo – 2013-02-13T14:25:11.650