Troubleshooting help? WiFi only works when connected to PC

If I unplug it from the PC and plug it into a 9-volt battery or external 9-volt power supply, it will not connect to WiFi.

More than likely those power supplies are inadequate for your setup. Also #7 below might be helpful.

http://forum.arduino.cc/index.php/topic,148850.0.html