WiFi on a Raspberry Pi 3+

I’ve installed Hass.io on a Raspberry Pi 3 B+, which has built-in WiFi.

I did some searching, but I’m not finding much in this forum, or on the Home Assistant web site, about how to enable the WiFi. Am I the only one who wants to do this?

It’s working fine using a wired connection, but I’d like to locate the Raspberry where that would be inconvenient. Not being able to use WiFi would probably be a show-stopper for me using HA.

Any assistance would be appreciated!

1 Like

i would first format a flash drive with the name CONFIG then i would download visual code studio then on that flash drive you have to create a folder named network and within that folder with visual studio a file named my-network then follow this link for the my network file. You have to do this on visual code studio witch i will leave the link for right here. If you have any more questions i am happy to help. All of this was found on the getting started page on homeassistant website

1 Like

Thanks, that first link seems to have some good information.

I used M$ Visual Studio (Pro and Enterprise editions) for many years, but do you really need to use the open-source Visual Studio Code product for this? Seems like it’s just editing some text files. I was able to create and edit the my-network file in the (newly created) network folder without any IDE.

That said, it didn’t seem to change anything. Wireless still doesn’t connect, wired does.

WiFi and Static IP setup only: Format a USB-Stick with name CONFIG , create a folder named network and within that folder a file named my-network . Copy one of the examples to the my-network file.
its all in this link under #3

2 Likes

Thank you so much zacvoge for your patience! I’m new to all this. I got it working u sing a few clues from the links you provided, and some links from those pages to a couple of other pages. I think I’m beginning to understand. Here’s what I concluded:

  1. You can’t just edit the my-network file on the SD card which Hass.io is running off of (in the RPi.)
  2. Hass.io will read a properly formatted and named USB memory stick, if found inserted in the RPi at startup.
  3. That’s the only way to get network manager changes into the running Hass.io OS on the RPi.

Here’s what I did:

First, I created a my-network file on my own laptop, using the instructions here. Specifically, the file contains the following lines:

[connection]
id=hassos-network
uuid=72111c67-4a5d-4d5c-925e-f8ee26efb3c3
type=802-11-wireless

[802-11-wireless]
mode=infrastructure
ssid=(my router’s SSID)
#Uncomment below if your SSID is not broadcasted
#hidden=true

[802-11-wireless-security]
auth-alg=open
key-mgmt=wpa-psk
psk=(my router’s password)

[ipv4]
method=auto

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

Note that the parts in parens () are replaced, without the parens, with local values.

I took an old USB memory stick and reformatted it, giving it a label of “CONFIG”. I used the Windows command-line “Format F: /FS=FAT LABEL=“CONFIG” /Q”. You could use other methods, like Windows Disk Management. The key is, the format has to be FAT or FAT32, and the label has to be “CONFIG.”

I created a folder called “network” on the root of my newly-formatted memory stick, and copied the “my-network” file I’d created to it (no file extension!)

I powered down my Raspberry Pi, inserted the USB stick, and rebooted.

Now it connects only with my wireless router. The wired connection (still attached) is not used.

I’m documenting this because there is a lot for a beginner to wade through, and some basic concepts are often left unstated in documentation written by someone with more experience, to whom this may all be second nature. I figured I’d offer these basic steps for others who are as clueless as I am, in hopes that we can all learn the secret handshakes, acronyms and abbreviations so we can be initiated into the inner circle of Pi users someday.

14 Likes

Nice write up!
Do you need to keep the flash drive plugged in after wireless is working?

Thanks!
No, I was able to remove the USB flash drive once the update happened.

1 Like

Excellent explanation… Its the first time I have seen the proper description (which all others have missed) for us plebs about creating the ‘boot file’ on a USB drive using a Mac…
I knew that I must be missing something as all my previous attempts to create the USB wifi dongle had failed, and that was because I did not understand the term Text Editor.
Thank you… I can not move forward from there.

Do I understand this correctly: There is no way to use Pi Home Assistant via a WiFi connection without adding a USB thumbdrive holding the WiFi network configuration?

If so… That’s utterly ridiculous!

Another post suggested using nmcli but that command doesn’t exist on the Pi version (4.8).

I keep all my home-automation and IOT things on a completely separate WiFi network because, well, I simply don’t trust their security. The only way to get my Pi to see things on that network is to join that WiFi.

– Brian

I moved my rpi from wifi to Ethernet because it list WiFi connectivity regularly. This seems to be some Power saving thin on the Pi and I could not fix it.

The usb drive is only necessary to ipmort the setting. It can be removed once that is done.

Will it need the USB for config again after being power-cycled or is it permanent?
– Brian

You won’t need it again unless you reinstall HA from new

Ah, okay. Not so ridiculous, then. :slight_smile:

Thanks.
– Brian

The easiest way I found was to format a pendrive (FAT32) on the PC, name it CONFIG, create a folder called network, create a my-network file with the contents:

[connection]
id=my-network
uuid=72111c67-4a5d-4d5c-925e-f8ee26efb3c3
type=802-11-wireless

[802-11-wireless]
mode=infrastructure
ssid=Your SSID

#Uncomment below if your SSID is not broadcasted
#hidden=true

[802-11-wireless-security]
auth-alg=open
key-mgmt=wpa-psk
psk=Your Password

[ipv4]
method=auto

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

this done he should connect to his wireless network. You can remove the pen drive then, you don’t need to put it on anymore.

[11.2021] Step-by-step manual to setup WiFi connection within home assistant:

You need: balenaEtcher software, SD-card, USB-drive

  1. Flash the SD-card drive using balenaEtcher software according to the official docs
  2. Format USB-drive as FAT32 and name it CONFIG
  3. Create folder network, inside it create a file my-network
  4. Write the file with the following content
[connection]
id=my-network
uuid=72111c67-4a5d-4d5c-925e-f8ee26efb3c3
type=802-11-wireless

[802-11-wireless]
mode=infrastructure
ssid=**Your SSID**

#Uncomment below if your SSID is not broadcasted
#hidden=true

[802-11-wireless-security]
auth-alg=open
key-mgmt=wpa-psk
psk=**Your Password**

[ipv4]
method=auto

[ipv6]
addr-gen-mode=stable-privacy
method=auto
  1. Plug into Raspberry Pi 3B+ USB-stick and SD-card
  2. Plug power supply and wait for around 1 minute (Note: do not plug LAN cable)
  3. Check the http://homeassistant.local:8123/

Troubleshooting:

If you cannot connect via homeassistant.local, check the following:

  1. Go to your router (usually via 192.168.1.1 or 192.168.0.1)
  2. Check Wireless tab and Active clients
  3. If homeassistant client appears with ip-address, use alternative link: http://ip-address:8123/

Enjoy

1 Like

Thank you!!

Has this been officially documented anywhere else?

Almost three years since my original post, you’d think a new user would not still need to go digging to learn this simple and critical step in setting up HA.

Anyone know if this works with a non-static ip?