I've just wasted 20 hours of my life trying get wifi to work on a Raspberry Pi.
All I had to do was follow a previous post, and it should have worked straight away. But life's not like that!
The cause of my problem was rather unexpected, and the solution couldn't have been easier.