Wifi Configuration from the ha> console prompt - debug suggestions

Hi, I’m using the latest Rpi 4 image and booting up to the ha> prompt. It’s OS 7.6 and Core 2022.5.3

I can see SSIDs when I: network scan wlan0
so I assume the interface is operational. ‘nmcli radio’ also confirms Wifi is enabled.

I then attempt to connect wifi to a network:

network set wlan0 --wifi-mode infrastructure --ipv4-method auto --wifi-auth wpa-psk --wifi-ssid ssid --wifi-psk password

… obviously replacing ssid and password appropriately.

The box thinks for around 5 seconds, and then reports:

Error: Activating connection failed, check connection settings.

Interestingly, when I add the ‘-e’ flag to the above, the response is:

Error: Requested network interface update is not possible

Things I’ve also done:

  1. quoted the strings - fortunately I have no spaces in any SSIDs anyway
  2. tried 3 different networks (different APs and routers) - all with the same response

Have I messed up the incantations? Is there any other way to enable WiFi given that this appears to be a containerised solution?

So I dropped out of HA to the root prompt and switched to
nmcli device wifi connect "SSID" password "password"
but was thwarted yet again:

Error: connection activation failed: (7) Secrets were required , but not provided

So the secrets of connecting HA to wi-fi still remain out of reach, it seems.

AndyH

I also would like more documentation about this part of Homeassistant, there’s NOTHING out there about it except some forum posts.

for the record I was able to connect to my router (Google Nest wifi router) using the following string:

network update wlan0 --wifi-mode infrastructure --ipv4-method auto --wifi-auth wpa-psk --wifi-ssid 'My Wireless Network Name' --wifi-psk 'mywifipassword'

I think OP might have used " for strings instead of ’ but I’m not sure it made any difference, worked for me.

8 Likes

I would also like to see documentation for configuring a WiFi connection at the ha > prompt. I don’t intend to run Home Assistant on WiFi in production, I wanted to do some testing with an HP Stream laptop loaded with generic-x86-64 before buying an ethernet dongle. The storage is not removable so I used the Ubuntu method to load HASSIO. I found the dongle was only 14 USD on Amazon.com so it is ordered and will be here in a few days. It just would have been nice to verify everything was going to work and perform well on this laptop. Would it also have been possible to create a ‘wpa_supplicant.conf’ file or equivalent while still in Ubuntu before the first boot in to HASSIO?

1 Like

Many thanks! Worked for me too even though the HA web GUI was returning a
[homeassistant.components.hassio] Failed to to call /network/interface/wlan0/update - Activating connection failed, check connection settings.
error.

The only thing I would add (to assist a newbie using the Terminal add-on in Home Assistant) is that from the bash [core-ssh ~]$ root prompt you get in Terminal, just type ha <command> to run commands such as network.

Hopefully this will be like riding a bicycle / something I can’t un-see, and I’ll never have to struggle figuring this out in the future.