Troubleshooting Wi-Fi connectivity issues

Recently had a strange issue with one of my client. The wireless connection would fail even though the SSID was visible, it would not accept the pre shared key.

This would happen randomly and would last for couple of hours. We tried changing the access point to ensure that the issue was not related to hardware - that did not help.

Playing around with different channels I found that the signal was quite stable on channel 11 and 6, but it still would lose connection randomly.

I found this tool (Xirrus Wi-Fi Inspector) on Google which helped me understand the Wi-Fi networks in the vicinity and analyze the different SSIDs, the channels they operated on. Most of them had already occupied the channel 11 and channel 6, since everything else had failed, I changed the channel to 8 and 4. 

The Wi-Fi has not been down since then.