You are not logged in.

#1 2017-01-20 17:16:50

Hering
Member
Registered: 2016-05-26
Posts: 23

[Solved] WLAN-Stick not working

Hello,
I recently bought this CSL - 300 Mbit/s USB 2.0 WLAN Stick. Now when I plug it into my desktop running ArchLinux 4.8.13-1-ARCH and Plasma 5 I would expect it to appear in my Plasma-Networkmanager, unfortunately it doesn't..
So I checked "lsusb" getting:

Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 0bda:8172 Realtek Semiconductor Corp. RTL8191SU 802.11n WLAN Adapter
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 046d:c062 Logitech, Inc. M-UAS144 [LS1 Laser Mouse]
Bus 001 Device 003: ID 046d:c31c Logitech, Inc. Keyboard K120
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

More specific via the -v option for the WLAN Adapter:

Bus 003 Device 003: ID 0bda:8172 Realtek Semiconductor Corp. RTL8191SU 802.11n WLAN Adapter
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0bda Realtek Semiconductor Corp.
  idProduct          0x8172 RTL8191SU 802.11n WLAN Adapter
  bcdDevice            2.00
  iManufacturer           1 
  iProduct                2 
  iSerial                 3 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           46
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           4
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x0d  EP 13 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0

"ip link" returns:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 1c:1b:0d:93:61:b0 brd ff:ff:ff:ff:ff:ff
3: wlp4s0u2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DORMANT group default qlen 1000
    link/ether 24:05:0f:9a:5c:c3 brd ff:ff:ff:ff:ff:ff

Now when I try to change the state to up via "ip link set wlp4s0u2 up" nothing happens.. I don't get an error but when I check the status again it still says DOWN. Also scanning via "iw dev wlp4s0u2 scan" returns:                                                                                                                                                                                               

command failed: No such device (-19)

In my journal I see this reappearing again and again:

NetworkManager[500]: <info>  [1484931920.0226] device (wlp4s0u2): supplicant interface state: disabled -> inactive
NetworkManager[500]: <warn>  [1484931920.3287] device (wlp4s0u2): set-hw-addr: new MAC address 7E:03:2F:5E:56:26 not successfully set (scanning)

So after all this I thought maybe it just doesn't work with iw so I will try wireless_tools:

iwconfig wlp4s0u2                                                                                                                                                                                                       ~
wlp4s0u2  unassociated  Nickname:"rtl_wifi"
          Mode:Managed  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

Now when I scan via "iwlist wlp4s0u2 scan" I do see all the available networks but it won't let me connect to them. If I try nothing shows up except in journalctl:

NetworkManager[500]: <info>  [1484932270.5792] device (wlp4s0u2): supplicant interface state: disabled -> inactive
NetworkManager[500]: <warn>  [1484932270.8856] device (wlp4s0u2): set-hw-addr: new MAC address AE:9E:2D:1D:FF:C2 not successfully set (scanning)
NetworkManager[500]: <info>  [1484932272.3292] device (wlp4s0u2): supplicant interface state: inactive -> disabled

Does anyone have an idea how to make it work?
If you miss any information please ask, I might have just forgotten.

P.s.: I did try it under Windows and there it works so it is no hardware defect.

Last edited by Hering (2017-01-21 17:27:43)

Offline

#2 2017-01-20 17:28:28

positronik
Member
Registered: 2016-02-08
Posts: 94

Re: [Solved] WLAN-Stick not working

Try to unplug, plug again and see what dmesg says.
To my untrained eyes, it seems that no driver is in use for it so maybe this is what you are missing.

Offline

#3 2017-01-20 17:31:13

Hering
Member
Registered: 2016-05-26
Posts: 23

Re: [Solved] WLAN-Stick not working

When I unplug and plug in again I get this:

[  +0.497156] usb 3-2: new high-speed USB device number 5 using xhci_hcd
[  +0.135297] r8712u: register rtl8712_netdev_ops to netdev_ops
[  +0.000006] usb 3-2: r8712u: USB_SPEED_HIGH with 4 endpoints
[  +0.000754] usb 3-2: r8712u: Boot from EFUSE: Autoload OK
[  +0.727205] usb 3-2: r8712u: CustomerID = 0x000a
[  +0.000005] usb 3-2: r8712u: MAC Address from efuse = 24:05:0f:9a:5c:c3
[  +0.000004] usb 3-2: r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"
[  +0.042806] r8712u 3-2:1.0 wlp4s0u2: renamed from wlan0
[  +0.056386] IPv6: ADDRCONF(NETDEV_UP): wlp4s0u2: link is not ready
[  +0.743996] r8712u 3-2:1.0 wlp4s0u2: 1 RCR=0x153f00e
[  +0.001114] r8712u 3-2:1.0 wlp4s0u2: 2 RCR=0x553f00e
[  +1.445666] IPv6: ADDRCONF(NETDEV_UP): wlp4s0u2: link is not ready
[  +1.746515] IPv6: ADDRCONF(NETDEV_UP): wlp4s0u2: link is not ready
[  +0.071491] IPv6: ADDRCONF(NETDEV_UP): wlp4s0u2: link is not ready

Offline

#4 2017-01-20 17:40:57

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: [Solved] WLAN-Stick not working

Hering wrote:

Now when I try to change the state to up via "ip link set wlp4s0u2 up" nothing happens.. I don't get an error but when I check the status again it still says DOWN.

This is incorrect.  It was up the whole time.  See the wiki here for an explanation.

Also, there is most certainly a driver in use, otherwise the device wouldn't be listed in ip a output at all, and you certainly wouldn't be able to activate it (as you have).

It is very hard to troubleshoot wireless issues when there are high level services trying to manage the connection.  In fact, trying to connect while some other wireless service is running is the most common source of problems (by a substantial margin I'd wager).

If you want to see if the device is working, stop/disable all networking services, and connect manually following the wiki starting from the link I provided above.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2017-01-20 18:44:51

Hering
Member
Registered: 2016-05-26
Posts: 23

Re: [Solved] WLAN-Stick not working

@Trilby: Oh yes my fault I looked at the wrong value. I disabled the NetworkManager as well as the ethernet device so only the WLAN one was active.
Then I followed the wiki but when I try to scan with "iw dev wlp4s0u2 scan" all I get is "command failed: No such device (-19)" so I am not even able to try connecting to an AP.
In the logs (dmesg and journalctl) I don't see any difference at all, the same errors/warnings still happen.
I tried using iwconfig again where I am able to scan for APs but not able to connect..


P.s.: Thats what I did in detail do disable everything:

systemctl stop NetworkManager
systemctl stop bluetooth.service
systemctl stop org.cups.service //Dont need it anyway right now
ip link set enp0s31f6 down

I also unplugged every device not needed..

Offline

#6 2017-01-20 19:00:10

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: [Solved] WLAN-Stick not working

Thanks - despite it not being related to other services, that is an important first thing to rule out.

I've not used iw in quite a long time. If others can't help interpret that error, I'd be interested in how wpa_supplicant does as scanning (via wpa_cli).


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2017-01-20 19:06:30

Hering
Member
Registered: 2016-05-26
Posts: 23

Re: [Solved] WLAN-Stick not working

Hmm I tried wpa_supplicant as in the wiki here but I get this:

wpa_supplicant -B -i wlp4s0u2 -c /etc/wpa_supplicant/example.conf                                                                                                                                                  ~
Successfully initialized wpa_supplicant
nl80211: Driver does not support authentication/association or connect commands
nl80211: deinit ifname=wlp4s0u2 disabled_11b_rates=0
wlp4s0u2: Failed to initialize driver interface

Offline

#8 2017-01-20 19:08:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: [Solved] WLAN-Stick not working

One of many reasons I prefer wpa_supplicant: it's error messages are more informative smile

Does wext work?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2017-01-20 19:17:44

Hering
Member
Registered: 2016-05-26
Posts: 23

Re: [Solved] WLAN-Stick not working

Well it does display me this:

wpa_supplicant -B -i wlp4s0u2 -D wext -c /etc/wpa_supplicant/example.conf                                                                                                                                                       ~
Successfully initialized wpa_supplicant
rfkill: Cannot get wiphy information
wpa_cli                                                                                                                                                                                                                     ~
wpa_cli v2.6
Copyright (c) 2004-2016, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.
See README for more details.


Selected interface 'wlp4s0u2'

Interactive mode

> scan
OK
> scan results
OK
<3>CTRL-EVENT-SCAN-RESULTS 
<3>WPS-AP-AVAILABLE 
<3>CTRL-EVENT-NETWORK-NOT-FOUND 
> add_network
0
> set_network 0 ssid "<MySSID>"
OK
> set_network 0 psk "<MyWPAKey>"
OK
> enable network 0
OK
> save_config
OK
<3>CTRL-EVENT-SCAN-RESULTS 
<3>WPS-AP-AVAILABLE 
<3>Trying to associate with b0:48:7a:99:bd:3e (SSID='<MySSID>' freq=2457 MHz)
<3>Association request to the driver failed
<3>CTRL-EVENT-DISCONNECTED bssid=b0:48:7a:99:bd:3e reason=3 locally_generated=1

dhcpd times out as well then.

Last edited by Hering (2017-01-20 19:18:25)

Offline

#10 2017-01-20 19:52:04

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: [Solved] WLAN-Stick not working

Note, the second command should be "scan_results" not "scan results".


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#11 2017-01-20 20:32:22

Hering
Member
Registered: 2016-05-26
Posts: 23

Re: [Solved] WLAN-Stick not working

Uups true that.
But when using "scan_results" it doesn't find anything:

> scan
OK
> scan_results
bssid / frequency / signal level / flags / ssid
<3>CTRL-EVENT-SCAN-RESULTS 
<3>WPS-AP-AVAILABLE 
<3>CTRL-EVENT-NETWORK-NOT-FOUND 
> 

Last edited by Hering (2017-01-20 20:34:17)

Offline

#12 2017-01-20 20:56:00

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: [Solved] WLAN-Stick not working

Hmm, that's not what I was expecting.  Perhaps the driver in use is a problem.  While it allows you to put the interface up/down and dow some of the basics, it's not actually able to scan.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#13 2017-01-20 21:09:31

Hering
Member
Registered: 2016-05-26
Posts: 23

Re: [Solved] WLAN-Stick not working

What I tried now is creating the config with:

echo "ctrl_interface=/run/wpa_supplicant\nupdate_config=1" > /etc/wpa_supplicant/myWLAN.conf
wpa_passphrase "<MySSID>" "<MyKey>" > /etc/wpa_supplicant/myWLAN.conf

then

wpa_supplicant -i wlp4s0u2 -Dwext -c /etc/wpa_supplicant/myWLAN.conf

then I started the wpa_gui and when I do a scan there it does display all networks and displays my WLAN stick but when I click on connect it just says "Status: Unknown"

Offline

#14 2017-01-21 00:14:21

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: [Solved] WLAN-Stick not working

Was that an 'echo -e'?  Otherwise the newline wouldn't be interpreted.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#15 2017-01-21 12:07:57

Hering
Member
Registered: 2016-05-26
Posts: 23

Re: [Solved] WLAN-Stick not working

Yes of course, I checked the file with cat as well to make sure it worked.

I tried using the debug option on wpa_supplicant and for me it shows some things which might be the reasons but I got no idea how to fix them..

wpa_supplicant -D wext -i wlp4s0u2 -d -c /etc/wpa_supplicant/wlan_home.conf     
                                                                                                                                                ~
wpa_supplicant v2.6
Successfully initialized wpa_supplicant
Initializing interface 'wlp4s0u2' conf '/etc/wpa_supplicant/wlan_home.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'
Configuration file '/etc/wpa_supplicant/wlan_home.conf' -> '/etc/wpa_supplicant/wlan_home.conf'
Reading configuration file '/etc/wpa_supplicant/wlan_home.conf'
ctrl_interface='/run/wpa_supplicant'
update_config=1
Priority group 0
   id=0 ssid='<MySSID>'
rfkill: Cannot get wiphy information
WEXT: RFKILL status not available
SIOCGIWRANGE: WE(compiled)=22 WE(source)=16 enc_capa=0xf
  capabilities: key_mgmt 0xf enc 0x1f flags 0x0
WEXT: Driver: r8712u
netlink: Operstate: ifindex=3 linkmode=1 (userspace-control), operstate=5 (IF_OPER_DORMANT)
Add interface wlp4s0u2 to a new radio N/A
wlp4s0u2: Own MAC address: 24:05:0f:9a:5c:c3
wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=4 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=5 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_countermeasures
wlp4s0u2: RSN: flushing PMKID list in the driver
wlp4s0u2: Setting scan request: 0.100000 sec
---------->TDLS: TDLS operation not supported by driver<----------
---------->TDLS: Driver uses internal link setup<----------
---------->TDLS: Driver does not support TDLS channel switching<----------
wlp4s0u2: WPS: UUID based on MAC address: 1713b9d7-0c4c-5c64-b12c-960523dc7085
ENGINE: Loading dynamic engine
ENGINE: Loading dynamic engine
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: Supplicant port status: Unauthorized
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
wlp4s0u2: Added interface wlp4s0u2
wlp4s0u2: State: DISCONNECTED -> DISCONNECTED
wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)
netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=5 (IF_OPER_DORMANT)
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlp4s0u2' added

From reading in the internet it does seem to work as plug&play under Raspberry and Ubuntu as well. So I am gonna try that later and if it works I will copy the driver from there...
There is also a linux driver available from CSL for this device but it won't compile because of some outdated C functions in it (daemonize etc)


Edit:
I think I actually got it to work somehow... Not sure why but what I did is the following:
First I added the network manually like this:

ctrl_interface=/run/wpa_supplicant
update_config=1
eapol_version=1
fast_reauth=1
ap_scan=1
ctrl_interface_group=wheel
network={
        ssid="<MySSID>"
        scan_ssid=1
        proto=RSN WPA
        key_mgmt=WPA-PSK
        pairwise=CCMP TKIP
        group=CCMP TKIP
        psk="<MyKey>"
}

Then I started

wpa_supplicant -D wext -i wlp4s0u2 -d -c /etc/wpa_supplicant/wlan_home.conf

followed by using the wpa_cli

wpa_cli v2.6
Copyright (c) 2004-2016, Jouni Malinen <j@w1.fi> and contributors
This software may be distributed under the terms of the BSD license.
See README for more details.
Interactive mode
> scan
FAIL-BUSY
> scan
FAIL-BUSY
> scan
FAIL-BUSY
> scan
FAIL-BUSY
> scan
FAIL-BUSY
> scan
OK
<3>WPA: Group rekeying completed with b0:48:7a:99:bd:3e [GTK=CCMP]
<3>WPA: Group rekeying completed with b0:48:7a:99:bd:3e [GTK=CCMP]
> scan_results
bssid / frequency / signal level / flags / ssid
[... My local networks were displayed here ...]
<3>CTRL-EVENT-SCAN-RESULTS 
> add_network
1
<3>WPA: Group rekeying completed with b0:48:7a:99:bd:3e [GTK=CCMP]
> set_network 1 ssid "<MySSID>"
OK
> set_network 1 psk "<MyKey>"
OK
<3>WPA: Group rekeying completed with b0:48:7a:99:bd:3e [GTK=CCMP]
> enable_network 1
OK

and when I tried to use dhcpcd wlp4s0u2 I got

DUID 00:01:00:01:20:16:54:d4:24:05:0f:9a:5c:c3
wlp4s0u2: IAID 0f:9a:5c:c3
wlp4s0u2: adding address fe80::fcc0:29cf:eb58:9070
wlp4s0u2: soliciting a DHCP lease
wlp4s0u2: soliciting an IPv6 router
wlp4s0u2: offered 192.168.0.102 from 192.168.0.1
wlp4s0u2: probing address 192.168.0.102/24
wlp4s0u2: leased 192.168.0.102 for 7200 seconds
wlp4s0u2: adding route to 192.168.0.0/24
wlp4s0u2: adding default route via 192.168.0.1
forked to background, child pid 5555

And it seems to work as I am writing this right now using WLAN only. The only sad thing is that the NetworkManager does not display it but the Plasma-Widget does.

Thank you a lot for your help @Trilby

Edit:Edit: I was also able to make it run with netctl but still no NetworkManager

Edit:Edit:Edit: It works now! I disabled/reverted everything I did before and added this:

[device]
wifi.scan-rand-mac-address=no

to my /etc/NetworkManager/NetworkManager.conf and restarted and everything works smooth now.

Last edited by Hering (2017-01-22 00:25:05)

Offline

Board footer

Powered by FluxBB