279

There are some great answers here, but many are out of date. Since May 2016, Raspbian has been able to copy wifi details from /boot/wpa_supplicant.conf into /etc/wpa_supplicant/wpa_supplicant.conf to automatically configure wireless network access: If a wpa_supplicant.conf file is placed into the /boot/ directory, this will be moved to the /etc/...


72

Well, there is a very simple solution: Go to /etc/ifplugd/action.d/ and rename the ifupdown file to ifupdown.original Then do: cp /etc/wpa_supplicant/ifupdown.sh ./ifupdown Finally: sudo reboot That's all. Test this by turning off/on your AP; you should see that your Raspberry Pi properly reconnects.


61

Problem solved! It seems that even though I added the gateway information into the interfaces file, wlan0 didn't really have a default gateway. When I ran sudo route -n it yielded Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 ...


32

I prefer to disable most of the network auto configuration and connection management daemon stuff and deal with it myself. Here's a (bash) script that will keep the connection up as long as the network is there and you do not have a glitchy wifi driver or power issues; the idea is to ping the router every N seconds, and if that fails, re-connect: #!/bin/...


26

This applies to Raspbian Wheezy prior to 2015-05-05 for later (and Jessie/Stretch) See How do I set up networking/WiFi/Static IP As suggested by the community, my answer extracted from the question. I got it working right now so I'll share all my configuration files with the community. Firstly lets look at the wpa_supplicant.conf file: pi@raspberrypi ~ $ ...


26

Some specific Instructions: Contents of /etc/network/interfaces: auto lo iface lo inet loopback allow-hotplug eth0 iface eth0 inet dhcp allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf post-up ifdown eth0 iface default inet dhcp Contents of /etc/wpa_supplicant/wpa_supplicant.conf: ctrl_interface=DIR=/...


24

The default Raspbian /etc/network/interfaces configuration does not connect to WiFi on boot. The key lines of the interfaces man-page are: Lines beginning with the word "auto" are used to identify the physical interfaces to be brought up when ifup is run with the -a option. (This option is used by the system boot scripts.) ... Lines ...


21

I recently stumbled across a console application that sorts all the wireless configuration hell out. You can also use this tool to configure the LAN interface. sudo apt-get install wicd-curses It will install quite a few other packages and run its own daemon in the background but it sure makes configuring everything a whole lot easier. Run it with sudo ...


19

Default behavior seems to consist in storing wifi settings in /etc/wpa_supplicant/wpa_supplicant.conf, just like @lucaslink mentionned. I'd like to provide a bit more details however. Here is how the wpa_supplicant.conf file is supposed to look like: $ sudo cat /etc/wpa_supplicant/wpa_supplicant.conf ctrl_interface=DIR=/Var/run/wpa_supplicant GROUP=...


16

I know this is an old question, but it was the first result that came up in my search when I had essentially the same problem on my freshly installed Pi Zero. I found the key to my answer on this other question, among other sources. So basically, though the Pi itself apparently doesn't have a sleep mode, individual devices in Linux (including the network ...


16

I changed wpa-ssid ="network-essid" to wireless-essid my_essid_without_quote and, now, it works fine. auto wlan0 allow-hotplug wlan0 iface wlan0 inet dhcp wireless-essid my_essid_without_quote


16

I have developed lazycast that is designed to work on Raspberry Pi 3. lazycast follows (most of) the wifi display specification (commercially known as Miracast) and uses wifi p2p (commercially known as WiFi Direct) to set up a connection. I have tested it with Windows 8.1 and 10 sources. It requires no modification (using the built-in wifi) to the hardware ...


15

For me, the recommended solutions above were unsatisfactory. For one, I have a blank in my SSID, so I needed to specify it in quotes. Secondly, I have several SSIDs here, and I want to connect to one specifically. I used this in the file /etc/wpa_supplicant/wpa_supplicant.conf and it worked: network={ ssid="my ssid with spaces" key_mgmt=NONE }


14

This can be solved with no extra scripts. In /etc/network/interfaces put: allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp The roaming allows the interface to self-heal.


13

Since November 2016 SSH has been disabled by default in standard Raspbian images for security reasons. To re-enable it, create a blank file called either ssh or ssh.txt on the sd card boot folder ( fat32 partition accessible from windows) To preconfigure the wifi settings, you also create a file called wpa_supplicant.conf there containing: ctrl_interface=...


13

This happens a lot with one of my Raspberry Pis. I have a script which checks for an Internet connection and runs ifup wlan0 when a connection is not present. Some of the things you could try: Rebooting the Raspberry Pi Checking that you have a valid IP address using ifconfig Ensuring that you have power-saving features disabled on the dongle by adding ...


11

Add the following to the end of /etc/wpa_supplicant/wpa_supplicant.conf : network={ key_mgmt=NONE priority=-999 } That'll connect to any open / unsecured wifi in range. The priority line just means it'll connect to any of your other named networks in preference.


10

You might have multiple instances of wpa_supplicant running. try ps ax | grep "wpa_supplicant -B" | grep -v grep kill {pid of wpa_supplicant} if that works then you can try this sudo kill $(pgrep -f "wpa_supplicant -B") sudo ifconfig wlan0 down sudo ifconfig wlan0 up sudo rm -r /var/run/wpa_supplicant/* sudo wpa_supplicant -B -iwlan0 -f/var/log/...


10

This setup is DEPRECATED and no longer maintained! Look at Access point as WiFi repeater, optional with bridge for a more flexible setup. It is possible to use the wifi device on a Raspberry Pi as an access point and at the same time connect as client to another already established wlan. I have heard this is possible for RPi-0W, RPi-3B and RPi-3B+. But ...


8

Something is wrong. The pi does not have a "sleep mode". I've only had my pi a few weeks and have not left it on the whole time, but I intend to eventually and I have left it on for some long stretches. I'm running raspbian, and I have a personal dislike for NetworkManager, lol, so that is disabled. To keep the wifi up, I run a script which pings the ...


8

I used simple steps and it perfectly worked for me: Open a root terminal in raspberry Pi. Now you need to edit your script that's starting X. In the default build with lightdm. Open "lightdm.conf" file located in, /etc/lightdm/lightdm.conf Add below line in to SeatDefault (or Seat:* in newer LightDM versions) section. [SeatDefaults] xserver-command=X -...


8

If a device does not have internet access or other access outside the local subnet, then you should eliminate the gateway. Listing a gateway on both interfaces is likely the culprit. If the ethernet is for the local subnet only remove that gateway.


8

If you want to use the PI exclusively as a HTPC or media center, you could use a distribution geared towards such applications. OpenELEC/XBMC /RasBMC seem to be the obvious choice. I did try OpenELEC at one time, but getting WiFi to work reliably on it seemed to be a pain. Here's how I went about using Raspbian (since I use the RPi for tasks other than ...


7

I got it. I had to replace wpa-roam by wpa-conf. If anyone could explain why, I'd be happy ;-)


7

I figure that I can safely say now that the problems are due to the device and/or the rt2x00 driver. I have been using Ethernet only the last 48 hours, copied many many Gigabytes of data, and haven't got a single problem. Hence, currently I would discourage the usage of rt2800 based devices, and I will try to find another dongle, maybe one with the Realtek ...


7

It seems to be a known problem. From what I've found, all we can do is: # disable power management (may need to be done periodically?) iwconfig wlan0 power off and disable hw encryption (so it will be done in the software). Edit or create /etc/modprobe.d/rt2800usb.conf : options rt2800usb nohwcrypt=1 Also don't forget to update /lib/firmware/rt2870.bin ...


7

One of the things that I have read a hundred times in dealing with anything attached to the USB on any model of RPi is to make sure that you have a decent Power Supply (2 or more Amps) or use a quality powered USB hub. Could it be possible that your WiFi dongle isn't getting enough power now because the HDMI screen is too greedy?


7

English is not my native language so please be patient. When I don't know how to configure something, sometimes I let the system do it for me, mostly of the times, things works with default values. In this case, if you don't know the function of the pairwise and group parameters. You could check this Page or read below: pairwise: list of accepted ...


7

sudo systemctl stop dhcpcd.service will stop (deactivate) dhcpcd sudo systemctl disable dhcpcd.service will prevent it from restarting. Having said the above, I think this is a bad idea. There are a few different network managers in use on Pi under Linux. dhcpcd performs well, and has been chosen by the Foundation for good reasons. On another point, you ...


7

I assume you are using Raspbian and you have setup the access point with hostapd. To switch the access point this commands should do: rpi ~$ sudo systemctl stop hostapd.service rpi ~$ sudo systemctl start hostapd.service It is difficult to say much more about start/stop hostapd because I don't know anything about your setup. Do you use a stand alone access ...


Only top voted, non community-wiki answers of a minimum length are eligible