Using HassIO as a wireless AP

I’m trying to SSH into my host RPI3 … mainly so I can finish the setup of https://github.com/davidramosweb/hassio-addons/tree/master/hassio-hostapd which requires running the nmcli dev set wlan0 managed no command at the OS level. (My ultimate goal is to use the pi as an access point for a handful of esphome NodeMCU sensors in an area with weird WiFi)

I followed the directions on the HassOS developer page: https://developers.home-assistant.io/docs/en/hassio_debugging.html
I used my current public key (which works for SSHing through the addon) and saved it into a file called authorized_keys. I placed this on the root of a USB drive named CONFIG. I used the “Import from USB” in the HassIO section. I can see in the logs that it reloads something:

19-11-30 20:13:59 INFO (MainThread) [hassio.hassos] Syncing configuration from USB with HassOS.
19-11-30 20:13:59 INFO (MainThread) [hassio.host.services] Restart local service hassos-config.service
19-11-30 20:13:59 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.systemd1.Manager.RestartUnit on /org/freedesktop/systemd1

But when I use ssh [email protected] -p 22222 -vT
I get:

debug1: Reading configuration data /Users/willdampier/.ssh/config
debug1: /Users/willdampier/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to hassio.local port 22222.
ssh: connect to host hassio.local port 22222: Connection refused

I also tried rebooting the system with the USB in, incase there was some mounting issues. No luck.

Any thoughts? I’m at a bit of a loss on how to debug this.

Copy the ssh pub key to the config of the ssh addon. make sure that you are connecting to the correct port. by default it is 222 on the host.

How many 2s? Connecting to the SSH addon (that docker container, not the underlying OS) is on port 22. The docs for the debugging says the OS will be on port 22222. I tried port 222, but no dice there either.

Noted in the docs:

SSH access through the SSH add-on (which will give you SSH access through port 22) will not provide you with all the necessary privileges, and you will be asked for a username and password when typing the ‘login’ command. You need to follow the steps below, which will setup a separate SSH access through port 22222 with all necessary privileges.

Thats fine but have you looked at the config for the ssh addon?

Yes. I can login to my ssh-addon (through port 22) as a passwordless login. So I know the ssh-agent is loading everything and passing it along. Its just from within the ssh-addon container I can’t run the nmcli command.

Ok did you disable the protection mode in the ssh addon?

Yup. Not sure what that did as you can’t make OS level commands from there.

Generally it gives the docker instance access to the host and/or any other docker container.

Which ssh addon did you install? I’m just trying to assist but maybe barking up the wrong tree?

Did you install ‘SSH & Web Terminal’ or ‘SSH server’ addon?

Okay, you are barking up the wrong tree, Its not the addon that I need to SSH into. I’ve been able to do that. The point is that I can’t ssh into the underlying HassOS as things like nmcli don’t work when ssh-ing into an addon (protected mode or not).

The docs point to putting in an authorized_keys on a USB stick and then uploading that which will allow ssh into port 22222. The process described in the docs aren’t working. I’m trying to debug those as I need to run an nmcli command.

The docs regarding the setup at hassio-hostapd in your first post at the bottom, list under conflicts;

To prevent the addon stop working after a few minutes, you must disable NetworkManager for wlan0. You can use the SSH & Web Terminal addon with the option “Protection mode” disabled and run the following command:

nmcli dev set wlan0 managed no

So did you install the SSH & Web Terminal and are you using that?

Just trying to be more specific.

Whelp I “solved it”. Back filling what I did for anyone (or my future self) that comes across this thread. I’ve also adjusted the title to help others find the relevant information later.

@skutter was right, I was using the SSH Addon, what I needed was the SSH & Web Terminal addon. The former only allows SSH into the addon’s docker container while the latter allows web access to the host system’s terminal.

After figuring that out I was able to run the nmcli dev set wlan0 managed no command. This gave me an AP. However, after logging onto the AP the gateway IPs never worked. I setup the DHCP server addon and tried to get the network interfaces to properly talk to each other and six hours later I still had no success.

However, I did end up working out a solution. From a handful of other threads it seemed most people were able to get the AP working, just not through HassIO directly. I followed the AP setup here: https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md . Then I used the

curl -sSL https://get.docker.com | sh

trick to get docker installed followed by

curl -sL https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh | bash -s -- -m raspberrypi3 -d /home/user/docker/hassio

trick to bootstrap the HassIO install. After about 20 minutes I had an access point and bridge working off of my RPI3 with the DHCP server, subnet IPs, HassIO at the gateway IP, and the whole nine-yards.

I’m sure someone who has a more in depth knowledge of HassIO and network protocols could have gotten it working through the addon system but I can only bang my head against the wall so many times before my neighbors complain. I’ll take the success and move on with my real project.

Thanks to @skutter for pointing out the difference between the two addons, I’m not sure I would’ve ever noticed it without someone pointing it out.

1 Like