dbip
Posts: 8
Joined: Sun Jan 15, 2017 5:49 pm
Location: Barcelona

Unable to connect WiFi with USB dongle RTL8192CU

Thu Feb 06, 2020 10:06 am

Dear all,

I've spent so many hours trying to connect WiFi with my Belkin USB dongle (RTL8192CU chipset) and really can't manage :-(

I hope anyone here my give me a clue :-)

uname:

Code: Select all

Linux xxxxxx 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux

lsusb

Code: Select all

Bus 001 Device 004: ID 050d:2103 Belkin Components F7D2102 802.11n N300 Micro Wireless Adapter v3000 [Realtek RTL8192CU]

lsmod

Code: Select all

Module                  Size  Used by
8192cu                582217  0
cfg80211              543027  1 8192cu

iwlist wlan0 scan

Code: Select all

          Cell 07 - Address: 98:DA:aa:bb:xx:yy
                    ESSID:"xxxxxxxx"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.432 GHz (Channel 5)
                    Encryption key:on
                    Bit Rates:300 Mb/s
                    Extra:wpa_ie=dd1a0050f20101000050f20202000050f2040050f20201000050f202
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac04000fac020100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD800050F204104A0001101044000102103B00010310470010876543219ABCDEF0123498DAC46944651021000754502D4C696E6B1023000941726368657220433610240003312E301042000C4172636865722043362076321054000800060050F20400011011000A417263686572433676321008000200001049000600372A000120
                    Quality=72/100  Signal level=46/100
/etc/metwork/interfaces

Code: Select all

allow-hotplug wlan0
auto wlan0

# wifi
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

/etc/wpa_supplicant/wpa_supplicant.conf:

Code: Select all

network={
        ssid="XXXXXXXXX"
        psk="XXXXXXX"
}


wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
(although it says auth_failure I copied and pasted the password...)

Code: Select all

Successfully initialized wpa_supplicant
nl80211: send_and_recv->nl_recvmsgs failed: -33
wlan0: Trying to associate with 98:da:bb:aa:XX:YY (SSID='XXXXXXXX' freq=2432 MHz)
wlan0: CTRL-EVENT-DISCONNECTED bssid=98:da:bb:aa:XX:YY reason=0
wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
wlan0: Trying to associate with 98:da:bb:aa:XX:YY (SSID='XXXXXXXX' freq=2432 MHz)
wlan0: CTRL-EVENT-DISCONNECTED bssid=98:da:bb:aa:XX:YY reason=0
wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
wlan0: Trying to associate with 98:da:bb:aa:XX:YY (SSID='XXXXXXXX' freq=2432 MHz)
wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
wlan0: CTRL-EVENT-DISCONNECTED bssid=98:da:bb:aa:XX:YY reason=0
wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
wlan0: Trying to associate with 98:da:bb:69:XX:YY (SSID='XXXXXXXX' freq=2432 MHz)
wlan0: CTRL-EVENT-DISCONNECTED bssid=98:da:bb:aa:XX:YY reason=0
wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="XXXXXXXX" auth_failures=1 duration=10 reason=CONN_FAILED
wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
wlan0: CTRL-EVENT-SSID-REENABLED id=0 ssid="XXXXXXXX"
wlan0: Trying to associate with 98:da:bb:aa:XX:YY (SSID='XXXXXXXX' freq=2432 MHz)
wlan0: CTRL-EVENT-DISCONNECTED bssid=98:da:bb:aa:XX:YY reason=0
wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="XXXXXXXX" auth_failures=2 duration=23 reason=CONN_FAILED
wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD

I really don't know what to try or how to continue... may anyone give me a clue? :-D

Any help will be really appreciated :-)

Merci!


BR,

d.

MrEngman
Posts: 4140
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Unable to connect WiFi with USB dongle RTL8192CU

Thu Feb 06, 2020 10:43 am

You are running a rather ancient version of Raspbian however that shouldn't be a problem.

I would suggest you set up your wifi config files like these:-

/etc/network/interfaces

Code: Select all

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

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

Code: Select all

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

network={
    ssid="Your-Network-Name"
    psk="Your-Network-Password"
}


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

dbip
Posts: 8
Joined: Sun Jan 15, 2017 5:49 pm
Location: Barcelona

Re: Unable to connect WiFi with USB dongle RTL8192CU

Thu Feb 06, 2020 3:10 pm

Dear MrEngman,

Thank you for your prompt reply.
MrEngman wrote:
Thu Feb 06, 2020 10:43 am
You are running a rather ancient version of Raspbian however that shouldn't be a problem.

I would suggest you set up your wifi config files like these:-

/etc/network/interfaces

Code: Select all

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

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

Code: Select all

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

network={
    ssid="Your-Network-Name"
    psk="Your-Network-Password"
}
Changing /etc/network/interface from static to manual and including the source-directory line doesn't seem to work, it even breaks my currently working wired connection on eth0.

Also, chaging /etc/wpa_supplicant/wpa_supplicant.conf to include the ctrl_interface and update_config lines doesn't work either, unfortunately.

Other ideas? :-)

Thanks a lot for your help!


BR,

d.

MrEngman
Posts: 4140
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Unable to connect WiFi with USB dongle RTL8192CU

Thu Feb 06, 2020 4:09 pm

OK, in file /etc/network/interfaces change the lines with manual in them to use dhcp instead.



MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

dbip
Posts: 8
Joined: Sun Jan 15, 2017 5:49 pm
Location: Barcelona

Re: Unable to connect WiFi with USB dongle RTL8192CU

Thu Feb 06, 2020 5:54 pm

Hi,
MrEngman wrote:
Thu Feb 06, 2020 4:09 pm
OK, in file /etc/network/interfaces change the lines with manual in them to use dhcp instead.

Just tried with a different dongle and the following files make the WiFi connection work, although the Belkin dongle still doesn't.

That makes me think the problem has nothing to do with the config files but likely with the drivers of the Belkin dongle.


/etc/network/interfaces

Code: Select all

source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet dhcp

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

/etc/wpa_supplicant/wpa_supplicant.conf

Code: Select all

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

network={
    ssid="aaaa"
    psk="bbbb"
}

Any idea?

Thanks!


BR,

d.

MrEngman
Posts: 4140
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Unable to connect WiFi with USB dongle RTL8192CU

Thu Feb 06, 2020 10:34 pm

I've just set up a Pi 2B with the same OS version you are using and I have a 8192cu wifi dongle, TP-Link TL-WN823N V1, working without problems.

I am using Raspbian Lite and made no changes except to update the password for Pi and set up SSH and wpa_supplicant.conf.

My wifi config is as I originally suggested except wpa_supplicant.conf includes the additional line country=GB and an additional network section to access my 5GB AP for wifi modules able to use 5GB. This is the standard format I use on all my different Pi. I made no changes to file /etc/network/interfaces and it is the default as installed.

Code: Select all

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux
pi@raspberrypi:~ $ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

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

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
pi@raspberrypi:~ $ sudo cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB

network={
        ssid="2.4GB-wifi"
        psk="2.4GB-password"
}

network={
        ssid="5GB-wifi"
        psk="5GB-password"
}
EDIT: if I plug in a network cable I also get a connection to my network using the wired ethernet.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

dbip
Posts: 8
Joined: Sun Jan 15, 2017 5:49 pm
Location: Barcelona

Re: Unable to connect WiFi with USB dongle RTL8192CU

Fri Feb 07, 2020 9:50 pm

Hi there,

Problem fixed by upgrading to Buster and commenting out the wpa line, all with static addresses.

Don't ask me why nor how...

Misteriously:
  • dhcp worked with the wpa line
  • static with wpa line makes wlan0 interface work although it doesn't show up when ifconfig, but I still can ssh to it from another PC :-?
Thank you for your help :-)


BR,

d.

Return to “Troubleshooting”