I had a similar problem connecting my PS3 to my wireless router. In the end I rebooted the router completely as it was connecting to the router but having a problem assigning with the DNS. Had to be a reboot though, just turning the thing off was not helping. Even then it took a couple of goes running through through the auto set up of the networking utility on the PS3 before it connected.
The Xbox 360 was a breeze compared to the PS3 to connect, same with the wii.