Score:0

WIFI usb adapter slow only on Linux

ru flag

I recently installed Xubuntu 20.04 in a refurbished machine with 8GB of RAM, I3 CPU and a IDE Hard drive of 250 GB and plugged it into the TV.

I am facing two issues which I think they might be related:

  1. I need to shutdown because if I reboot, then the wifi adapter does never connect to the modem. It simply spins for like 60 seconds and then a pop up message says "I am not connected to the network".
  2. The maximum download speed I get on this machine is 2Mb/s, while my connection at home is 15. I can get 5Mb/s when I use boot into windows instead of Linux. Obviously If I am downloading something or watching youtube any other page I want to open takes centuries to load so I am only able to do one thing at the time.

I see several questions with similar issues but they are for older Ubuntu version and those fixes did nothing for me.

Can someone advice how to overcome this issue in Xubuntu 20.04?

Information:

matias@telee:~$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
    link/ether 80:c1:6e:f4:15:a5 brd ff:ff:ff:ff:ff:ff
    altname enp0s25
3: wlxd03745ebc655: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether d0:37:45:eb:c6:55 brd ff:ff:ff:ff:ff:ff

matias@telee:~$ lsusb
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 006: ID 2357:0109 TP-Link TL WN823N RTL8192EU
Bus 001 Device 005: ID 0c45:64ab Microdia 
Bus 001 Device 004: ID 248a:8367 Maxxter 
Bus 001 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

matias@telee:~$ lsmod | grep rt
rtl8xxxu              135168  0
mac80211             1024000  1 rtl8xxxu
cfg80211              888832  2 mac80211,rtl8xxxu
btrtl                  24576  1 btusb
bluetooth             638976  41 btrtl,btintel,btbcm,bnep,btusb,rfcomm
parport_pc             45056  0
parport                65536  3 parport_pc,lp,ppdev
ChanganAuto avatar
us flag
Please edit the question and add the WiFi device (chipset). Use `lspci` or `lsusb` accordingly to detect it. And if dual/booting with Windows then disabling its Fast Startup feature is a must.
guiverc avatar
cn flag
You didn't say if you're using the GA or HWE kernel. I've found on older boxes it's often helpful to use the older kernel choice; ie. 5.4 for Ubuntu 20.04 LTS. Have you tried the GA kernel option? (LTS releases have two paths selected by media used for installation for *flavors* like Xubuntu)
waltinator avatar
it flag
Look at the logs! `sudo journalctl -b 0 -u NetworkManager`. Read `man journalctl`.
Matias Barrios avatar
ru flag
I have added more information to my question
Score:1
it flag

Check your WiFi MTU, using

ip link

also notice your WiFi interface's name.

The MTU (Maximum Transmission Unit) is the size of the largest packet that can be sent in ar single network transmission. If a packet exceeds the MTU of a link, the data must be split into multiple packets (fragmented). These multiple packets must be sent over the link, received, acknowledged, and reassembled at the far end. If your link is misconfigured, and you have to fragment every packet you send, your actual data transfer rate drops.

Ethernet (wired) networks use an MTU of 1500 bytes.

Due to additional per packet overhead for WiFi (8 bytes PPPoE header), WiFi uses an MTU of 1492.

Your MTU should be set by your DHCP server, check your router's config.

You can set your own MTU (setting does not persist over restarts) with

sudo ip link set dev name mtu 1492

where "name" is the interface name from above.

Here's an example:

walt@squid:~(0)$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp63s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:24:21:7f:e5:1c brd ff:ff:ff:ff:ff:ff
3: wlxf46d04b1790f: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000
    link/ether f4:6d:04:b1:79:0f brd ff:ff:ff:ff:ff:ff
walt@squid:~(0)$   sudo ip link set dev wlxf46d04b1790f mtu 1492
[sudo] password for walt: 
walt@squid:~(0)$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp63s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:24:21:7f:e5:1c brd ff:ff:ff:ff:ff:ff
3: wlxf46d04b1790f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1492 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether f4:6d:04:b1:79:0f brd ff:ff:ff:ff:ff:ff

My WiFi "interface name" is "wlxf46d04b1790f".

Matias Barrios avatar
ru flag
I can see that my interface has already set a MTU of 1500. Should I set it to 1492?
waltinator avatar
it flag
Carefully read my answer. It explains why you should set your MTU to 1492 for WiFi.
Matias Barrios avatar
ru flag
oh sorry I misread your answer. I will try now
Score:0
cn flag

I am running Ubuntu 22.10 with a TL-WN821N USB dongle and was lucky to get 2 MB/s. The common element with your issue is the rtl8xxxu driver showed up for me as well.

I noticed other devices on my desk getting normal speeds and I plugged the dongle into a windows machine and it ran faster.

I did more googling and found this, which 100% solved my issue,

https://github.com/Mange/rtl8192eu-linux-driver

After following the instructions and building the new driver I get 50 MB/s.

sudo apt-get install git linux-headers-generic build-essential dkms
git clone https://github.com/Mange/rtl8192eu-linux-driver
cd rtl8192eu-linux-driver
sudo dkms add .
sudo dkms install rtl8192eu/1.0
echo "blacklist rtl8xxxu" | sudo tee /etc/modprobe.d/rtl8xxxu.conf
echo -e "8192eu\n\nloop" | sudo tee /etc/modules
echo "options 8192eu rtw_power_mgnt=0 rtw_enusbss=0" | sudo tee /etc/modprobe.d/8192eu.conf
sudo update-grub; sudo update-initramfs -u
systemctl reboot -i

At that point you run this,

sudo lshw -c network

You should see this, most importantly it is not rtl8xxxu,

driver=rtl8192eu

Here is a similar example,

Ubuntu 22.04.1 LTS(Jammy Jellyfish) Installing Wifi Driver

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.