7

Hy there, I am having problem in connecting my raspberry pi to a wifi dongle. I have followed a lot of tutorials from internet but no success so far.

My WIFI dongle can scan the networks but it's not connecting to any network.Here is what my configuration file looks like

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


network={
    ssid="noname"
    #psk="zong4gisbest"
    psk=ead5b0b7e82e1a68f01e9a17a2a7719ec24575c89bb5b5805e4ae49c80daa983 }

Here are the results of my commands on Raspbian

iwconfig

wlan0     unassociated  Nickname:"<WIFI@REALTEK>"
          Mode:Auto  Frequency=2.412 GHz  Access Point: Not-Associated
          Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

eth0      no wireless extensions.

lo        no wireless extensions.

lsusb

Bus 001 Device 004: ID 0bda:0179 Realtek Semiconductor Corp. RTL8188ETV 
Wireless LAN 802.11n Network Adapter
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514   
Fast Ethernet Adapter 
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub   
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Can you please help me resolving the issue?

thanks

GAD3R
  • 66,769
  • 1
    realtek will not provide a reliable connection. https://unix.stackexchange.com/questions/252210/wi-fi-problems-using-asus-usb-n13-adapter/252215 – Rui F Ribeiro Oct 24 '17 at 12:27

2 Answers2

12

Edit your wpa_supplicant.conf , change the following lines:

network={
    ssid "noname"
    psk"zong4gisbest"

to:

network={
    ssid="noname"
    #psk="zong4gisbest"
    psk=ead5b0b7e82e1a68f01e9a17a2a7719ec24575c89bb5b5805e4ae49c80daa983
}

save then run

wpa_supplicant -iwlan0 -D wext -c/etc/wpa_supplicant/wpa_supplicant.conf -B
dhclient wlan0

The error:

nl80211: Driver does not support authentication/association or connect commands

mean that the standard nl80211 doesn't support your device , you should use the old driver wext.

To correctly set up your wpa_supplicant.conf , it is better to use the wpa_passphrase command:

wpa_passphrase YOUR-SSID YOUR-PASSWORD >> /etc/wpa_supplicant/wpa_supplicant.conf

To automatically connect to your AP after restart edit the wlan0 interface on your /etc/network/interfaces as follow:

allow-hotplug wlan0
iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
GAD3R
  • 66,769
  • Tried using wpa_passphrase YOUR-SSID YOUR-PASSWORD >> /etc/wpa_supplicant/wpa_supplicant.conf

    But here is the error https://imgur.com/a/TudGH

    – Usama Saeed Oct 24 '17 at 10:27
  • after saving, when i tried>>wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf -B

    I see this error now https://imgur.com/a/wrDrh

    – Usama Saeed Oct 24 '17 at 10:30
  • @JazibHassan Please edit your question with the output of lsusb , a text output is better than an image. – GAD3R Oct 24 '17 at 10:33
  • @JazibHassan use wext driver , see my update – GAD3R Oct 24 '17 at 10:38
  • 1
    What's wext? I am sorry, i am kinda new here! – Usama Saeed Oct 24 '17 at 10:41
  • i have update my answer , what is the output of lsmod | grep r8188 ? – GAD3R Oct 24 '17 at 11:30
  • here is the output:

    r8188eu 425544 0 cfg80211 525806 1 r8188eu

    – Usama Saeed Oct 24 '17 at 12:26
  • 1
    Hey bro, it just worked. I thought, you asked me to use two different commands 1>>wpa_supplicant -iwlan0 -D wext -c/etc/wpa_supplicant/wpa_supplicant.conf -B 2>>dhclient wlan0

    I didn't know that it's a single command. Now it worked great. I am doing ssh using wifi now. thanks bro

    – Usama Saeed Oct 24 '17 at 12:30
  • 1
    However each time i restart the pi, i have to do that command to enable wifi. is there any hack which can do the job? thanks again – Usama Saeed Oct 24 '17 at 12:42
  • I tried adding this code before . After i rebooted, the raspberrypi was not responding. I had to reinstall the OS. Shall i give it a try again? – Usama Saeed Oct 24 '17 at 14:24
  • see Execute script on start-up create a script which contain the wpa_supplicant and the dhclient command – GAD3R Oct 24 '17 at 14:32
  • @JazibHassan It is better to ask a new question to connect with wpa_supplicant at boot , you will get some good suggestions – GAD3R Oct 25 '17 at 06:51
  • nl80211: Driver does not support authentication/association or connect commands => you should use the old driver wext: does it mean, that I cannot use AP mode CONFIG_AP=y and thus need to use hostapd? – pevik Apr 30 '20 at 16:59
  • @pevik You need to check if your wifi device support the AP mode through sudo iw list |grep -A15 'Supported interface modes' , You should see AP listed , if not you can't use the wifi device as hotspot AP. – GAD3R Apr 30 '20 at 17:09
0

simple:

sudo wget https://github.com/lwfinger/rtl8188eu/raw/c83976d1dfb4793893158461430261562b3a5bf0/rtl8188eufw.bin  -O /lib/firmware/rtlwifi/rtl8188eufw.bin

and replug, see

https://github.com/raspberrypi/linux/issues/764#issuecomment-73355704

droid192
  • 138