If you are having problems creating a working network keyfile or importing the keyfile, this alternate method might work for you. It could also be that you have some other problem so this is not a "cure-all" for your wifi/network issues.
NOTE: This method assumes you already have a working ethernet connection
This page appears long but that's because I'm trying to cover all the small details. The process is very simple, really and doesn't take much time at all.
The short version:
- Install the SSH & Web Terminal Addon from the Community Repo (thanks, @frenck!)
- Turn off protected mode for the addon.
- Add the "networkmanager" package to the addon config.
- Open a connection to it and use nmcli to connect to your SSID.
This addon allows more customization than the official ssh server addon and you will be making use of the "packages" option.
Set "Protection Mode" to off
Create a good username and password or use a public and private key pair.
If you choose to use a user and password, save some time by coming up with something unique as the addon will check against the haveibeenpwned database and if your password choice exists there you'll have to come up with a new one.
Make sure you also fill out the user and password options for the web terminal.
The ssl option is set to "true" by default. Change it to "false" if you aren't using ssl.
Enter "networkmanager" in the packages section of the addon config.
Save and start the addon. It can take a minute to get going. Watch the logs below for any errors.
When you see this you are good to connect.
INFO: Starting the SSH daemon
Server listening on 0.0.0.0 port 22.
Server listening on :: port 22.
INFO: Starting the ttyd daemon
Connect with your prefered ssh client or return to Open Web UI at the top of the page.
If the tab that opens does not connect, edit the url to http:// instead of https://
First check that your wifi is enabled
nmcli radio
Now scan and list available wifi access
nmcli device wifi rescan
nmcli device wifi
Connect to wifi
nmcli device wifi connect YOUR_SSID password YOUR_WIFI_PASSWORD
This will try to connect to your SSID and will generate a network profile for you if successfull.
The output will be similar to
"Device 'wlan0' successfully activated with...."
nmcli con show
You should be seeing at least two profiles and hopefully they are both green.
If you are seeing some profiles you'd like to get rid of you can remove them using
nmcli connection delete CONNECTION_NAME
These may have two separate ip addresses on your network: one for ethernet, one for wifi. You can check the ip addresses using
ip addr show
Now connect to http(s)://your_wifi_ip:8123
in your browser.
That's it! Now you have two connections which are properly formatted. You can edit them interactively with further use of nmcli (static ip, for example).
For setting static ip on either of your connections, skip to the nmcli commands at this link below. You can ignore the part about logging into HassOS because you are using the addon in unprotected mode instead.
As noted, you will need to reboot after making these changes.