If you get an error that "Cannot get an IP address when connecting to a Wi-Fi network" or we stop at "Obtaining an IP address..." it's usually a problem with the device or network card misreading the IP address. How to fix it? By setting a static IP address on your network card, router or phone.
Even before setting a fixed IP address, it's a good idea, just to be sure, to reboot the router, turn the Wi-Fi off and on again, and try connecting again.
How do I set a static IP address on my phone?
In the case of the phone - we go into Wi-Fi connections, select the network of interest, click on details or properties, and there under "IP Settings" (or something similar) change the current DHCP to Static and enter a static IP address. If we are connected to this Wi-Fi also, for example, on a computer, and there the static IP address differs, it is worth changing it on the phone to the one from the computer - of course, if on the PC we connect to the Wi-Fi correctly and the Internet works for us.
How do I set a static IP on my computer?
For a computer on Windows - go to the Control Panel -> Network and Internet -> Network Connections and right-click on the network card whose IP address you want to change to static, and then enter Properties. Select "Internet Protocol Version 4 (TCP / IPv4)," click Properties and in the next window select "Use the following IP address." - here we enter our static IP address. We can also on occasion change DNS servers, for example, to those from Google - 220.127.116.11 and 18.104.22.168. Click OK and you're done.
If this does not work after all, it is still worth reinstalling the drivers for the network card in the computer through the control panel.