8

I've been having lots of problems with the configuration of a wireless stick in the raspberry pi 2

uname -a:

Linux raspberrypi 3.18.7-v7+ #755 SMP PREEMPT Thu Feb 12 17:20:48 GMT 2015 armv7l GNU/Linux

In dmesg we find

[    3.509177] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[    3.630499] usb 1-1.4: New USB device found, idVendor=0846, idProduct=9043
[    3.639452] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.649011] usb 1-1.4: Product: WNA1000Mv2
[    3.655215] usb 1-1.4: Manufacturer: Realtek
[    3.661455] usb 1-1.4: SerialNumber: 00e04c000001

and I have the driver running (lsmod)

    Module                  Size  Used by
     8192cu                528429  0 

and the usb is being recognized (lsusb)

Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 0846:9043 NetGear, Inc. 

My interfaces and wpa_supplicant.conf files look like this

cat /etc/network/interfaces:

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

auto wlan0

cat /etc/wpa_supplicant/wpa_supplicant.conf

ap_scan=0
ctrl_interface=DIR=/var/run/wpa_supplicant
GROUP=netdev
update_config=1
network={
    ssid="o2-WLAN45"
    psk="************"
    scan_ssid=1
    #Protocal type can be: RSN(for WP2) and WPA(for WPA1)
    proto=RSN
    key_mgmt=WPA-PSK
    #Pairwise can be CMMP or TKIP(for WPA2 or WPA1)
    pairwise=CCMP
    #Authorization option should be OPEN for both WPA1/WPA2 (in less commonly used are SHARED and LEAP)
    auth_alg=OPEN
}

The weird thing is that wlan0 does not even show in iwconfig:

lo        no wireless extensions.

eth0      no wireless extensions.

I've already read similar entries here but either they didn't work or they didn't apply to my problem. So the error I'm getting by doing ifup is

sudo ifup wlan0:

wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory
wpa_supplicant: /sbin/wpa_cli daemon failed to start
run-parts: /etc/network/if-up.d/wpasupplicant exited with return code 1

Through the GUI, it doesn't find an adapter and the status is as follows: enter image description here

I hope someone can help me because I've spent way too much time with it...

  • Have you tried using the desktop Wifi Configuration tool from the menu? I would start there, before trying to roll your own wpa_supplicant files. – Phil B. May 18 '15 at 12:57
  • Oh, and I assume it's just a typo, but the correct location of the interfaces file is /etc/network/interfaces, not /etc/networks/interfaces. – Phil B. May 18 '15 at 12:59
  • Thanks for the answer, I have corrected the typo. I have added the problem with the GUI, the status error and the fact that it does not find the hardware for it – Ognan May 18 '15 at 13:04
  • 1
    BTW, you typed pairwise=CMMP. There is no CMMP pairing, it is CCMP. Perhaps that is what makes wpa_supplicant crash? – Phil B. May 18 '15 at 13:51
  • 2
    If wlan0 is there, ip link set wlan0 up and then try what I suggested here to see if you can at least get a network connection manually (which turns out to be simpler in many cases). – goldilocks May 18 '15 at 14:11
5

Problem solved!!! I will explain here the steps I took:

I bought a good 2A charger, which at the beginning helped to see the blue light of the dongle. However it didn't yet connect. So googling and googling I came across this page

https://amalgjose.wordpress.com/tag/raspbian/

he gives a solution so that the dongle gets detected always. If you do exactly what he says it will be recognised (you can check that by doing iwconfig or ifconfig). For completeness sake I give here his solution:

Add the following contents to the /etc/rc.local file
modprobe 8192cu
echo "0846 9043" > /sys/bus/usb/drivers/rtl8192cu/new_id
ifdown wlan0
ifup wlan0

for some reason this is not enough, you have to add also

install 8192cu /sbin/modprobe --ignore-install 8192cu; echo "0846 9043" > /sys/bus/usb/drivers/rtl8192cu/new_id

I have found that if you don't add this latter file the raspberry will not begin automatically the wlan0 connection, you would have to log in with eth0 and then pass sudo ifdown wlan0; sudo ifup wlan0;

At this point you just have to configure the /etc/network/interfaces and /etc/wpa_supplicant/wpa_supplicant.conf. For completeness I give the working files I have now

/etc/network/interfaces:

auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet manual

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

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="o2-WLAN45"
        psk="******"
        key_mgmt=WPA-PSK
}

Big thank you to Phil B. and to goldilocks !

1

You don't need auto and allow-hotplug, just allow-hotplug. This also starts at boot automatically. Adding auto as well used to sometimes cause a delay at boot when the network connection was not made. 'auto' is more for servers where the boot can be configured to wait until the network is established, 'allow-hotplug' for desktop / laptop type users. I'm a Debian laptop user myself but saw this in passing and thought it worth a mention.

0

Another solution, hits for me: Check output for

 ifup wlan0 -v

It looks like this:

ifup: configuring interface wlan0=wlan0 (inet)
/bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/hostapd
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
wpa_supplicant: wpa-driver nl80211,wext (default)
wpa_supplicant: /sbin/wpa_supplicant -s -B -P/run/wpa_supplicant.wlan0.pid -i wlan0 -D nl80211,wext -c /etc/wpa_supplicant/wpa_supplicant.conf
Starting /sbin/wpa_supplicant...
wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
ifup: failed to bring up wlan0
root@host:/etc/wpa_supplicant#

catch the wpa_supplicant command and run it manually, with omitted -s and -B parameters. It will run in foreground, and write more diagnostics. Like this:

Successfully initialized wpa_supplicant
CTRL: Invalid group 'netdev update_config=1'
Failed to initialize control interface 'DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1'.
You may have another wpa_supplicant process already running or the file was
left by an unclean termination of wpa_supplicant in which case you will need
to manually remove this file before starting wpa_supplicant again.
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
root@host:/etc/wpa_supplicant# 

In my case, the problem is the syntax of wpa_supplicant.conf file in a part of GROUP setup. Put a newline right after the netdev keyword solve the issue.

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.