macOS sometimes can't connect to WiFi hotspot that's really working perfectly
Solution 1:
It happened again twice since I posted this, and I think I found something that seems to work. On the terminal, I do:
networksetup -setairportpower en0 off
networksetup -setairportpower en0 on
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport --scan
(that last command shows a list of available networks with their SSID)
networksetup -setairportnetwork en0 MyWifiSSID MyWifiPassword
Both times this made my connection work again.
Haven't tried Monomeeth's solution yet, but as it involves more manual interaction and rebooting my laptop, I hope the above 'on the fly' method will suffice.
Solution 2:
I would totally remove your Wi-Fi service, restart, and add your Wi-Fi service back.
To do this:
- Go to Apple > System Preferences > Network
- Select the Wi-Fi service on the left-hand side
- Click on the cog icon at bottom-left and select Make Service Inactive
- Now delete the service by clicking on the minus sign (i.e. the - button) at left of the cog
- Click on the Apply button
- Exit Network preferences
- Restart your MBP
- Go to Apple > System Preferences > Network
- Click on the plus sign (i.e. the + button) at left of the cog
- In the pop-up window, ensure that Wi-Fi is selected from the drop-down menu
- Click on the Create button
- Make sure Wi-Fi is on and connected (it should remember your previous settings, but if not just re-add your Wi-Fi network again)
Let me know if this resolves the issue.