TP-LINK WR2543ND and 5GHz support

Report wireless and/or network connectivity problems in this forum.

Moderator: Moderators

Post Reply
deepred
Posts: 3
Joined: Mon Jun 24, 2013 3:09 pm

TP-LINK WR2543ND and 5GHz support

Post by deepred »

Hello all,

Since I've upgraded from OpenWRT AA to Gargoyle 1.5.7 I'm unable to configure 5GHz band. Technically if I restore backed up AA configuration 5GHz works just fine, but UI becomes unsuable -- it seems it cannot decide between 2.4 and 5 GHz bands. Gargoyle changelog mentions added support for 5 GHz since 1.5.0 and I can see people posting screenshots with band switch in UI, yet it is missing on my TP-LINK WR2543ND. Is there anything I can do about it except downloading sources, figuring out what went wrong and recompiling? :-) I don't mind get my hands dirty, it's just I don't have neither time at the moment for this nor Linux host. Thanks a lot in advance.

P.S. In AA everything worked fine, I just don't like its UI.

Regards, Stan

BashfulBladder
Moderator
Posts: 250
Joined: Thu Jan 17, 2013 11:43 pm

Re: TP-LINK WR2543ND and 5GHz support

Post by BashfulBladder »

When 5GHz is wonky, open a ssh session - what is the output of

Code: Select all

/sbin/wifi up
If you have a backup of the Openwrt /etc/config/wireless, what are the differences from Gargoyles config file?
deepred wrote:P.S. In AA everything worked fine, I just don't like its UI
There's always the bootstrap theme
TP-Link WDR3600 v1.1 running 1.5.10+ L10n-English (Built 20130922 - OpenWrt r38093)
TP-Link WDR4300 running 1.5.10+ i18n-English (Built 20131010 - OpenWrt r38286)

https://github.com/BashfulBladder/gargoyle-plugins/wiki

deepred
Posts: 3
Joined: Mon Jun 24, 2013 3:09 pm

Re: TP-LINK WR2543ND and 5GHz support

Post by deepred »

Thanks for your response.
BashfulBladder wrote:When 5GHz is wonky, open a ssh session - what is the output of

Code: Select all

/sbin/wifi up
Not sure how it helps, but anyway:

Code: Select all

root@wr2543nd:~# wifi up
Configuration file: /var/run/hostapd-phy0.conf
Using interface wlan0 with hwaddr 12:34:56:78:9a:bc and ssid "ABCDEDF"
BashfulBladder wrote:If you have a backup of the Openwrt /etc/config/wireless, what are the differences from Gargoyles config file?
Not much additional information here, except maybe hwmode and country (necessary for DFS?). With changes (+) I have my 5GHz working but basic UI is totally useless.

Code: Select all

--- wireless.new	Tue Jun 25 19:46:04 2013
+++ wireless.old	Tue Jun 25 19:45:11 2013
@@ -1,15 +1,23 @@
 package wireless
 
 config wifi-device 'radio0'
         option type 'mac80211'
-        option channel '11'
+		option channel '36'
         option macaddr '12:34:56:78:9a:bc'
-        option htmode 'HT20'
+		option htmode 'HT40+'
         list ht_capab 'LDPC'
         list ht_capab 'SHORT-GI-20'
         list ht_capab 'SHORT-GI-40'
         list ht_capab 'TX-STBC'
         list ht_capab 'RX-STBC1'
         list ht_capab 'DSSS_CCK-40'
-        option hwmode '11ng'
+		option hwmode '11na'
+		option txpower '16'
+        option country 'NL'
+
+config 11na 'hwmode'
+
+config HT40+ 'htmode'
+
+config 20 'chanbw'
What I have found so far is that Gargoyle enumerates phys (directly or indirectly) to find out how many bands are supported and sets corresponding flag (dualBandWireless).

Code: Select all

	#test for dual band (taken from usr/lib/gargoyle/cache_basic_vars.sh)
	if [ `uci show wireless | grep wifi-device | wc -l`"" = "2" ] && [ -e "/sys/class/ieee80211/phy1" ] && [ ! `uci get wireless.@wifi-device[0].hwmode`"" = `uci get wireless.@wifi-device[1].hwmode`""  ] ; then
		echo "var dualBandWireless=true;" >> "$out_file"
	else
		echo "var dualBandWireless=false;" >> "$out_file"
	fi
On my WR2543ND I get this:

Code: Select all

root@wr2543nd:~# ls -l /sys/class/ieee80211/
lrwxrwxrwx    1 root     root             0 Jan  1  1970 phy0 -> ../../devices/pci0000:00/0000:00:00.0/ieee80211/phy0
As one can see there is no phy1, though when device boots one can see it is dual band:

Code: Select all

[   12.140000] ath: EEPROM regdomain: 0x0
[   12.140000] ath: EEPROM indicates default country code should be used
[   12.140000] ath: doing EEPROM country->regdmn map search
[   12.140000] ath: country maps to regdmn code: 0x3a
[   12.140000] ath: Country alpha2 being used: US
[   12.140000] ath: Regpair used: 0x3a
[   12.140000] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   12.150000] Registered led device: ath9k-phy0
[   12.150000] Registered led device: tp-link:green:wlan5g
[   12.150000] ieee80211 phy0: Atheros AR9300 Rev:3 mem=0xb0000000, irq=40
[   12.160000] cfg80211: Calling CRDA for country: US
[   12.170000] cfg80211: Regulatory domain changed to country: US
[   12.170000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   12.180000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
[   12.190000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1700 mBm)
[   12.200000] cfg80211:   (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   12.200000] cfg80211:   (5490000 KHz - 5600000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   12.210000] cfg80211:   (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   12.220000] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 3000 mBm)
Of course, in Netherlands it should be like this:

Code: Select all

[116274.180000] cfg80211: Calling CRDA for country: NL
[116274.190000] cfg80211: Regulatory domain changed to country: NL
[116274.190000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[116274.200000] cfg80211:   (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[116274.210000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[116274.220000] cfg80211:   (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[116274.220000] cfg80211:   (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2700 mBm)
Summarizing, my guess is that Gargoyle just doesn't support selectable dual band routers. WR2543ND is not alone; there are some more devices which behave similarly. Thus, any ideas where to start if I want to add such feature? Thank you very much in advance. :-)

P.S.
BashfulBladder wrote:There's always the bootstrap theme
I like Gargoyle (source code) better. ;-)

Regards, Stan

BashfulBladder
Moderator
Posts: 250
Joined: Thu Jan 17, 2013 11:43 pm

Re: TP-LINK WR2543ND and 5GHz support

Post by BashfulBladder »

>Not sure how (/sbin/wifi up) helps
Because if you had 2 radios, there would be 2 wireless interfaces that came up - as my TP-Link WDR4300 does.

You probably can't use Operation Mode
N+G+B (for 2.4GHz mode)
N+A (for 5GHz mode)
because the shell variables are wrecking havoc with basic.js.

On a lark, you might want to see if the underlying OpenWrt OS can regenerate a better working /etc/config/wireless:

Code: Select all

mv /etc/config/wireless /tmp/wireless.config
/sbin/wifi detect > /etc/config/wireless
from here: http://wiki.openwrt.org/doc/uci/wireless

Does 'iw list' see 2 phy devices? You might be able to set radio0 for 2.4GHz & manually create a 5GHz radio1 & see if basic.sh calms down enough for you to manually switch band/modes as above.

>In AA everything worked fine
I don't see how if your /etc/config/wireless diff only shows 1 radio.
TP-Link WDR3600 v1.1 running 1.5.10+ L10n-English (Built 20130922 - OpenWrt r38093)
TP-Link WDR4300 running 1.5.10+ i18n-English (Built 20131010 - OpenWrt r38286)

https://github.com/BashfulBladder/gargoyle-plugins/wiki

deepred
Posts: 3
Joined: Mon Jun 24, 2013 3:09 pm

Re: TP-LINK WR2543ND and 5GHz support

Post by deepred »

BashfulBladder wrote:You probably can't use Operation Mode
N+G+B (for 2.4GHz mode)
N+A (for 5GHz mode)
because the shell variables are wrecking havoc with basic.js.
Quickly looking at the source code, mostly the cause.
BashfulBladder wrote:On a lark, you might want to see if the underlying OpenWrt OS can regenerate a better working /etc/config/wireless:

Code: Select all

mv /etc/config/wireless /tmp/wireless.config
/sbin/wifi detect > /etc/config/wireless
from here: http://wiki.openwrt.org/doc/uci/wireless

Does 'iw list' see 2 phy devices? You might be able to set radio0 for 2.4GHz & manually create a 5GHz radio1 & see if basic.sh calms down enough for you to manually switch band/modes as above.
I'm out of the town till the weekend, so hopefully I can try it when I'm back.
BashfulBladder wrote:>In AA everything worked fine
I don't see how if your /etc/config/wireless diff only shows 1 radio.
No idea, my wild guess is because channel was set to 36. Both laptops I have report switching to 802.11a when radio is configured as above.

Regards, Stan

Post Reply