wpa_cli – Connection to Hidden SSID on Raspberry Pi

raspberry piraspbianwifiwpa-cli

I have a raspberrypi ZeroW that I am trying to connect to a network with a hidden ssid. I know that I could add this line "scan_ssid=1" to my wpa_supplicant.conf file for setup that way, however I would like to do all of the network configuration through wpa_cli.

The man page does not seem to have anything on hidden ssid's and when I run the set command it does not provide the output of all the variable options as stated in the man page I just get: "Invalid SET command – at least 2 arguments are required."

tldr: connect to hidden ssid through wpa_cli only

Best Answer

$ wpa_cli

> add_network 
x
> set_network x ssid "hidden_ssid"
> set_network x psk "secret"
// ALLOW CONNECT TO HIDDEN SSID 
> set_network x scan_ssid 1
> enable_network x
> save_config
> select_network x
Related Question