Akiiino
Posts: 7
Joined: Sun Feb 02, 2014 8:03 am

Wireless power management won't turn off

Mon Jan 05, 2015 10:52 pm

Basically, the problem is simple – I want to turn off power management – iwconfig doesn't let me do it:

Code: Select all

[email protected] ~ $ sudo iwconfig wlan0 power off
Error for wireless request "Set Power Management" (8B2C) :
    SET failed on device wlan0 ; Invalid argument.
I've configured access point on my pi using hostapd, but it doesn't seem to work correctly because of power management. Is there any way to turn it off?

User avatar
DougieLawson
Posts: 35364
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Wireless power management won't turn off

Mon Jan 05, 2015 11:01 pm

What dongle are you using? What does the lsusb command (that's ell ess you ess bee) tell us?
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Akiiino
Posts: 7
Joined: Sun Feb 02, 2014 8:03 am

Re: Wireless power management won't turn off

Mon Jan 05, 2015 11:04 pm

My wi-fi adapter is TP-LINK TL-WN7200ND
lsusb output:

Code: Select all

Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 1a40:0201 Terminus Technology Inc. FE 2.1 7-port Hub
Bus 001 Device 005: ID 148f:3070 Ralink Technology, Corp. RT2870/RT3070 Wireless Adapter

User avatar
DougieLawson
Posts: 35364
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Wireless power management won't turn off

Mon Jan 05, 2015 11:15 pm

In that case you're going to need to read the source code for the device driver to see if there's any way to support power management.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Akiiino
Posts: 7
Joined: Sun Feb 02, 2014 8:03 am

Re: Wireless power management won't turn off

Mon Jan 05, 2015 11:20 pm

This is just ridiculous. Is there any other way to prevent wi-fi connection from suddenly stopping working? (BTW, if I disconnect from AP and connect again it gets back to normal). Because I've googled for quite some time and all that I found was a solution that consisted of turning off power management. Maybe some script that will constantly use wi-fi and not allow it to sleep?

User avatar
DougieLawson
Posts: 35364
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Wireless power management won't turn off

Mon Jan 05, 2015 11:33 pm

You could try
git clone http://git.kernel.org/pub/scm/linux/ker ... rmware.git
cd linux-firmware
cp -a rt*.bin /lib/firmware
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Akiiino
Posts: 7
Joined: Sun Feb 02, 2014 8:03 am

Re: Wireless power management won't turn off

Mon Jan 05, 2015 11:45 pm

Nope, didn't work. iwconfig shows that power management is still on and I still get the same error when I try to turn it off

diederik
Posts: 389
Joined: Wed Mar 26, 2014 11:17 pm

Re: Wireless power management won't turn off

Tue Jan 06, 2015 1:00 am

What driver are you using?

Akiiino
Posts: 7
Joined: Sun Feb 02, 2014 8:03 am

Re: Wireless power management won't turn off

Tue Jan 06, 2015 7:45 am

The default one (the one that comes with the latest Raspbian) – rt2800usb, I think, or something like that

diederik
Posts: 389
Joined: Wed Mar 26, 2014 11:17 pm

Re: Wireless power management won't turn off

Tue Jan 06, 2015 12:41 pm

Akiiino wrote:The default one (the one that comes with the latest Raspbian) – rt2800usb, I think, or something like that
The lsmod command shows you the kernel modules loaded, including the one for your wireless device.
The reason I asked is because there seem to be 2 different drivers available for your device: https://wikidevi.com/wiki/TP-LINK_TL-WN7200ND
The rt2870sta driver should probably be managed through the iw command, which is the 'new' way to manage wireless devices. But it looks like it is not the case in your situation.

jamiesk
Posts: 95
Joined: Mon Nov 26, 2012 8:48 pm
Location: Ipswich, Suffolk, England, UK.

Re: Wireless power management won't turn off

Tue Jan 06, 2015 10:20 pm

You could write a little script to ping your default gateway every 5 minutes. I have one which reboots the pi.. here are the bits out of it.

# Check the network
ping -c 2 192.168.0.254 > /dev/null 2>&1
if [ $? -ne 0 ] ; then
echo "Network down: restarting" | logger -t root -p local5.info
/sbin/reboot
/sbin/init 6
fi
Pi1 (Nov 2012 loft)= 1KW immersion controller for Solar panel
Pi2 (Jan 2013 living room)=Play thing
Pi3 (Feb 2013 mobile)= Play thing with Tandy Ladder board,breakout board,Nokia display
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=26&t=28193

Akiiino
Posts: 7
Joined: Sun Feb 02, 2014 8:03 am

Re: Wireless power management won't turn off

Wed Jan 07, 2015 12:04 am

The automatic pinging thing would be great if I used the adapter to connect to network, but my Pi works as an access point – gets internet via a cable and transmits it wirelessly. Thanks for the idea, though, it may be the way to the solution (although, not very obvious)

jamiesk
Posts: 95
Joined: Mon Nov 26, 2012 8:48 pm
Location: Ipswich, Suffolk, England, UK.

Re: Wireless power management won't turn off

Wed Jan 07, 2015 6:20 pm

Akiiino wrote:The automatic pinging thing would be great if I used the adapter to connect to network, but my Pi works as an access point – gets internet via a cable and transmits it wirelessly. Thanks for the idea, though, it may be the way to the solution (although, not very obvious)
You could try pinging your own IP on the wireless side. Depends how intelligent Rasbian is, depends on how far the ICMP packets get through the IP stack.
Pi1 (Nov 2012 loft)= 1KW immersion controller for Solar panel
Pi2 (Jan 2013 living room)=Play thing
Pi3 (Feb 2013 mobile)= Play thing with Tandy Ladder board,breakout board,Nokia display
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=26&t=28193

Return to “Raspbian”