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?
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.
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.
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
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
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:
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.
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?
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.
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.