Keep your wifi network card on “obtain an ip address automatically” and “obtain a dns server address automatically”. If that does not work try the manual setup.
If DHCP is still not working, you can try to set the IP address manually. Use a second device to find out the correct TCP/IP settings.
If the “unidentified network” message is replaced with the name of the router, you are probably online. Believe it or not, this solved my problem in the majority of cases. If this doesn’t work, there are still a few things you can try