Raspberry Pi Webcam Sleep Mode

Octopi is awesome. It allows me to manage both of my 3D printers without having a dedicated PC. The problam that I was having is that the WiFi adapter kept on falling asleep - as Power Management was On.

After a bit of trial and error and after being thrown off of the scent by bogus solutions I managed to find a very easy solution.

All you have to do is edit the /etc/rc.local file using a text editor such as nano (sudo nano /etc/rc.local).

Note: The rc.local file is just one way that you can help these commands run on startup. Dexter Industries have a good article called Five Ways To Run a Program On Your Raspberry Pi At Startup on this topic.

The entries can go before the last line (exit 0).

Go to the bottom of the file and before 'exit 0' type:

/sbin/iw wlan0 set power_save off
/sbin/iw wlan1 set power_save off

Press CTRL-O to save the file

Press CTRL-X to exit the file

Restart the Raspberry Pi and you are done