Please note the new address for this forum : forum.excito.org. The old address redirects here but I don't know for how long. Thanks !
New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

B3 Wireless power control (on/ff)

Got problems with your B2 or B3? Share and get helped!
Post Reply
genyap
Posts: 4
Joined: 08 Mar 2012, 12:41

B3 Wireless power control (on/ff)

Post by genyap »

I've got everything updated and running fine with my B3 Wifi .

Code: Select all

root@b3:/# uname -a
Linux b3 2.6.39.4-9 #1 Wed Jan 18 18:52:34 FET 2012 armv5tel GNU/Linux

But my biggest concern that keeps me from being 100% satisfied is wireless NIC control. It is important for me for power and radio emission issues to be able temporary to switch off wireless radio completely. As everyone knows, built in wireless NIC is Atheros AR9280 which handled by ath9k driver. Usually user changes hardware specific NIC behavior by using iw and/or iwconfig utilities. Here is default WIFI settings:

Code: Select all

root@b3:/# iwconfig wlan0
wlan0     IEEE 802.11abgn  Mode:Master  Frequency:2.462 GHz  Tx-Power=19 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
I've tried to turn radio off in different ways:

Code: Select all

root@b3:/# iw dev wlan0 set power_save off
command failed: Operation not supported (-95)

Code: Select all

root@b3:/# iw phy phy0 set txpower fixed 0
root@b3:/# iwconfig wlan0
wlan0     IEEE 802.11abgn  Mode:Master  Frequency:2.462 GHz  Tx-Power=0 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:on

So, I could able only to switch Tx-Power=0 dBm but it had no result - wireless was still running. I decided to try rfkill program, but it don't run (probably cause of kernel compiled without CONFIG_RFKILL):

Code: Select all

root@b3:/# rfkill block wlan
Can't open RFKILL control device: No such file or directory

Another strange thing is regarding channels NIC supports. Following output shows 14 radio channels to support but I was unable to go above 11:

Code: Select all

root@b3:/# iw list
Wiphy phy0
        Band 1:
                Capabilities: 0x11ce
                        HT20/HT40
                        SM Power Save disabled
                        RX HT40 SGI
                        TX STBC
                        RX STBC 1-stream
                        Max AMSDU length: 3839 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 8 usec (0x06)
                HT TX/RX MCS rate indexes supported: 0-15
                Frequencies:
                        * 2412 MHz [1] (19.0 dBm)
                        * 2417 MHz [2] (19.0 dBm)
                        * 2422 MHz [3] (19.0 dBm)
                        * 2427 MHz [4] (19.0 dBm)
                        * 2432 MHz [5] (19.0 dBm)
                        * 2437 MHz [6] (19.0 dBm)
                        * 2442 MHz [7] (19.0 dBm)
                        * 2447 MHz [8] (19.0 dBm)
                        * 2452 MHz [9] (19.0 dBm)
                        * 2457 MHz [10] (19.0 dBm)
                        * 2462 MHz [11] (19.0 dBm)
                        * 2467 MHz [12] (19.0 dBm) (passive scanning)
                        * 2472 MHz [13] (19.0 dBm) (passive scanning)
                        * 2484 MHz [14] (19.0 dBm) (passive scanning)
                Bitrates (non-HT):
                        * 1.0 Mbps
                        * 2.0 Mbps (short preamble supported)
                        * 5.5 Mbps (short preamble supported)
                        * 11.0 Mbps (short preamble supported)
                        * 6.0 Mbps
                        * 9.0 Mbps
                        * 12.0 Mbps
                        * 18.0 Mbps
                        * 24.0 Mbps
                        * 36.0 Mbps
                        * 48.0 Mbps
                        * 54.0 Mbps
        Band 2:
                Capabilities: 0x11ce
                        HT20/HT40
                        SM Power Save disabled
                        RX HT40 SGI
                        TX STBC
                        RX STBC 1-stream
                        Max AMSDU length: 3839 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 8 usec (0x06)
                HT TX/RX MCS rate indexes supported: 0-15
                Frequencies:
                        * 5180 MHz [36] (17.0 dBm) (passive scanning, no IBSS)
                        * 5200 MHz [40] (17.0 dBm) (passive scanning, no IBSS)
                        * 5220 MHz [44] (17.0 dBm) (passive scanning, no IBSS)
                        * 5240 MHz [48] (17.0 dBm) (passive scanning, no IBSS)
                        * 5260 MHz [52] (17.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5280 MHz [56] (17.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5300 MHz [60] (17.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5320 MHz [64] (17.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5500 MHz [100] (17.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5520 MHz [104] (16.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5540 MHz [108] (16.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5560 MHz [112] (16.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5580 MHz [116] (16.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5600 MHz [120] (16.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5620 MHz [124] (16.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5640 MHz [128] (16.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5660 MHz [132] (16.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5680 MHz [136] (16.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5700 MHz [140] (16.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5745 MHz [149] (16.0 dBm) (passive scanning, no IBSS)
                        * 5765 MHz [153] (16.0 dBm) (passive scanning, no IBSS)
                        * 5785 MHz [157] (16.0 dBm) (passive scanning, no IBSS)
                        * 5805 MHz [161] (16.0 dBm) (passive scanning, no IBSS)
                        * 5825 MHz [165] (16.0 dBm) (passive scanning, no IBSS)
                Bitrates (non-HT):
                        * 6.0 Mbps
                        * 9.0 Mbps
                        * 12.0 Mbps
                        * 18.0 Mbps
                        * 24.0 Mbps
                        * 36.0 Mbps
                        * 48.0 Mbps
                        * 54.0 Mbps
        max # scan SSIDs: 4
        max scan IEs length: 2257 bytes
        Coverage class: 0 (up to 0m)
        Supported Ciphers:
                * WEP40 (00-0f-ac:1)
                * WEP104 (00-0f-ac:5)
                * TKIP (00-0f-ac:2)
                * CCMP (00-0f-ac:4)
                * CMAC (00-0f-ac:6)
        Available Antennas: TX 0 RX 0
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * AP/VLAN
                 * WDS
                 * monitor
                 * P2P-client
                 * P2P-GO
        Supported commands:
                 * new_interface
                 * set_interface
                 * new_key
                 * new_beacon
                 * new_station
                 * set_bss
                 * authenticate
                 * associate
                 * deauthenticate
                 * disassociate
                 * join_ibss
                 * remain_on_channel
                 * set_tx_bitrate_mask
                 * action
                 * frame_wait_cancel
                 * set_wiphy_netns
                 * set_channel
                 * set_wds_peer
                 * connect
                 * disconnect
        Supported TX frame types:
                 * IBSS: 0x0000 0x0010 0x0020 0x0030 0x0040 0x0050 0x0060 0x0070 0x0080 0x0090 0x00a0 0x00b0 0x00c0 0x00d0 0x00e0 0x00f0
                 * managed: 0x0000 0x0010 0x0020 0x0030 0x0040 0x0050 0x0060 0x0070 0x0080 0x0090 0x00a0 0x00b0 0x00c0 0x00d0 0x00e0 0x00f0
                 * AP: 0x0000 0x0010 0x0020 0x0030 0x0040 0x0050 0x0060 0x0070 0x0080 0x0090 0x00a0 0x00b0 0x00c0 0x00d0 0x00e0 0x00f0
                 * AP/VLAN: 0x0000 0x0010 0x0020 0x0030 0x0040 0x0050 0x0060 0x0070 0x0080 0x0090 0x00a0 0x00b0 0x00c0 0x00d0 0x00e0 0x00f0
                 * mesh point: 0x0000 0x0010 0x0020 0x0030 0x0040 0x0050 0x0060 0x0070 0x0080 0x0090 0x00a0 0x00b0 0x00c0 0x00d0 0x00e0 0x00f0
                 * P2P-client: 0x0000 0x0010 0x0020 0x0030 0x0040 0x0050 0x0060 0x0070 0x0080 0x0090 0x00a0 0x00b0 0x00c0 0x00d0 0x00e0 0x00f0
                 * P2P-GO: 0x0000 0x0010 0x0020 0x0030 0x0040 0x0050 0x0060 0x0070 0x0080 0x0090 0x00a0 0x00b0 0x00c0 0x00d0 0x00e0 0x00f0
        Supported RX frame types:
                 * IBSS: 0x00d0
                 * managed: 0x0040 0x00d0
                 * AP: 0x0000 0x0020 0x0040 0x00a0 0x00b0 0x00c0 0x00d0
                 * AP/VLAN: 0x0000 0x0020 0x0040 0x00a0 0x00b0 0x00c0 0x00d0
                 * mesh point: 0x00d0
                 * P2P-client: 0x0040 0x00d0
                 * P2P-GO: 0x0000 0x0020 0x0040 0x00a0 0x00b0 0x00c0 0x00d0
I changed regdomain with

Code: Select all

iw reg set JP
but syslog shows that firmware expects for 0x60 regdomain while still proceeding with change.

Code: Select all

root@b3:/# iw reg get
country JP:
        (2402 - 2472 @ 40), (N/A, 20)
        (2457 - 2482 @ 20), (N/A, 20)
        (2474 - 2494 @ 20), (N/A, 20), NO-OFDM
        (4910 - 4930 @ 10), (N/A, 23)
        (4910 - 4990 @ 40), (N/A, 23)
        (4930 - 4950 @ 10), (N/A, 23)
        (5030 - 5045 @ 10), (N/A, 23)
        (5030 - 5090 @ 40), (N/A, 23)
        (5050 - 5060 @ 10), (N/A, 23)
        (5170 - 5250 @ 40), (N/A, 20)
        (5250 - 5330 @ 40), (N/A, 20), DFS
        (5490 - 5710 @ 40), (N/A, 23), DFS


Seems, driver (or kernel) lacks wireless power management. I'm addressing my questions mainly to Excito software developers for any suggestion on how to solve the issue:
- ath9k drivers update ?
- ASPM ?
- any /sys/ tricks ?
- kernel recompilation ?
johannes
Posts: 1470
Joined: 31 Dec 2006, 07:12
Location: Sweden
Contact:

Re: B3 Wireless power control (on/ff)

Post by johannes »

Hmm, first, a high-level, perhaps stupid, question: What are you trying to achieve here? If you want to turn WiFi off, there is a big button in the UI?
/Johannes (Excito co-founder a long time ago, but now I'm just Johannes)
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: B3 Wireless power control (on/ff)

Post by Ubi »

with his method he can use cron to turn off the radio??? (I guess figuring out where the button of the GUI is wirde to is the easier route than reverse engineering the whole machine, but kudos for phreaking)
johannes
Posts: 1470
Joined: 31 Dec 2006, 07:12
Location: Sweden
Contact:

Re: B3 Wireless power control (on/ff)

Post by johannes »

good point Ubi. Although a simple ifdown probably does the same this is more fun. :)

@Carl, can you give a more intelligent comment here?
/Johannes (Excito co-founder a long time ago, but now I'm just Johannes)
genyap
Posts: 4
Joined: 08 Mar 2012, 12:41

Re: B3 Wireless power control (on/ff)

Post by genyap »

Come on guys, do you realy believe ifdown power downs device ? As I know it just stops driver from servicing the NIC. But I need totally different: I need software way to disconnect device on hardware level. Those of you aware of OpenWRT devices probably heard of same utility wlc for Broadcom based wireless cards (wlc radio off).
Last edited by genyap on 09 Mar 2012, 02:27, edited 1 time in total.
johannes
Posts: 1470
Joined: 31 Dec 2006, 07:12
Location: Sweden
Contact:

Re: B3 Wireless power control (on/ff)

Post by johannes »

I am no wifi expert but I'm quite confident that the radio isn't operating if it doesn't have data to send, hence yes, it would power down (stop transmitting) upon ifdown. Am I wrong? Did you do measurements, or why do you suspect this?
/Johannes (Excito co-founder a long time ago, but now I'm just Johannes)
genyap
Posts: 4
Joined: 08 Mar 2012, 12:41

Re: B3 Wireless power control (on/ff)

Post by genyap »

From power consuming side wireless NIC will still hogs some power. Maybe even, some low level broadcasting (like SSID). Driver has to know how to suspend NIC in order to save power. Same technique is used in laptops.
And just to clarify: I'm unable to do physical measurements.
Weird thing is that even with Tx-Power=0 signal quality does not change. Seems, NIC (or driver) ignores power management.
johannes
Posts: 1470
Joined: 31 Dec 2006, 07:12
Location: Sweden
Contact:

Re: B3 Wireless power control (on/ff)

Post by johannes »

I did not do detailed measurements either, but I know that a B3 with wifi assembled but off doesn't use more power than a B3 without wifi assembled. Hence, if it uses power it is below noise level (maybe a few mA max).

And - if wifi is off, SSID is not broadcasted.

Anyways I agree that your idea is interesting, and I have asked Carl who knows more about the driver to comment on this.
/Johannes (Excito co-founder a long time ago, but now I'm just Johannes)
genyap
Posts: 4
Joined: 08 Mar 2012, 12:41

Re: B3 Wireless power control (on/ff)

Post by genyap »

Any results ? Any suggestions from driver/kernel supporters ? What about reg domain ?

As temporary solution I use ifconfig wlan0 up/down in order to toggle WIFI. But after bringing wlan0 up again my real wireless bitrate drops from 45-50 Mb/s down to 23 Mb/s (maximum of 802.11g). To regain high speed back I have to restart hostapd. That could be solution if hostapd restart did not take about 10 sec (far from real-time like). Any suggestion on this ?

Seems, finally I will have to recompile kernel with custom settings. Would highly appreciate of pointing me to proper kernel sources and some quick tutorial of how to do that on x86 PC to speed up the process.
Post Reply