2

I am using a Pi2 with Wifi USB Wifi Adapter. Every time I boot, I have to connect to the wifi manually by providing the password. Is there any way Pi2 can automatically connect to the wifi on boot?

When I boot up, only Wifi Dongle is connected, not the ethernet cable.

My settings are as follows.

/etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.40.201
netmask 255.255.255.0
network 192.168.40.0
broadcast 192.168.40.255
gateway 192.168.40.1
dns-nameservers 4.2.2.2

auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

auto wlan1
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

/etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
ssid="Cisco09589"
psk="password"
key_mgmt=WPA-PSK
}

OS and Kernel version

pi@raspberrypi ~ $ cat /proc/version Linux version 4.1.19-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #858 SMP Tue Mar 15 15:56:00 GMT 2016

pi@raspberrypi ~ $ lsb_release -a No LSB modules are available. Distributor ID: Raspbian Description: Raspbian GNU/Linux 8.0 (jessie) Release: 8.0 Codename: jessie

pi@raspberrypi ~ $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)" NAME="Raspbian GNU/Linux" VERSION_ID="8" VERSION="8 (jessie)" ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

  • Unless you are using a year old Raspbian this won't work. See How do I set up networking/WiFi/Static IP If you still have problems you need to describe your network. – Milliways May 11 '16 at 9:28
  • I tried that, However it's still not working. I have added the OS and kernel information in the question. – Ashwin Pajankar May 11 '16 at 9:44
  • But what is the configuration of your network? – Milliways May 11 '16 at 10:34
  • It's a wifi network with given settings. It's DHCP type. – Ashwin Pajankar May 11 '16 at 10:41
  • please show your "iwconfig" after boot! – scherzkrapferl May 12 '16 at 15:03
4

I had the same issue when I once configured the wifi through the preinstalled GUI. There was no other chance than reinstall raspian and make the whole configuration with /etc/network/interfaces.

I would recommend not using the /etc/wpa_supplicant/wpa_supplicant.conf but instead put your wifi password and name into your configuration directly.

This would be my configuration with a static IP address to easily connect with your PI via ssh:

auto lo
iface lo inet loopback

iface eth0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
    address 192.168.0.198
    netmask 255.255.255.0
    network 192.168.0.1
    broadcast 192.168.1.255
    gateway 192.168.0.1
    wpa-ssid "WIFINAME"
    wpa-psk "WIFIPASSWD"

Don't forget to restart your wifi, after you made your changes!

2

Your current wlan0 configuration requires manual IP setup (like for eth0 in this file or via ifconfig like command). I hope you are using DHCP, so replace string "iface wlan0 inet manual" with "iface wlan0 inet dhcp".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.