Connect to hidden networks?
I'm having difficulty connecting to a hidden network if I haven't already introduced the network to the system via nmcli con add ... (on Raspberry Pi 3 with Raspbian Jessie Lite, Linux Kernel 4.4.15 for ARM). It says Executing: nmcli device wifi connect "[ssid]", followed immediately by Error: No network called [ssid] could be found. (Presumably because it's hidden.)
When I do add the network before launching my node application, it connects just fine, but with the additional step of Executing: nmcli connection delete "[ssid]" before trying to connect.
Is there a way to do the hidden-network-introduction step within this module?
Thanks!
Edit: Connection actually occasionally fails even after introducing the hidden network, saying that (53) The Wi-Fi network could not be found. Also, the fact that it succeeds most of the time, even after Executing: nmcli connection delete "[ssid]", is curious to me.
Working with nmcli on linux directly, I've had to use a different set of commands to connect to hidden networks.
The code in here uses nmcli device wifi connect [ssid] password [password]. See https://github.com/msolters/wifi-control-node/blob/v2.0.0/src/linux.coffee#L138-L200
To connect to a hidden network, I had to issue these four commands instead:
nmcli connection add type wifi con-name [ssid] ifname [interface-name] ssid [ssid]
nmcli connection modify [ssid] 802-11-wireless-security.key-mgmt wpa-psk
nmcli connection modify [ssid] 802-11-wireless-security.psk [password]
nmcli connection up [ssid]
I suppose those could be chained with && separating each so it is still a one-line exec-sync command. I haven't tried forking this repo yet to test if it works.