I am having a problem on my RPi2 (running Raspbian 7 wheezy) and the CanaKit wifi adapter (RT5370 chipset). Currently, I have a script running at startup which sends sensor information to a server. The problem is, after 30 minutes, the wifi adapter turns off (the blue signal light on the adapter turns off and I can no longer ping the pi), and the script exits because it can't send data.
I've searched the forums so far, and have tried a number of things. I tested to see if it was related to the display on the pi turning off, but that happens after 10 minutes rather than 30. I have tried adding "wireless-power off" to /etc/network/interfaces to disable power saver settings. I've tried running the pi with having just the adapter and power plugged in and nothing else, to make sure that it wasn't because the pi couldn't supply enough power to the adapter. I don't think the problem is because of power saving; I wouldn't think that it would turn off as long as the adapter is being used, but I could be wrong. A lot of similar forum answers I've seen have been for disabling power saving on the 8192cu, which I don't have. Everything works fine when I use ethernet, but I need for this project to be as compact as possible, so ethernet isn't really an option.
I know there are a few scripts available to automatically turn the wifi on again if it shuts down, however, once the wifi turns off, my script exits, and I need it to constantly be running.
Thank you to any answers that come in!