What I want:
- Every time the Pi starts, it should connect to the wifi
- I should be able to ssh into it via its IP
So, after a whole day of trying and searching, I managed to finally connect to my wifi router. But, unfortunately, the connection is somehow not persistent. So here is my setup:
I ssh
into my raspberry while it is connected to USB. From here I created a /etc/wpa_supplicant/wpa_supplicant.conf
file with following content:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=DE
network={
ssid="MYDEVICENAME"
psk="MYDEVICEPASSWORD"
key_mgmt=WPA-PSK
}
#fake network workaround for headless Raspberry Pi Zero
network={
ssid="fakessid"
psk="fakepass"
key_mgmt=WPA-PSK
}
I don’t really remember where I got this from but it seems to work. Because I had no idea if it is relevant and saw both locations used, I copied the exact same thing one directory up to /etc/wpa_supplicant.conf
(is that even necessary?)
I rebooted, but the Pi did not connect to the wifi by itself. So I found this command online:
sudo wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -Dwext -B
which did connect my Pi to the internet.
I also can ssh into it.
I also have internet as I can clone an online repo.
I can’t apt-update
but I guess that’s probably a topic on its own.
But everytime I unplug it or reboot it, it won’t connect automatically and I’ll have to retype the above command.
How can I have the Raspberry Pi zero w connect to that network automatically every time it gets turned-on/booted?
I feel like it’s just one last small piece missing
Thank you!
/etc/wpa_supplicant/wpa_supplicant.conf
– Milliways Nov 11 '17 at 01:16apt-update
because there is no such command. – Milliways Nov 11 '17 at 01:17