LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   USB Wifi Adapter - openSUSE Leap 42.3 (https://www.linuxquestions.org/questions/linux-newbie-8/usb-wifi-adapter-opensuse-leap-42-3-a-4175614402/)

Metronome 09-23-2017 10:31 PM

USB Wifi Adapter - openSUSE Leap 42.3
 
Hello, I am completely new to Linux. I recenlty installed openSUSE Leap 42.3 in a dual-boot configuration with Windows 10.

I was able to update most of the drivers (video, audio, etc.), but I can't get my USB Wifi Adapter to work.

I'm using ANEWKODI USB 600Mbps Dual Band Wifi Adapater. I've been browsing around some forums and have gotten this far:

I ran the following command, then unplugged the USB adapter and plugged back in:
Code:

linux:~ # sudo journalctl -f
-- Logs begin at Mon 2017-09-04 11:06:21 PDT. --
Sep 23 20:09:19 linux kernel: usb 1-9: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Sep 23 20:09:19 linux kernel: usb 1-9: Product: 802.11ac WLAN Adapter
Sep 23 20:09:19 linux kernel: usb 1-9: Manufacturer: Realtek
Sep 23 20:09:19 linux kernel: usb 1-9: SerialNumber: 00e04c000001
Sep 23 20:09:19 linux mtp-probe[4202]: checking bus 1, device 6: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-9"
Sep 23 20:09:19 linux mtp-probe[4202]: bus: 1, device: 6 was not an MTP device
Sep 23 20:10:03 linux sudo[4198]: pam_unix(sudo:session): session closed for user root
Sep 23 20:10:12 linux sudo[4217]:    root : TTY=pts/0 ; PWD=/root ; USER=root ; COMMAND=/usr/bin/journalctl -f
Sep 23 20:10:12 linux sudo[4217]: pam_unix(sudo:session): session opened for user root by Metronome(uid=0)
Sep 23 20:10:12 linux sudo[4217]: pam_systemd(sudo:session): Cannot create session: Already running in a session
Sep 23 20:10:27 linux kernel: usb 1-9: USB disconnect, device number 6
Sep 23 20:10:32 linux kernel: usb 1-9: new high-speed USB device number 7 using xhci_hcd
Sep 23 20:10:32 linux mtp-probe[4222]: checking bus 1, device 7: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-9"
Sep 23 20:10:32 linux mtp-probe[4222]: bus: 1, device: 7 was not an MTP device
Sep 23 20:10:32 linux kernel: usb 1-9: New USB device found, idVendor=0bda, idProduct=a811
Sep 23 20:10:32 linux kernel: usb 1-9: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Sep 23 20:10:32 linux kernel: usb 1-9: Product: 802.11ac WLAN Adapter
Sep 23 20:10:32 linux kernel: usb 1-9: Manufacturer: Realtek
Sep 23 20:10:32 linux kernel: usb 1-9: SerialNumber: 00e04c000001


I also ran the following commands after to check how the system recognizes the adapter:
Code:

linux:~ # ifconfig
eth0      Link encap:Ethernet  HWaddr 9C:5C:8E:86:BD:E8 
          inet addr:192.168.0.104  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::9e5c:8eff:fe86:bde8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:43657 errors:0 dropped:0 overruns:0 frame:0
          TX packets:39821 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:29206333 (27.8 Mb)  TX bytes:6404872 (6.1 Mb)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

linux:~ # hwinfo --short
cpu:                                                           
                      Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz, 800 MHz
                      Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz, 800 MHz
                      Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz, 800 MHz
                      Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz, 800 MHz
keyboard:
  /dev/input/event5    Logitech Keyboard K120
mouse:
  /dev/input/mice      Logitech M105 Optical Mouse
monitor:
                      Generic Monitor
graphics card:
                      nVidia GP106 [GeForce GTX 1060 6GB]
sound:
                      Intel Sunrise Point-H HD Audio
                      nVidia GP106 High Definition Audio Controller
                      Logitech Headset H390
storage:
                      Intel Sunrise Point-H SATA controller [AHCI mode]
network:
  eth0                Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
network interface:
  lo                  Loopback network interface
  eth0                Ethernet network interface
disk:
  /dev/sda            Samsung SSD 850
  /dev/sdb            WDC WD10EADS-00M
  /dev/sdc            Crucial_CT250MX2
partition:
  /dev/sda1            Partition
  /dev/sda2            Partition
  /dev/sda3            Partition
  /dev/sda5            Partition
  /dev/sda6            Partition
  /dev/sda7            Partition
  /dev/sdb1            Partition
  /dev/sdb2            Partition
  /dev/sdc1            Partition
usb controller:
                      Intel Sunrise Point-H USB 3.0 xHCI Controller
bios:
                      BIOS
bridge:
                      Intel Skylake Host Bridge/DRAM Registers
                      Intel Skylake PCIe Controller (x16)
                      Intel Sunrise Point-H PCI Root Port #17
                      Intel Sunrise Point-H PCI Express Root Port #1
                      Intel Sunrise Point-H PCI Express Root Port #3
                      Intel Sunrise Point-H PCI Express Root Port #4
                      Intel Sunrise Point-H PCI Express Root Port #9
                      Intel Sunrise Point-H LPC Controller
                      ASMedia ASM1083/1085 PCIe to PCI Bridge
hub:
                      Linux Foundation 2.0 root hub
                      Linux Foundation 3.0 root hub
memory:
                      Main Memory
unknown:
                      FPU
                      DMA controller
                      PIC
                      Keyboard controller
                      PS/2 Controller
                      Intel Sunrise Point-H CSME HECI #1
                      Intel Sunrise Point-H PMC
                      Intel Sunrise Point-H SMBus
  /dev/ttyS0          16550A
  /dev/input/event4    Logitech Headset H390
                      Realtek 802.11ac WLAN Adapter
  /dev/input/event6    Logitech Keyboard K120

Lastly, I also downloaded this driver:
https://github.com/sloretz/rtl8811au

and followed the README to install, but it didn't seem to change anything.

Not sure what to do next. Help?

colorpurple21859 09-24-2017 02:11 PM

It being a realtek device I would suspect that your missing realtek firmware for it.

petelq 09-24-2017 04:27 PM

Quote:

Originally Posted by Metronome (Post 5762181)
Lastly, I also downloaded this driver:
https://github.com/sloretz/rtl8811au

and followed the README to install, but it didn't seem to change anything.

Not sure what to do next. Help?

Although it "didn't change anything", was the install completed or did you get error messages?

Have you run modprobe?

Metronome 09-24-2017 05:44 PM

I don't recall seeing any error after running make install. I don't know if running it again has any effect if it's already installed, but I just tried this:

Code:

linux:/home/Metronome/Downloads/rtl8811au-master # make -j 8
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.4.79-19-default/build M=/home/Metronome/Downloads/rtl8811au-master  modules
make[1]: Entering directory '/usr/src/linux-4.4.79-19-obj/x86_64/default'
  Building modules, stage 2.
  MODPOST 1 modules
make[1]: Leaving directory '/usr/src/linux-4.4.79-19-obj/x86_64/default'
linux:/home/Metronome/Downloads/rtl8811au-master # make install
install -p -m 644 8821au.ko  /lib/modules/4.4.79-19-default/kernel/drivers/net/wireless/
/sbin/depmod -a 4.4.79-19-default

I'm unfamiliar with modprobe. What should I be looking for?

colorpurple21859 09-24-2017 07:33 PM

modprobe loads a driver/module into the kernel that isn't already loaded. The following will load your 8821au module.
Code:

modprobe 8821au
it maybe
Code:

modprobe rtl8821au

ferrari 09-24-2017 09:00 PM

In an effort to assist, I built the 8821au module (via source from github page you linked to), and checked it against the chipset details reported by the journal log
Code:

idVendor=0bda, idProduct=a811
Here's the complete list of chipsets it supports...
Code:

alias:          usb:v0E66p0023d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3318d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3314d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v04BBp0953d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pA811d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp0823d*dc*dsc*dp*icFFiscFFipFFin*
alias:          usb:v0BDAp0820d*dc*dsc*dp*icFFiscFFipFFin*
alias:          usb:v0BDAp8822d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp0821d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp0811d*dc*dsc*dp*ic*isc*ip*in*

I note the vendor ID reported does NOT match yours....
Code:

# modinfo 8821au|grep 811
alias:          usb:v7392pA811d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp0811d*dc*dsc*dp*ic*isc*ip*in*


ferrari 09-24-2017 09:54 PM

Provided the driver is compatible (and loaded),you may get lucky with adding the required chipset details like this (as root)...
Code:

echo '0bda a811' > /sys/bus/usb/drivers/rtl8821au/new_id
Even if this works, and results in a wireless device node being present, it's only temporary measure and will need to be invoked again on next boot.

Metronome 09-25-2017 11:54 PM

So I tried colorpurple21859 solution and it successfully loaded 8821au, but the device is still listed as unknown under hwinfo and no entry exists for ifconfig.

I tried ferrari's solution running echo '0bda...' and the entire system crashed. Perhaps I have the wrong driver after all? I guess I'll have to do more digging to find the right one.

And it just occurred to me to ask - how will I know for certain when the firmware is updated? Cause I'm assuming I'll still have to configure the network connection, so there has to be another way to confirm the firmware is up to date. Will the wireless adapter show up under lspci?

ferrari 09-26-2017 02:27 AM

Quote:

I tried ferrari's solution running echo '0bda...' and the entire system crashed. Perhaps I have the wrong driver after all? I guess I'll have to do more digging to find the right one.
Yes, the fact that the chipset was not explicitly listed in the modinfo output is not a good sign. You may need to contact the vendor about this.

Quote:

And it just occurred to me to ask - how will I know for certain when the firmware is updated? Cause I'm assuming I'll still have to configure the network connection, so there has to be another way to confirm the firmware is up to date.
The firmware is built-in to the vendor-supplied Realtek driver.

Quote:

Will the wireless adapter show up under lspci?
For USB devices use
Code:

lsusb
or
Code:

usb-devices

ferrari 09-26-2017 02:44 AM

Ok, a bit more searching and I've found the required driver for your chipset (0BDA:A811)...

Code:

git clone https://github.com/scrivy/rtl8812AU_8821AU_linux.git
Code:

cd rtl8812AU_8821AU_linux
Code:

make
Code:

sudo make install
Plug in your USB wireless device and the 'rtl8812au' module should load automatically.

The chipset is listed...
Code:

# modinfo rtl8812au|grep A811
alias:          usb:v0BDApA811d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDApA811d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pA811d*dc*dsc*dp*ic*isc*ip*in*


colorpurple21859 09-26-2017 05:17 AM

to see if the kernel is trying to load firmware
Code:

dmesg |grep firmware

Metronome 09-26-2017 10:30 PM

So I followed your instructions. The make install command worked (which I assume means the driver was installed). dmesg |grep firmware doesn't return anything, but I did get this:

Code:

linux:/home/Metronome # dmesg |grep wlan
[  11.524791] RTL871X: rtw_ndev_init(wlan0)
[  186.697560] RTL871X: rtw_ndev_uninit(wlan0)
[  191.077538] RTL871X: rtw_ndev_init(wlan0)

and I got this when unplugging the USB and plugging back in:

Code:

-- Logs begin at Mon 2017-09-04 11:06:21 PDT. --
Sep 26 20:23:01 linux dbus[1088]: [system] Successfully activated service 'org.freedesktop.PackageKit'
Sep 26 20:23:01 linux systemd[1]: Started PackageKit Daemon.
Sep 26 20:23:13 linux su[3015]: (to root) Metronome on pts/0
Sep 26 20:23:13 linux su[3015]: pam_unix(su:session): session opened for user root by Metronome(uid=1000)
Sep 26 20:23:13 linux su[3015]: pam_systemd(su:session): Cannot create session: Already running in a session
Sep 26 20:23:22 linux PackageKit[2965]: daemon quit
Sep 26 20:23:22 linux packagekitd[2965]: (packagekitd:2965): GLib-CRITICAL **: Source ID 15 was not found when attempting to remove it
Sep 26 20:23:42 linux kernel: fuse init (API version 7.23)
Sep 26 20:23:42 linux systemd[1]: Mounting FUSE Control File System...
Sep 26 20:23:42 linux systemd[1]: Mounted FUSE Control File System.
Sep 26 20:25:33 linux kernel: usb 1-9: USB disconnect, device number 4
Sep 26 20:25:33 linux kernel: RTL871X: rtw_ndev_uninit(wlan0)
Sep 26 20:25:33 linux systemd[1]: Starting Load/Save RF Kill Switch Status...
Sep 26 20:25:33 linux systemd[1]: Started Load/Save RF Kill Switch Status.
Sep 26 20:25:37 linux kernel: usb 1-9: new high-speed USB device number 6 using xhci_hcd
Sep 26 20:25:37 linux kernel: usb 1-9: New USB device found, idVendor=0bda, idProduct=a811
Sep 26 20:25:37 linux kernel: usb 1-9: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Sep 26 20:25:37 linux kernel: usb 1-9: Product: 802.11ac WLAN Adapter
Sep 26 20:25:37 linux kernel: usb 1-9: Manufacturer: Realtek
Sep 26 20:25:37 linux kernel: usb 1-9: SerialNumber: 00e04c000001
Sep 26 20:25:37 linux mtp-probe[3237]: checking bus 1, device 6: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-9"
Sep 26 20:25:37 linux mtp-probe[3237]: bus: 1, device: 6 was not an MTP device
Sep 26 20:25:37 linux kernel: RTL871X: rtw_ndev_init(wlan0)

So that's new. Still only getting eth0 and lo when running ifconfig (no wlan0).

Metronome 09-26-2017 11:03 PM

Good news! After some searching I found (and tried) this:

Code:

linux:/home/Metronome # depmod -a
linux:/home/Metronome # lsmod |grep rtl
rtl8812au            1454080  0
cfg80211              614400  1 rtl8812au
usbcore              270336  6 snd_usb_audio,snd_usbmidi_lib,usbhid,xhci_hcd,xhci_pci,rtl8812au
linux:/home/Metronome # iwconfig
lo        no wireless extensions.

wlan0    unassociated  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency=2.412 GHz  Access Point: Not-Associated 
          Sensitivity:0/0 
          Retry:off  RTS thr:off  Fragment thr:off
          Encryption key: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.

Now I'm able to bring up my wlan0 in YaST and scan my network. Our wifi SSID (as well as others) show up so the USB adapter must be working. Still haven't figured out how to connect it, but I think I'm most of the way now. Will follow up once I actually have a usable wifi connection.

Metronome 09-26-2017 11:43 PM

I did it! So after I got the drivers installed, I accidentally entered the wrong password for our wifi and took some time figuring that out. Once I did, I got connected to the wifi and got it to retrieve an IP address, but it still wouldn't connect to the internet.

After some searching I learned that I had to force my network config to route through wlan0. I did this with the following commands:

[CODE]
linux:/home/Metronome # ifconfig eth0 down
linux:/home/Metronome # route add default gw 192.168.0.1 wlan0
[\CODE]

(192.168.9.1 is our router and my default gateway)

Thank you so much everyone (esp ferrari) for your help and patience. Here's a quick recap of what I had to do to get this working (as best I can remember):

Code:

su
git clone https://github.com/scrivy/rtl8812AU_8821AU_linux.git
cd rtl8812AU_8821AU_linux
make
sudo make install
modprobe rtl8821au
depmod -a
ifconfig eth0 down
route add default gw 192.168.0.1 wlan0

Couple of notes:
- I had to install packages for several commands throughout (make, depmod, git, and I think modprobe). To do this, just type "cnf" and the command you need (such as "cnf git") and your terminal will give you instructions on how to install the package
- You have to have a wired internet connection for some of this to work - namely downloading your drivers. If you don't have one, I assume you'll have to download to a different computer and transfer via USB
- after depmod -a I used YaST to connect my wlan0 interface to our wifi. To do this:
---open YaST
---select Network Settings
---select your wlan0 interface, then Edit
---Set to DHCP, then Next
---Set to Managed, select "Scan Network", select your wifi network from the dropdown, and set your password (mine used WPA-PSK encryption), select Next
Once you've done all this, go back to terminal and proceed with the ifconfig command (see above)

Hope this helps the next person with this problem. Thanks again everyone!

Sauerland 09-27-2017 12:25 AM

That Module is also included in the Package rtl8812AU_8821AU-kmp-default build by a User in the openSUSE Build Service (OBS):
https://build.opensuse.org/package/s...l8812AU_8821AU

That is an easier way to install it and it will be also updated, when a new kernel is build.

Only 2 Repos to include.


All times are GMT -5. The time now is 04:43 PM.