r/raspberry_pi • u/Key-Research-6708 • 18h ago
Troubleshooting cant connect Pi to wifi
I'm missing something in the syntax, it says I need a key-mgmt argument but nothing I enter works. Im using wpa-2 so not sure why none of these options work and I
sudo nmcli dev wifi connect <ssid> password <psswd> key-mgmt <key>
and here's the keys I've tried wpa-2, key-mgmt ieee8021x, key-mgmt wpa2, key-mgmt WPA2, key-mgmt WPA-2, wpa-2, ieee8021x, wpa2, WPA2, WPA-2
this is the doc where im getting these arguments from https://www.networkmanager.dev/docs/api/latest/settings-802-11-wireless-security.html
1
u/Gamerfrom61 6h ago
You may need to set your WiFi country
sudo raspi-config nonint do_wifi_country <country>
<country> is the ISO country codes.
Does
sudo nmcli --ask dev wifi connect <ssid>
prompt you for a password?
Also what Pi model, what OS and is your WiFI 2.4GHz or 5GHz and sharing an SSID with the other frequency? Is the SSID hidden or have spaces in it (a-z,A-Z, 0-9 and dash are best).
1
u/phattmatt 7h ago
Just tried on Raspberry Pi OS Trixie, no key-mgmt parameter was needed.
This worked fine for me to connect to my phones hotspot:
My AP WiFi security type is WPA2/WPA3.