HASS.IO - Wifi setup config file

Hi

I have just installed HASS.IO on my Pi3 but did not execute the optional step WIFI setup step during the installation.

The PI and HASS.IO are up and running connected via ethernet.
Now I would like to also configure the WIFI connection.
Where do I find the config file on the PI?

Thank you in advance
Peter

1 Like

I am interested as well but for a different reason. I want to run both connections, to two separate networks.

Hi,

I set up my Hass.io wifi using the following:
Optional - Setup the WiFi or static IP: On the SD-card, edit the system-connections/resin-sample file and follow the ResinOS howto.

from https://home-assistant.io/hassio/installation/

Switch off hass.io, unplug SD card and put it in your computer and edit the resin-sample save as resin-wifi (with corresponding name in config file) re plug card and resin os will connect to your wifi.

I cannot provide example of my wifi config file but it’s pretty straightforward to configure following the guide.

With best regards,

Jo

It actually doesn’t matter whether you save as resin-wifi or resin-sample, both will be processed. You do need make sure the ID matches the filename.

Example contents in resinOS docs, suitable for most WPA/WPA2 secured wifis:
[connection]
id=resin-wifi
type=wifi

[wifi]
hidden=false
mode=infrastructure
ssid=INSERT_YOUR_WIFI_SSID_HERE

[ipv4]
method=auto

[ipv6]
addr-gen-mode=stable-privacy
method=auto

[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=INSERT_YOUR_WIFI_KEY_HERE

Hi Buut,

Many thanks for the precision on this, I was testing it with resin-sample and was not working, I made some changes in the file and save it as resin-wifi (with matching id of course) and wifi was working afterwards.

So i was assuming that resin-sample was an ignored file and needs to be rename to been processed :slight_smile:

Do you know if both eth0 and wlan0 be set up?

Hi, I’m having the exact same situation as stahelp,
Wired connection works, but I’m having problems setting up wifi. I tried everything mentioned in this thread and nothing helps, it just won’t connect to wifi. Here is my config file:

[connection]
id=resin-wifi
type=wifi

[wifi]
hidden=true
mode=infrastructure
ssid=mywifi

[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=mypass

[ipv4]
method=auto

[ipv6]
addr-gen-mode=stable-privacy
method=auto

I assume that hidden must be equal to false
hidden=false

Tried it, still nothing.

Is there any way to get some logs to see what’s going on?

Figured it out!

My router was on 13th channel and rpi can only see from 1st to 11th channel.

3 Likes

Thank you very much. I had no idea. Now it works great :grinning:
(Except for my Tellstick Duo :wink:)

Hello!
I want to set up RPi wi-fi as access point:

[connection]
id=resin-wifi
type=wifi

[wifi]
hidden=false
mode=ap
ssid=wifi_name

[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=wifi_pass

[ipv4]
method=auto

[ipv6]
addr-gen-mode=stable-privacy
method=auto

And it works fine, but I’d wish to change security to WPA2. How to do that?

1 Like

Hi, i got same issue. How to configure WPA2 ?

1 Like

Why you use AP mode? In that way you can conect to the raspberry and then scan wifi networks, select one and enter the credentials from a web browser?

Cause I think will be very useful have the posibility to do that, but I dont know why, I mean enter the credentials in an easy way, as we do wjen we connect a smartphone to a wifi network.

I needed AP mode because I built independent and isolated network for IoT stuff. My router creates Wi-Fi network for my laptop, phone, etc and RPi creates independent Wi-Fi network for vacuum, lights, humidifier and other IoT stuff. I made such setup in terms of security and to make my network simpler.

1 Like

Hi,
I also want to create AP mode to have an isolated WiFi network for smart devices.
I’ve been playing with some configuration files, but I don’t know how to setup Hassio RPi 3 IP address for that network, neither how to enable dhcp.
Using your example file, and tested with a smartphone, the smartphones connect to the network, but no IP address is assigned.
Do you know how to configure these values?

Thanks!

Hi!
That config only creates Wi-Fi AP. Devices need IP address to work properly. IP address could be assigned manually on device, but not all devices support it, so we need a DHCP server to make things easy. DHCP server doesn’t have to be on Raspberry Pi itself, but it’s easier to have it on Pi. There is an addon for HASSio, called “DHCP Server”, so just install it (connect RPi via Ethernet to get access to it while Wi-Fi network is not configured yet).
Here is my config for that addon (all addons configuration available via Hass.io tab at Homeassistant webgui):

{
  "default_lease": 86400,
  "max_lease": 172800,
  "domain": "local",
  "dns": [
    "8.8.8.8",
    "8.8.4.4"
  ],
  "networks": [
    {
      "subnet": "10.0.1.0",
      "netmask": "255.255.255.0",
      "range_start": "10.0.1.20",      #This range is for automatic DHCP
      "range_end": "10.0.1.40",
      "broadcast": "255.255.255.255",  #Important! Broadcast IP should be like this, otherwise device will not get DHCPOFFER package
      "gateway": "10.0.1.1",           #IP of RPi
      "interface": "wlan0"
    }
  ],
  "hosts": [                           #List of static IP addresses, because Homeassistant often needs static IP of sensor/switch/etc
    {
      "name": "Hassio",                # RPi itself
      "mac": "MAC",
      "ip": "10.0.1.1"
    },
    {
      "name": "XiaomiGateway",
      "mac": "MAC",
      "ip": "10.0.1.2"
    },
             * * *
 ]
}

Pay attention at broadcast option. Documentation says that it should be x.x.x.255, but as far as I know DHCP protocol, it’s not correct: device sends DHCPDISCOVER package to broadcast address 255.255.255.255, server gets it, sends DHCPOFFER back. And if we send DHCPOFFER to x.x.x.255 address, client device will not get it, DHCPOFFER should be sent to broadcast address. Maybe I wrong, or there is a bug in addon, but until I change broadcast address to 255.255.255.255, my client devices don’t get proper IP.

1 Like

Thank you very much!

Well, seems like I was wrong about broadcast address. And faced with another problem.
On Hassio, wi-fi is enabled right after RPi reboots (ResinOS starts it automatically) and wi-fi AP becomes available before Docker is fully initialized and DHCP-server container is being loaded.
And within time after AP available (and no dhcp server yet) and before DHCP server container ready some devices (for example most of Xiaomi devices) decide that DHCP server not present. As a result, devices get APIPA ip addresses and stop send DHCPDISCOVER. And when server is ready, there is no devices request it.
So, add-on itself and its config are fine, sorry, my fault.
Problem is that DHCP server in Docker starts after wi-fi AP.
At this moment I don’t have a solution, but as soon as I find it - I post it here.