Headless wifi setup

I’m sure this is a simple one, but for the life of me, I can’t find the answer. I’m installing Home Assistant on a headless Pi3a. (No wired connection). Obviously I have to put in wifi parameters somewhere, but I can’t seem to see where it looks for them (only info I’ve found seems to be out of date)

Setting up a Raspberry Pi headless

I saw that, but that refers to raspbian, not Home Assistant OS… There is no ‘boot’ folder created in which to put a wpa supplicant file.

Okay, I don’t think you can do that based on the documentation.

I was worried about that… it would seem like a pretty big oversight given the number of people running this on single board computers…, really hoping I can at least preconfigure a network… I’m setting up for a friend who isn’t the most technical person.

I used the instructions here - there’s a section on setting up wi-fi about halfway down the page.

Basically, you edit the configuration on the SD card before you insert it into the RPi and run HA for the first time.

3 Likes

Home Assistant Installation Guide 2021 - Tech Tech & More Tech has correct directions: you configure your installation normally, but before you power on the pi, you also insert a FAT32 format USB thumb drive named CONFIG containing a folder named network containing a file named my-network (no extension) with content as documented on that link. If your thumb drive has an LED on it, you’ll see it blink and the contents will be absorbed into your setup.

You can test that it worked by going to a computer on the same wifi network and typing:

ping homeassistant.local

( <control>C to exit ping) if you get lines of packets back from ping then you know that the pi is on the network.

1 Like

I struggled a lot, but later realized that the key to success was to save the my-network file with unix line endings.

Please make sure to save this file with UNIX line endings (LF, and not Windows’ default CRLF endings). You can do this using Notepad these days!

If you are working with windows, download Notepad++, use the “Edit”->“EOL Conversion” option before saving the file.

Place the file “my-network” in a folder “CONFIG”/network in the SD Card, eject the SD Card, put it in the RPi and restart it. You will be connected to the network through your wifi.

4 Likes