Welcome! Log In Create A New Profile

Advanced

rtl8xxxu on debian kirkwood

Posted by Nilas 
rtl8xxxu on debian kirkwood
October 26, 2020 07:14AM
Hi everyone,

Let me start by saying that I appreciate the Debian Kirkwood kernel&rootfs package a lot and find it very helpful.
So here's the thing, I'm running the NSA325 successfully in my home network but the wife didn't like my cable clutter and made me move the NSA325 to another room that doesn't have ethernet.
I had a USB wifi stick lying around that I am using right now, it's the TPlink WN821Nv4 which is based on the RTL8192CU chipset. I use the rtl8192cu driver built into the kernel which runs okayish but not quite perfect. I googled a lot and read that the rtl8xxxu driver might work better, but it's not built in the kernel package (it's seems to be available for the Oxnas package though). So I wonder if anyone has ever played with this driver on a kirkwood machine and could point me to compile instructions. Alternatively, would it be possible to include this driver in the next kernel release for kirkwood?

Thanks so much in advance
Nilas
Re: rtl8xxxu on debian kirkwood
October 26, 2020 09:37AM
I have an Oxnas setup but this may be of interest, not sure it would work on your machine though:)

https://forum.doozan.com/read.php?2,92749,109609#msg-109609

Hope it points you in the right direction!

Echowarrior108

device: pogoplug-pro v3

Currently running:
Debian GNU/Linux Bullseye 12-9-22
Linux 5.4.224-oxnas-tld-1 armv6l GNU/Linux 11-27-22
Re: rtl8xxxu on debian kirkwood
October 26, 2020 01:37PM
I've had good luck with both the rtl8812au and rtl8821cu chipsets on kirkwood. Both chipsets support AC and are 433mbps which is about all the USB bus capacity. Some of the 8821cu devices have coexisting Bluetooth radios so they makes a nice single solution device for wifi and BT. I usually compile using githubs for Raspberry Pi 3, google searching will bring up some of the most popular ones.

The source for the rtl8812au I use is: rtl8812au source on github
And for rtl8821cu, I use: rtl8821cu source on github



Edited 2 time(s). Last edit at 10/26/2020 06:46PM by LeggoMyEggo.
Re: rtl8xxxu on debian kirkwood
October 26, 2020 04:34PM
Nilas,

> Alternatively, would it be possible to include
> this driver in the next kernel release for
> kirkwood?

Definitely.

I'm testing the new kernel (5.9.1+ for release), so I could see if I can inlcude rtl8xxxu in the config.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: rtl8xxxu on debian kirkwood
November 17, 2020 12:56PM
Thank you guys for your suggestions. It's been a while but I wanted to report back as I think I've found a solution to my problem. I couldn't find a repository of the rtl8xxxu driver that would compile right away but I found a modified 8192cu driver that lists my device as compatible. This driver improved my wifi speed but the connection would always hang after a couple of minutes. I played with the energy savings parameters but nothing was effective. After further testing I found that the wifi adapter would become pretty hot and google revealed some reports of overheating issues. I removed the plastic case and positioned the adapter in front of the NSA325's fan but it didn't improve much. Then, inspired by this repository, I modified the above 8192cu driver to decrease the txpower by a fixed offset (if I understand things correctly the value I used should reduce by ~50%). And this finally seems to be stable now (without compromising speed in my setup). What a hassle...
Re: rtl8xxxu on debian kirkwood
November 17, 2020 03:48PM
Nilas,

I forgot to put this info in the release notes :)

I've configured the rtl8xxxu dirver into the new kernel linux-5.9.3-kirkwood-tld-1-bodhi.tar.bz2.

You can give it a try to see if it is stable, then you don't need to run any extra binary.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: rtl8xxxu on debian kirkwood
November 15, 2021 02:40AM
Hi bodhi,
when I plug in my usb wifi adapter (Belkin F7D2102 N300) I see this error:

[ 7419.504422][ T1233] usb 1-1: New USB device found, idVendor=050d, idProduct=2103, bcdDevice= 2.00
[ 7419.513412][ T1233] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 7419.521328][ T1233] usb 1-1: Product: Belkin Wireless Adapter
[ 7419.527650][ T1233] usb 1-1: Manufacturer: Realtek
[ 7419.532769][ T1233] usb 1-1: SerialNumber: 00e04c000001
[ 7419.548291][ T1233] rtl8192cu: Chip version 0x11
[ 7419.674592][ T1233] rtl8192cu: Board Type 0
[ 7419.679159][ T1233] rtl_usb: rx_max_size 15360, rx_urb_num 8, in_ep 1
[ 7419.686195][ T1233] rtl8192cu: Loading firmware rtlwifi/rtl8192cufw_TMSC.bin
[ 7419.709511][ T1233] usb 1-1: Direct firmware load for rtlwifi/rtl8192cufw_TMSC.bin failed with error -2
[ 7419.722495][ T1233] usb 1-1: Direct firmware load for rtlwifi/rtl8192cufw.bin failed with error -2
[ 7419.731523][ T1233] rtlwifi: Loading alternative firmware rtlwifi/rtl8192cufw.bin
[ 7419.762449][ T1233] rtlwifi: Selected firmware is not available
[ 7419.775281][ T1365] rtl8192cu 1-1:1.0 wlx08863b87584a: renamed from wlan0

I have a Negear Stora NAS with a "fresh" system: Kirkwood 5.14.9 package with nothing else installed but usbutils.

# lsmod | grep rtl
rtl8192cu              77824  0
rtl8192c_common        57344  1 rtl8192cu
rtl_usb                20480  1 rtl8192cu
rtlwifi               106496  3 rtl_usb,rtl8192c_common,rtl8192cu
mac80211              786432  3 rtl_usb,rtlwifi,rtl8192cu
cfg80211              741376  2 mac80211,rtlwifi
rfkill                 28672  2 rtlwifi,cfg80211

# lsusb
Bus 001 Device 002: ID 050d:2103 Belkin Components F7D2102 802.11n N300 Micro Wireless Adapter v3000 [Realtek RTL8192CU]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Any suggestion?
Re: rtl8xxxu on debian kirkwood
November 15, 2021 03:51AM
imianz,

Have you tried to install firmware-realtek? In recent Debian versions, firrmware must be installed explicitly, it is no longer part of the kernel.

apt-get install firmware-realtek

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: rtl8xxxu on debian kirkwood
November 16, 2021 04:31AM
Bodhi, I fell from the clouds...
Thank you very much!!

I added these repositories to /etc/apt/sources.list to get "firmware-realtek" package
deb http://deb.debian.org/debian bullseye main contrib non-free
deb-src http://deb.debian.org/debian bullseye main contrib non-free

# apt update
# apt-cache search RTL8192CU
firmware-realtek - Binary firmware for Realtek wired/wifi/BT adapters

# apt install firmware-realtek
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  firmware-realtek
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 921 kB of archives.
After this operation, 2988 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/non-free armel firmware-realtek all 20210315-3 [921 kB]
Fetched 921 kB in 1s (1218 kB/s)
Selecting previously unselected package firmware-realtek.
(Reading database ... 16578 files and directories currently installed.)
Preparing to unpack .../firmware-realtek_20210315-3_all.deb ...
Unpacking firmware-realtek (20210315-3) ...
Setting up firmware-realtek (20210315-3) ...
Processing triggers for initramfs-tools (0.140) ...
update-initramfs: Generating /boot/initrd.img-5.14.9-kirkwood-tld-1
I: The initramfs will attempt to resume from /dev/sdb2
I: (UUID=590ff41d-ac23-478d-afeb-93a8c93eef96)
I: Set the RESUME variable to override this.


# mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-5.14.9-kirkwood-tld-1 -d vmlinuz-5.14.9-kirkwood-tld-1 uImage
# mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-5.14.9-kirkwood-tld-1 -d initrd.img-5.14.9-kirkwood-tld-1 uInitrd

I have plugged out and then plugged in the wifi adapter:
[94593.798626][ T2466] usb 1-1: USB disconnect, device number 2
[94610.265359][ T4926] usb 1-1: new high-speed USB device number 3 using orion-ehci
[94610.467423][ T4926] usb 1-1: New USB device found, idVendor=050d, idProduct=2103, bcdDevice= 2.00
[94610.476409][ T4926] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[94610.484323][ T4926] usb 1-1: Product: Belkin Wireless Adapter
[94610.490643][ T4926] usb 1-1: Manufacturer: Realtek
[94610.495752][ T4926] usb 1-1: SerialNumber: 00e04c000001
[94610.511544][ T4926] rtl8192cu: Chip version 0x11
[94610.637218][ T4926] rtl8192cu: Board Type 0
[94610.641786][ T4926] rtl_usb: rx_max_size 15360, rx_urb_num 8, in_ep 1
[94610.648818][ T4926] rtl8192cu: Loading firmware rtlwifi/rtl8192cufw_TMSC.bin
[94610.750745][ T4928] rtl8192cu 1-1:1.0 wlx08863b87584a: renamed from wlan0


I have added these lines in /etc/network/interfaces
auto wlx08863b87584a
iface wlx08863b87584a inet dhcp
wpa-ssid mySSID
wpa-psk MyPass


boot log:
[   13.604977][   T17] usb 1-1: new high-speed USB device number 2 using orion-ehci
[   13.806972][   T17] usb 1-1: New USB device found, idVendor=050d, idProduct=2103, bcdDevice= 2.00
[   13.815954][   T17] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   13.823863][   T17] usb 1-1: Product: Belkin Wireless Adapter
[   13.829676][   T17] usb 1-1: Manufacturer: Realtek
[   13.834499][   T17] usb 1-1: SerialNumber: 00e04c000001

Start the service
# ifup wlx08863b87584a
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

[ 2107.984087][ T1345] rtl8192cu: MAC auto ON okay!
[ 2108.022615][ T1345] rtl8192cu: Tx queue select: 0x05
Listening on LPF/wlx08863b87584a/08:86:3b:87:58:4a
Sending on   LPF/wlx08863b87584a/08:86:3b:87:58:4a
Sending on   Socket/fallback
DHCPDISCOVER on wlx08863b87584a to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on wlx08863b87584a to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on wlx08863b87584a to 255.255.255.255 port 67 interval 9
DHCPDISCOVER on wlx08863b87584a to 255.255.255.255 port 67 interval 11
DHCPDISCOVER on wlx08863b87584a to 255.255.255.255 port 67 interval 11
DHCPDISCOVER on wlx08863b87584a to 255.255.255.255 port 67 interval 13
DHCPDISCOVER on wlx08863b87584a to 255.255.255.255 port 67 interval 6
No DHCPOFFERS received.
No working leases in persistent database - sleeping.


But I don't have an internet connection. I forgot something?
Note: I have enabled "mac address filtering" on my router.



Edited 2 time(s). Last edit at 11/16/2021 04:33AM by imianz.
Re: rtl8xxxu on debian kirkwood
November 16, 2021 12:23PM
Is the ssid hidden? Need to add something to interfaces if it is. Also, does 'iwlist scan' work? Did you install wpa_supplicant?



Edited 3 time(s). Last edit at 11/16/2021 12:26PM by LeggoMyEggo.
Re: rtl8xxxu on debian kirkwood
November 16, 2021 01:17PM
HI @LeggoMyEggo, thank you for your responce!

>Is the ssid hidden? Yes
>does 'iwlist scan' work? Not installed
>Did you install wpa_supplicant? No
Re: rtl8xxxu on debian kirkwood
November 16, 2021 02:31PM
You need 'wireless-tools' and 'wpa_supplicant'. Add 'scan-ssid=1' to interfaces.
Re: rtl8xxxu on debian kirkwood
November 16, 2021 03:24PM
Aslo, while testing a new NIC like this, just let the SSID public, and turn MAC addr filtering off. After it's working, reenable them again.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: rtl8xxxu on debian kirkwood
November 18, 2021 02:14AM
Hi,
I spent a few hours learning wpasupplicant and finally decided to try using the "interface" file for configuration instead of wpa_supplicant.conf. Here's what i did.

Get tools
# apt install wpasupplicant wireless-tools


On my router i set the SSID as visible but left "MAC address filtering" active


check if my wifi-dongle can see the available networks:
# iwlist scan
lo        Interface doesn't support scanning.

eth0      Interface doesn't support scanning.

wlx08863b87584a  Scan completed :
          Cell 01 - Address: XX:XX:XX:XX:XX:XX       <- my router
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=70/70  Signal level=-23 dBm
                    Encryption key:on
                    ESSID:"mySSDI"
			...
          Cell 02 - Address: YY:YY:YY:YY:YY:YY
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=36/70  Signal level=-74 dBm
                    Encryption key:on
                    ESSID:"TIM-87654321"
			...
          Cell 0X - ...
ok, it does!


I create a crypted key:
# wpa_passphrase mySSDI
# reading passphrase from stdin
<myKey>
network={
        ssid="mySSDI"
        #psk="myKey"
        psk=myCryptedKey
}

add params to the "interfaces" file
# nano /etc/network/interfaces
...
auto wlx08863b87584a
iface wlx08863b87584a inet dhcp
wpa-scan-ssid 1
wpa-ssid mySSID
wpa-psk myCryptedKey

reload wifi adapter
# ifdown wlx08863b87584a
# ifup wlx08863b87584a
[ 4470.363085][ T1423] rtl8192cu: MAC auto ON okay!
[ 4470.401121][ T1423] rtl8192cu: Tx queue select: 0x05
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlx08863b87584a/08:86:3b:87:58:4a
Sending on   LPF/wlx08863b87584a/08:86:3b:87:58:4a
Sending on   Socket/fallback
DHCPDISCOVER on wlx08863b87584a to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on wlx08863b87584a to 255.255.255.255 port 67 interval 7
DHCPOFFER of 192.168.1.10 from 192.168.1.1
DHCPREQUEST for 192.168.1.10 on wlx08863b87584a to 255.255.255.255 port 67
DHCPACK of 192.168.1.10 from 192.168.1.1
bound to 192.168.1.10 -- renewal in 42341 seconds.

log:
[ 4472.391410][ T1424] wlx08863b87584a: authenticate with <Router_MAC_ADDRESS>
[ 4472.423968][ T1424] wlx08863b87584a: send auth to <Router_MAC_ADDRESS> (try 1/3)
[ 4472.433188][ T1358] wlx08863b87584a: authenticated
[ 4472.447212][ T1358] wlx08863b87584a: associate with <Router_MAC_ADDRESS> (try 1/3)
[ 4472.476788][ T1358] wlx08863b87584a: RX AssocResp from <Router_MAC_ADDRESS> (capab=0x431 status=0 aid=1)
[ 4472.490163][ T1358] wlx08863b87584a: associated
[ 4472.778404][ T1424] IPv6: ADDRCONF(NETDEV_CHANGE): wlx08863b87584a: link becomes ready

Test connection
# ping -c3 www.google.com
PING www.google.com (216.58.206.68) 56(84) bytes of data.
64 bytes from mil07s08-in-f4.1e100.net (216.58.206.68): icmp_seq=1 ttl=113 time=39.2 ms
64 bytes from mil07s08-in-f4.1e100.net (216.58.206.68): icmp_seq=2 ttl=113 time=54.1 ms
64 bytes from mil07s08-in-f4.1e100.net (216.58.206.68): icmp_seq=3 ttl=113 time=77.5 ms

--- www.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 39.195/56.940/77.547/15.787 ms

It works!!!
Thank you very much :-)



Edited 1 time(s). Last edit at 11/18/2021 02:16AM by imianz.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: