I'm having trouble getting wifi working on my new RPi2. It works fine when I run X and use wpa_gui, but it's not working on the console, even when using the configuration saved by wpa_gui.
The main difference between the two is that, when wpa_gui runs the show, DHCP works and gets an IP address, and the route table gets a couple of entries, whereas on the console neither happens. Even if I force a static IP, the route table is still empty and wifi still doesn't work.
Some info about my hardware:
lsusb
reportsRealtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
lsmod
lists8192cu
installed, which I believe is the correct driver for this chipset.
My wpa_supplicant.conf
looks like this:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="YYYYY"
psk="xxxxxxxx"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}
The output of iwconfig
is identical in both X and console environments:
wlan0 IEEE 802.11bg ESSID:"YYYYY" Nickname:"<WIFI@REALTEK>"
Mode:Managed Frequency:2.412 GHz Access Point: xx:xx:xx:xx:xx:xx
Bit Rate:54 Mb/s Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:****-****-****-****-****-****-****-**** Security mode:open
Power Management:off
Link Quality=68/100 Signal level=45/100 Noise level=0/100
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
My /etc/network/interfaces
file is:
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
There are some slight differences in the processes running: under X there are some extra DBus-related processes running, and they run as user pi
, whereas the one that is running in the console is run as user messagebus
(104) though curiously this name is not displayed by ps
even though it is in /etc/passwd
.
Console listing (relevant processes):
root 1709 1 0 22:56 ? 00:00:00 /usr/sbin/ifplugd -i wlan0 -q -f -u0 -d10 -w -I
root 1759 1 0 22:56 ? 00:00:00 /sbin/wpa_supplicant -s -B -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 -W -D nl80211,wext -c /etc/wpa_supplicant/wpa_supplicant.conf
root 1793 1 0 22:56 ? 00:00:00 /sbin/wpa_cli -B -P /var/run/wpa_action.wlan0.pid -i wlan0 -p /var/run/wpa_supplicant -a /sbin/wpa_action
104 2100 1 0 22:56 ? 00:00:00 /usr/bin/dbus-daemon --system
root 2229 1 0 22:58 ? 00:00:00 dhclient -v -pf /run/dhclient.wlan0.pid -lf /var/lib/dhcp/dhclient.wlan0.leases wlan0
X listing:
root 1709 1 0 02:07 ? 00:00:00 /usr/sbin/ifplugd -i wlan0 -q -f -u0 -d10 -w -I
root 1759 1 0 02:07 ? 00:00:00 /sbin/wpa_supplicant -s -B -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 -W -D nl80211,wext -c /etc/wpa_supplicant/wpa_supplicant.conf
root 1793 1 0 02:07 ? 00:00:00 /sbin/wpa_cli -B -P /var/run/wpa_action.wlan0.pid -i wlan0 -p /var/run/wpa_supplicant -a /sbin/wpa_action
104 2100 1 0 02:08 ? 00:00:00 /usr/bin/dbus-daemon --system
pi 2361 2338 0 02:16 ? 00:00:00 /usr/bin/ssh-agent /usr/bin/ck-launch-session /usr/bin/dbus-launch --exit-with-session x-session-manager
pi 2366 1 0 02:16 tty1 00:00:00 /usr/bin/dbus-launch --exit-with-session x-session-manager
pi 2367 1 0 02:16 ? 00:00:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
pi 2417 1 1 02:17 tty1 00:00:01 /usr/sbin/wpa_gui
root 2510 1 0 02:17 ? 00:00:00 dhclient -v -pf /run/dhclient.wlan0.pid -lf /var/lib/dhcp/dhclient.wlan0.leases wlan0
Just thinking about it as I type this - could it be a permissions issue around the pi
and messagebus
users that's causing something in the network initialisation process (eg. DHCP) to fail in the console?
NetworkManager
installed to begin with, so I'm still not sure what the issue was. (ifplugd
perhaps?) Anyway, I ended up installingwicd-curses
, which worked too and was dead easy. – MatthewD Mar 16 '15 at 12:33