<<< Rasberry Pi Guides >>>
Disable Sleep Mode
So while it may appear that your Rasberry Pi goes into sleep mode, it turns out that there is no sleep mode for the Rasberry Pi itself, but a number of components on the Rasberry Pi can themselves go into sleep mode making it appear that the Rasbeerry Pi has gone to sleep. This question has been adressed in the Rasberry Pi Q&A here
So how to address this?
In my case the problem was that I wa unable to SSH into my Rasberry Pi if it had been inactive for a while, fortuneately the solution is straight forward
As a temporary solution there is a simple command line switch
pi@raspberrypi:~ $ sudo iw wlan0 get power_save Power save: on pi@raspberrypi:~ $ sudo iw wlan0 set power_save off pi@raspberrypi:~ $ sudo iw wlan0 get power_save Power save: off
If you want the change to persist accross reboots then you need to modify the configuration file
pi@raspberrypi:~ $ sudo vi /etc/NetworkManager/conf.d [connection] # Values are 0 (use default), 1 (ignore/don't touch), 2 (disable) or 3 (enable). wifi.powersave = 2