I upgraded my wireless access point to 11N and had to reset my Wii connection. I got this 51331 error again and again after many trials and errors.
It turned out that Wii didn’t like WPA2!
Here’s my final setup:
11N router: 11 b/g/n mixed mode, WPA-PSK (TRIP) and Channell 11
Wii: Manual setup; Connection 2 (Wireless); Auto-IP and Auto-DNS, No Proxy and MTU = 1500.