Raspberry Pi Model B
OS: Raspbian
I am running my Pi headless (currently through a direct Ethernet connection). I have a USB WiFi dongle. I would like to have the WiFi start up at boot and connect by DHCP.
http://rpi.tnet.com/project/faqs/headlessportablewifi suggests that I don't need to actually change /etc/network/interfaces from the default:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
I have configured /etc/wpa_supplicant/wpa_supplicant.conf for my network.
When I boot the Pi, WiFi does not immediately connect. But if I SSH in and run sudo ifup wlan0
, the Pi connects fine.
Isn't this something the Pi should do in its own boot process? I could presumably write tell some dotfile to run this command, but I would like to do it the proper way (and learn how my system works).
I know I can also set a static IP address for each WiFi network I want to use: How to setup multiple WiFi networks?. But I would prefer to have a simple solution where I only have to enter a couple lines on /etc/wpa_supplicant/wpa_supplicant.conf to add a new WiFi network.
What is the piece I am missing here?
sudo systemctl enable wpa_supplicant.service
– Daniel Argüelles Apr 10 '18 at 16:02