Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Problem: Rpi4 wifi going to sleep mode
#1
Question 
Hello,

It seams that the integrated Wifi interface of the Rpi4 is going to sleep mode by default after some hours (at least with MoOde 7), so the interface become inaccessible anymore using wifi connection:


Code:
iw wlan0 get power_save
Power save: on

So to disable permanently add the following line to /etc/rc.local ahead of the line 'exit 0' (I'm not sure if it is the best way to do it)
Code:
/sbin/iwconfig wlan0 power off

Maybe this can be added as an option for next version?
Reply
#2
I've got an Rpi4 on moode 7 in a wireless config that's been running for weeks and I've never noticed the LAN turning off even after 24 hours of inactivity. Is this only when you are using the Access Point?
----------------
Robert
Reply
#3
(12-30-2020, 03:31 PM)Origin8 Wrote: Hello,

It seams that the integrated Wifi interface of the Rpi4 is going to sleep mode by default after some hours (at least with MoOde 7), so the interface become inaccessible anymore using wifi connection:


Code:
iw wlan0 get power_save
Power save: on

So to disable permanently add the following line to /etc/rc.local ahead of the line 'exit 0' (I'm not sure if it is the best way to do it)
Code:
/sbin/iwconfig wlan0 power off

Maybe this can be added as an option for next version?


Interesting. My first reaction was, "nah, powersave was disabled a while back in the WiFi driver" but you're right, for whatever reason it's been enabled again. (This is an OS setting by the way and isn't RPi-model specific.) As a second check, I looked at the startup messages (dmesg or journalctl) for moOde 7.0.1 players on both a RPi4B and a RPi3A+ and found entries like


Code:
Dec 28 20:11:15 moodelr kernel: brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled


I'm curious. Have you had communication with your moOde player disrupted by the WiFi interface going into powersave mode? I've been running various beta and gold releases of moOde 7.0.0/1 running for days and weeks without noticing anything of the kind.

Regards,
Kent
Reply
#4
I'm using wifi only connexion (not wifi dongle but the integrated one), to be more precise it is the B version of the Rpi 4. After some hours (I can't tell exactly how many, but more than 24 I would say), the web interface become not accessible so I should use Ethernet connexion to have again access to the interface. I'm not using Rpi as access point but only connected to my home wifi network.
Reply
#5
And to be clear, turning off power management solved your issue?

Looking at the github repo for Raspberry Pi OS I see that the brcmfmac.c module (which drives the Broadcom WiFi chip) has had a patch to disable power management applied and removed a number of times in the past year or so. They can't seem to make up their minds.

What I couldn't find was a good explanation of how WiFi power management works---what triggers it and why---or of how it interferes with proper operation of the RPi3B (which is why the patch was introduced in the first place).

It occurs to me that going into sleep mode may depend on external factors such as the make/model of access point being used, whether static IP or DHCP is being used, etc. Not an easy problem to characterize.

Turning power management off seems to do no harm other that costing 55ma or so on an RPi4B when the interface is idle, and it used to be turned off by default. I guess I'd just leave it off.

Regards,
Kent
Reply
#6
Looks like something may have changed in RaspiOS or the kernel cos power save used to be automatically set to disabled during boot.

I'll add "/sbin/iwconfig wlan0 power off" to startup but better to have it run from worker.php which can log the event Also any command in rc.local that generates an error usually causes rc.local to bomb.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#7
I've also been experiencing the RPi4 going to sleep since upgrading recently. A search for a cure led me to this thread.
Reply
#8
(12-30-2020, 10:09 PM)TheOldPresbyope Wrote: And to be clear, turning off power management solved your issue?

So far, yes...  (2 days on)
Reply
#9
I'm using Pi 4 Model B, and when I query power_save, as per first post in this thread, the response is Power save: on.

I think that a default of OFF would be better, with an option to set ON.

I noticed this when trying to access the Pi after a couple of days without using it - can't be sure of exactly how long.

Regards,
Geoff
Reply
#10
It's defaulted to off in upcoming 7.1.0.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: