I had similar issues before on another project and the only way i was able to fix this was to get my RPi to ping the router every 10Min.
What i have noticed is that my unit worked 100% unit i lost wifi connection to the unit for an extended time.
I had to switch my AP off for a day when i had work done in the room where the AP was based, from 07:00 to about 17:30
One the AP was back online, i was unable to see OSPi, the only way to get it back on line was to power down and power up again.
Anyone with some idea, else i shall edit cron and add my 10Min. ping