Ubuntu – Slow speed on Hotspot created from Ubuntu 16.04 with RTL8723BE Wireless Network Adapter

16.04hot-spotkernelrtl8723bewireless

History

I ran into a weird problem yesterday(on 13 Jan 2018). My Ubuntu was not able to get strong signals of Wifi. I once encountered this problem before and was able to fix it using this post. The solution was to make a config file as follows –

sudo tee /etc/modprobe.d/rtl8723be.conf <<< "options rtl8723be ant_sel=1"

But this time it was not working. I found this article and was able to resolve the "weak Wifi signal" issue successfully. It asked to download drivers from this repo and install it using

sudo make install

Followed by executing these commands and then making a config file to make the setting permanent

sudo modprobe -rv rtl8723be
sudo modprobe -v rtl8723be ant_sel=2
sudo ip link set wlp13s0 up
echo "options rtl8723be ant_sel=2" | sudo tee /etc/modprobe.d/50-rtl8723be.conf

The Problem

But soon I discovered that the hotspot I used to enjoy created from my laptop was giving terrible speed(of only around 0.5Mbps). The speed I get on my LAN is around 80Mbps. I switched to Windows and found that the Hotspot created there gives Wifi speed of around 30 Mbps. I would also like to add that I am using Speedtest by Ookla and the Ping in each speedtest is normal(in range of 8 to 10), which I used to get before. So there is no change in ping. I tried searching for this issue but was not able to find anything related. Your help will be appreciated.

Related Information

My wireless driver is rtl8723be

Output of iwconfig

enp2s0    no wireless extensions.

lo        no wireless extensions.

wlo1      IEEE 802.11  Mode:Master  Tx-Power=20 dBm   
          Retry short limit:7   RTS thr=2347 B   Fragment thr:off
          Power Management:on

Output of ifconfig

enp2s0    Link encap:Ethernet  HWaddr a0:8c:fd:4d:1b:0d  
          inet addr:172.25.30.203  Bcast:172.25.30.255  Mask:255.255.255.0
          inet6 addr: fe80::90b5:2747:93a9:f969/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:39347 errors:0 dropped:0 overruns:0 frame:0
          TX packets:22188 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:9004186 (9.0 MB)  TX bytes:14741038 (14.7 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:1608 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1608 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:141049 (141.0 KB)  TX bytes:141049 (141.0 KB)

wlo1      Link encap:Ethernet  HWaddr 74:df:bf:8b:11:17  
          inet addr:10.42.0.1  Bcast:10.42.0.255  Mask:255.255.255.0
          inet6 addr: fe80::76df:bfff:fe8b:1117/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12069 errors:0 dropped:1 overruns:0 frame:0
          TX packets:8846 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:13285506 (13.2 MB)  TX bytes:2959250 (2.9 MB)

Output of lspci | grep Wireless

03:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter

Output of route

Here 10.42.0.47 is my device connected to the hotspot.

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         172.25.30.1     0.0.0.0         UG    100    0        0 enp2s0
10.42.0.0       *               255.255.255.0   U     600    0        0 wlo1
link-local      *               255.255.0.0     U     1000   0        0 enp2s0
172.25.30.0     *               255.255.255.0   U     100    0        0 enp2s0

Recent Software Update Log

I think there is a high probability that the problem is due to auto-update of some software. I am sure that this problem started between 8-11 Jan and it was definitely discovered on 13 Jan.
EDIT #1- I see that the kernel was updated to v4.13 on 11 Jan. I suspect that the problem occurred because of this update.
EDIT #2- I tried reverting back to previous kernel (v4.10) through grub and followed this post which explains what to do when kernel is upgraded(or perhaps even downgraded). It didn't work.

Start-Date: 2018-01-05  10:31:01
Commandline: /usr/bin/unattended-upgrade
Upgrade: ruby2.3:amd64 (2.3.1-2~16.04.2, 2.3.1-2~16.04.4), apport:amd64 
(2.20.1-0ubuntu2.14, 2.20.1-0ubuntu2.15), libruby2.3:amd64 (2.3.1-2~16.04.2, 
2.3.1-2~16.04.4), python3-apport:amd64 (2.20.1-0ubuntu2.14, 2.20.1-0ubuntu2.15), 
libwebkit2gtk-4.0-37:amd64 (2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1), 
apport-gtk:amd64 (2.20.1-0ubuntu2.14, 2.20.1-0ubuntu2.15), gir1.2-webkit2-4.0:amd64 
(2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1), libjavascriptcoregtk-4.0-18:amd64 
(2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1), python3-problem-report:amd64 
(2.20.1-0ubuntu2.14, 2.20.1-0ubuntu2.15), libwebkit2gtk-4.0-37-gtk2:amd64 
(2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1), gir1.2-javascriptcoregtk-4.0:amd64 
(2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1)
Error: Sub-process /usr/bin/dpkg returned an error code (2)
End-Date: 2018-01-05  10:31:01

Start-Date: 2018-01-07  08:51:55
Commandline: /usr/bin/unattended-upgrade
Upgrade: ruby2.3:amd64 (2.3.1-2~16.04.2, 2.3.1-2~16.04.4), apport:amd64 
(2.20.1-0ubuntu2.14, 2.20.1-0ubuntu2.15), libruby2.3:amd64 (2.3.1-2~16.04.2, 
2.3.1-2~16.04.4), python3-apport:amd64 (2.20.1-0ubuntu2.14, 2.20.1-0ubuntu2.15), 
libwebkit2gtk-4.0-37:amd64 (2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1), 
apport-gtk:amd64 (2.20.1-0ubuntu2.14, 2.20.1-0ubuntu2.15), gir1.2-webkit2-4.0:amd64 
(2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1), libjavascriptcoregtk-4.0-18:amd64 
(2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1), python3-problem-report:amd64 
(2.20.1-0ubuntu2.14, 2.20.1-0ubuntu2.15), libwebkit2gtk-4.0-37-gtk2:amd64 
(2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1), gir1.2-javascriptcoregtk-4.0:amd64 
(2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1)
Error: Sub-process /usr/bin/dpkg returned an error code (2)
End-Date: 2018-01-07  08:51:55

Start-Date: 2018-01-08  16:34:54
Commandline: /usr/bin/unattended-upgrade
Upgrade: ruby2.3:amd64 (2.3.1-2~16.04.2, 2.3.1-2~16.04.4), apport:amd64 
(2.20.1-0ubuntu2.14, 2.20.1-0ubuntu2.15), libruby2.3:amd64 (2.3.1-2~16.04.2, 
2.3.1-2~16.04.4), python3-apport:amd64 (2.20.1-0ubuntu2.14, 2.20.1-0ubuntu2.15), 
libwebkit2gtk-4.0-37:amd64 (2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1), 
apport-gtk:amd64 (2.20.1-0ubuntu2.14, 2.20.1-0ubuntu2.15), gir1.2-webkit2-4.0:amd64 
(2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1), libjavascriptcoregtk-4.0-18:amd64 
(2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1), python3-problem-report:amd64 
(2.20.1-0ubuntu2.14, 2.20.1-0ubuntu2.15), libwebkit2gtk-4.0-37-gtk2:amd64 
(2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1), gir1.2-javascriptcoregtk-4.0:amd64 
(2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1)
Error: Sub-process /usr/bin/dpkg returned an error code (2)
End-Date: 2018-01-08  16:34:54

Start-Date: 2018-01-09  16:32:45
Commandline: /usr/bin/unattended-upgrade
Upgrade: ruby2.3:amd64 (2.3.1-2~16.04.2, 2.3.1-2~16.04.4), apport:amd64 
(2.20.1-0ubuntu2.14, 2.20.1-0ubuntu2.15), libruby2.3:amd64 (2.3.1-2~16.04.2, 
2.3.1-2~16.04.4), python3-apport:amd64 (2.20.1-0ubuntu2.14, 2.20.1-0ubuntu2.15), 
libwebkit2gtk-4.0-37:amd64 (2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1), 
apport-gtk:amd64 (2.20.1-0ubuntu2.14, 2.20.1-0ubuntu2.15), gir1.2-webkit2-4.0:amd64 
(2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1), libjavascriptcoregtk-4.0-18:amd64 
(2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1), python3-problem-report:amd64 
(2.20.1-0ubuntu2.14, 2.20.1-0ubuntu2.15), libwebkit2gtk-4.0-37-gtk2:amd64 
(2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1), gir1.2-javascriptcoregtk-4.0:amd64 
(2.18.3-0ubuntu0.16.04.1, 2.18.4-0ubuntu0.16.04.1)
End-Date: 2018-01-09  16:34:23

Start-Date: 2018-01-10  16:55:32
Commandline: /usr/bin/unattended-upgrade
Upgrade: poppler-utils:amd64 (0.41.0-0ubuntu1.5, 0.41.0-0ubuntu1.6), linux-libc-dev:amd64 
(4.4.0-104.127, 4.4.0-108.131), firefox-locale-en:amd64 (57.0.3+build1-0ubuntu0.16.04.1, 
57.0.4+build1-0ubuntu0.16.04.1), firefox:amd64 (57.0.3+build1-0ubuntu0.16.04.1, 
57.0.4+build1-0ubuntu0.16.04.1), libpoppler-glib8:amd64 (0.41.0-0ubuntu1.5, 
0.41.0-0ubuntu1.6), libpoppler58:amd64 (0.41.0-0ubuntu1.5, 0.41.0-0ubuntu1.6)
End-Date: 2018-01-10  16:56:08

=====================================================================
Start-Date: 2018-01-11  14:39:00
Commandline: /usr/bin/unattended-upgrade
Install: linux-image-4.13.0-26-generic:amd64 (4.13.0-26.29~16.04.2, automatic), 
linux-headers-4.13.0-26:amd64 (4.13.0-26.29~16.04.2, automatic), 
linux-signed-image-4.13.0-26-generic:amd64 (4.13.0-26.29~16.04.2, automatic), 
linux-image-extra-4.13.0-26-generic:amd64 (4.13.0-26.29~16.04.2, automatic), 
linux-headers-4.13.0-26-generic:amd64 (4.13.0-26.29~16.04.2, automatic)
Upgrade: linux-libc-dev:amd64 (4.4.0-108.131, 4.4.0-109.132), ruby2.3:amd64 
(2.3.1-2~16.04.4, 2.3.1-2~16.04.5), linux-image-generic-hwe-16.04:amd64 (4.10.0.42.44, 
4.13.0.26.46), linux-signed-generic-hwe-16.04:amd64 (4.10.0.42.44, 4.13.0.26.46), 
linux-generic-hwe-16.04:amd64 (4.10.0.42.44, 4.13.0.26.46), 
linux-signed-image-generic-hwe-16.04:amd64 (4.10.0.42.44, 4.13.0.26.46), libruby2.3:amd64 
(2.3.1-2~16.04.4, 2.3.1-2~16.04.5), linux-headers-generic-hwe-16.04:amd64 (4.10.0.42.44, 
4.13.0.26.46)
End-Date: 2018-01-11  14:42:54
=====================================================================

Start-Date: 2018-01-13  15:57:28
Commandline: apt upgrade
Requested-By: rohan (1000)
Install: libllvm5.0:amd64 (1:5.0-3~16.04.1, automatic), libdrm-common:amd64 
(2.4.83-1~16.04.1, automatic)
Upgrade: suru-icon-theme:amd64 (14.04+16.04.20161024-0ubuntu1, 
14.04+16.04.20171116-0ubuntu1), libgles2-mesa:amd64 (17.0.7-0ubuntu0.16.04.2, 
17.2.4-0ubuntu1~16.04.2), libseccomp2:amd64 (2.2.3-3ubuntu3, 2.3.1-2.1ubuntu2~16.04.1), 
intel-microcode:amd64 (3.20170707.1~ubuntu16.04.0, 3.20180108.0~ubuntu16.04.2), 
libdrm-nouveau2:amd64 (2.4.76-1~ubuntu16.04.1, 2.4.83-1~16.04.1), libgweather-3-6:amd64 
(3.18.2-0ubuntu0.1, 3.18.2-0ubuntu0.2), grub-common:amd64 (2.02~beta2-36ubuntu3.14, 
2.02~beta2-36ubuntu3.15), libglapi-mesa:amd64 (17.0.7-0ubuntu0.16.04.2, 
17.2.4-0ubuntu1~16.04.2), snapd:amd64 (2.28.5, 2.29.4.2), squashfs-tools:amd64 
(1:4.3-3ubuntu2, 1:4.3-3ubuntu2.16.04.1), google-chrome-stable:amd64 (63.0.3239.108-1, 
63.0.3239.132-1), libxatracker2:amd64 (17.0.7-0ubuntu0.16.04.2, 17.2.4-0ubuntu1~16.04.2), 
grub2-common:amd64 (2.02~beta2-36ubuntu3.14, 2.02~beta2-36ubuntu3.15), libegl1-mesa:amd64 
(17.0.7-0ubuntu0.16.04.2, 17.2.4-0ubuntu1~16.04.2), initramfs-tools-bin:amd64 
(0.122ubuntu8.9, 0.122ubuntu8.10), libgbm1:amd64 (17.0.7-0ubuntu0.16.04.2, 
17.2.4-0ubuntu1~16.04.2), adapta-gtk-theme:amd64 (3.92.2.57-0ubuntu1~xenial1, 
3.93.0.38-0ubuntu1~xenial1), libdrm-amdgpu1:amd64 (2.4.76-1~ubuntu16.04.1, 
2.4.83-1~16.04.1), grub-efi-amd64-bin:amd64 (2.02~beta2-36ubuntu3.14, 
2.02~beta2-36ubuntu3.15), libwayland-egl1-mesa:amd64 (17.0.7-0ubuntu0.16.04.2, 
17.2.4-0ubuntu1~16.04.2), ubuntu-core-launcher:amd64 (2.28.5, 2.29.4.2), libdrm2:amd64 
(2.4.76-1~ubuntu16.04.1, 2.4.83-1~16.04.1), libwebkit2gtk-4.0-37:amd64 
(2.18.4-0ubuntu0.16.04.1, 2.18.5-0ubuntu0.16.04.1), ubuntu-mobile-icons:amd64 
(14.04+16.04.20161024-0ubuntu1, 14.04+16.04.20171116-0ubuntu1), libgl1-mesa-dri:amd64 
(17.0.7-0ubuntu0.16.04.2, 17.2.4-0ubuntu1~16.04.2), grub-efi-amd64:amd64 
(2.02~beta2-36ubuntu3.14, 2.02~beta2-36ubuntu3.15), xserver-xorg-core-hwe-16.04:amd64 
(2:1.19.3-1ubuntu1~16.04.4, 2:1.19.5-0ubuntu2~16.04.1), light-themes:amd64 
(14.04+16.04.20161024-0ubuntu1, 14.04+16.04.20171116-0ubuntu1), ubuntu-artwork:amd64 
(1:14.04+16.04.20161024-0ubuntu1, 1:14.04+16.04.20171116-0ubuntu1), libgl1-mesa-glx:amd64 
(17.0.7-0ubuntu0.16.04.2, 17.2.4-0ubuntu1~16.04.2), grub-efi-amd64-signed:amd64 
(1.66.14+2.02~beta2-36ubuntu3.14, 1.66.15+2.02~beta2-36ubuntu3.15), 
gir1.2-webkit2-4.0:amd64 (2.18.4-0ubuntu0.16.04.1, 2.18.5-0ubuntu0.16.04.1), 
unattended-upgrades:amd64 (0.90ubuntu0.8, 0.90ubuntu0.9), libdrm-intel1:amd64 
(2.4.76-1~ubuntu16.04.1, 2.4.83-1~16.04.1), libdrm-radeon1:amd64 (2.4.76-1~ubuntu16.04.1, 
2.4.83-1~16.04.1), xserver-xorg-legacy-hwe-16.04:amd64 (2:1.19.3-1ubuntu1~16.04.4, 
2:1.19.5-0ubuntu2~16.04.1), mesa-vdpau-drivers:amd64 (17.0.7-0ubuntu0.16.04.2, 
17.2.4-0ubuntu1~16.04.2), libjavascriptcoregtk-4.0-18:amd64 (2.18.4-0ubuntu0.16.04.1, 
2.18.5-0ubuntu0.16.04.1), ubuntu-mono:amd64 (14.04+16.04.20161024-0ubuntu1, 
14.04+16.04.20171116-0ubuntu1), libgweather-common:amd64 (3.18.2-0ubuntu0.1, 
3.18.2-0ubuntu0.2), initramfs-tools-core:amd64 (0.122ubuntu8.9, 0.122ubuntu8.10), 
initramfs-tools:amd64 (0.122ubuntu8.9, 0.122ubuntu8.10), libwebkit2gtk-4.0-37-gtk2:amd64 
(2.18.4-0ubuntu0.16.04.1, 2.18.5-0ubuntu0.16.04.1), gir1.2-javascriptcoregtk-4.0:amd64 
(2.18.4-0ubuntu0.16.04.1, 2.18.5-0ubuntu0.16.04.1)
End-Date: 2018-01-13  16:00:19

Start-Date: 2018-01-13  18:09:45
Commandline: apt install papirus-icon-theme
Requested-By: rohan (1000)
Install: libreoffice-style-papirus:amd64 (20170914-44+pkg3~ubuntu16.04.1, automatic), 
papirus-icon-theme:amd64 (20180113-2047+pkg17~ubuntu16.04.1)
End-Date: 2018-01-13  18:10:12

Start-Date: 2018-01-13  18:14:39
Commandline: apt-get install arc-theme
Requested-By: rohan (1000)
Install: gnome-themes-standard:amd64 (3.18.0-2ubuntu1, automatic), 
gnome-themes-standard-data:amd64 (3.18.0-2ubuntu1, automatic), arc-theme:amd64 
(1488477732.766ae1a-0)
End-Date: 2018-01-13  18:14:43

Start-Date: 2018-01-13  21:22:41
Commandline: apt autoremove
Requested-By: rohan (1000)
Remove: linux-image-4.10.0-40-generic:amd64 (4.10.0-40.44~16.04.1), 
linux-signed-image-4.10.0-40-generic:amd64 (4.10.0-40.44~16.04.1), libllvm4.0:amd64 
(1:4.0-1ubuntu1~16.04.2), linux-image-extra-4.10.0-40-generic:amd64 
(4.10.0-40.44~16.04.1), linux-headers-4.10.0-40:amd64 (4.10.0-40.44~16.04.1), 
linux-headers-4.10.0-40-generic:amd64 (4.10.0-40.44~16.04.1)
End-Date: 2018-01-13  21:24:20

Best Answer

I think that wifi power management is responsible for the slow speeds, it can be disabled with

echo "options rtl8723be ips=0" | sudo tee -a /etc/modprobe.d/50-rtl8723be.conf
sudo sed -i 's/wifi.powersave = 3/wifi.powersave = 2/' /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
Reboot

Related Question