RTL8723BE weak signal strength with 4.4.0 or rtlwifi_new #88

Closed
damocles-git opened this Issue Jan 14, 2016 · 77 comments

Comments

Projects
None yet

Hello,

I bought a new laptop with this wireless card thinking it was well supported but unfortunately it has a very weak signal strength, the only way to get near 100% is "touching" the AP with the laptop. As far as I go away from it, even one meter, the signal drops to 50% and if I walk a few meters the signal is so weak that it drops the connection.

Almost all reports I could read from the net suffer similar symtomps, specially with heavy transfers ... packet lost, tcp segment retries and there are reports older than one year.

The laptop has dual boot so I can test the wireless card with windows 10 drivers and the signal is perfect, even several rooms away I get a decent speed, with linux exiting from the room is granted to drop de connection.

Disabling/enabling module's parameters (fwlps, ips, msi) either 4.4.0 or rtlwifi_new doesn't make any difference.

any idea what could be happening here?

# for f in /sys/module/rtl8723be/parameters/*; do echo -n "$f: " ; cat "$f" ; done
/sys/module/rtl8723be/parameters/debug: 0
/sys/module/rtl8723be/parameters/disable_watchdog: N
/sys/module/rtl8723be/parameters/fwlps: N
/sys/module/rtl8723be/parameters/ips: N
/sys/module/rtl8723be/parameters/msi: N
/sys/module/rtl8723be/parameters/swenc: N
/sys/module/rtl8723be/parameters/swlps: N

# iwconfig wlan-01
wlan-01   IEEE 802.11bgn  ESSID:"olimpo"  
          Mode:Managed  Frequency:2.437 GHz  Access Point: A0:A8:CD:A7:1B:4C   
          Bit Rate=1 Mb/s   Tx-Power=20 dBm   
          Retry short limit:7   RTS thr=2347 B   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=50/70  Signal level=-60 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

# lspci -s 2:0.0
02:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter

(rtlwifi_new module)
# modinfo rtl8723be 
filename:       /lib/modules/4.4.0-gentoo-hp/kernel/drivers/net/wireless/realtek/rtlwifi/rtl8723be/rtl8723be.ko
firmware:       rtlwifi/rtl8723befw.bin
description:    Realtek 8723BE 802.11n PCI wireless
license:        GPL
author:         Realtek WlanFAE 
author:         PageHe  
alias:          pci:v000010ECd0000B723sv*sd*bc*sc*i*
depends:        rtlwifi,rtl_pci,btcoexist,mac80211
vermagic:       4.4.0-gentoo-hp SMP preempt mod_unload 
[...]
Owner

lwfinger commented Jan 14, 2016

This is a well-known problem and has been discussed in several issues in this repo. Your vendor, which you did not name, saved money by only including a single antenna on this laptop. They should have flashed the EEPROM to indicate which connector of two on the device is being used. They failed to do that. You have two options:

  1. Open the door on the bottom that accesses the wifi card and physically move the antenna connection.
  2. Wait until Realtek finishes the rewrite that is in progress to have the driver dynamically determine which antenna to use. That appears to be what the Windows driver is doing.
Owner

lwfinger commented Jan 15, 2016

Realtek just informed me that the routine to select the connected antenna automatically has been delayed, but they supplied a corrected routine to fix the "ant_sel" module parameter.

To access this new code, use the "rock.new_btcoex" branch and load the module with the "ant_sel=Y" option, where Y is 1 or 2.

Hello lwfinger, thank you for aswering, the laptop is a HP 13,3'' Pavilion x360 13-s100ns.

I'm testing this branch and indeed the ant_sel parameter is available but it makes not diference in the signal strength.

with ant_sel=1 and over one meter away from the AP

hp ~ # for f in /sys/module/rtl8723be/parameters/*; do echo -n "$f: " ; cat "$f" ; done
/sys/module/rtl8723be/parameters/ant_sel: 1
/sys/module/rtl8723be/parameters/debug: 1
/sys/module/rtl8723be/parameters/disable_watchdog: N
/sys/module/rtl8723be/parameters/fwlps: N
/sys/module/rtl8723be/parameters/ips: N
/sys/module/rtl8723be/parameters/msi: N
/sys/module/rtl8723be/parameters/swenc: N
/sys/module/rtl8723be/parameters/swlps: N
hp ~ # iwconfig wlan-01
wlan-01   IEEE 802.11bgn  ESSID:"olimpo"  
          Mode:Managed  Frequency:2.437 GHz  Access Point: A0:A8:CD:A7:1B:4C   
          Bit Rate=1 Mb/s   Tx-Power=20 dBm   
          Retry short limit:7   RTS thr=2347 B   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=34/70  Signal level=-76 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:42   Missed beacon:0

with ant_sel=2 and over one meter away from the AP

hp ~ # for f in /sys/module/rtl8723be/parameters/*; do echo -n "$f: " ; cat "$f" ; done
/sys/module/rtl8723be/parameters/ant_sel: 2
/sys/module/rtl8723be/parameters/debug: 1
/sys/module/rtl8723be/parameters/disable_watchdog: N
/sys/module/rtl8723be/parameters/fwlps: N
/sys/module/rtl8723be/parameters/ips: N
/sys/module/rtl8723be/parameters/msi: N
/sys/module/rtl8723be/parameters/swenc: N
/sys/module/rtl8723be/parameters/swlps: N
hp ~ # iwconfig wlan-01
wlan-01   IEEE 802.11bgn  ESSID:"olimpo"  
          Mode:Managed  Frequency:2.437 GHz  Access Point: A0:A8:CD:A7:1B:4C   
          Bit Rate=1 Mb/s   Tx-Power=20 dBm   
          Retry short limit:7   RTS thr=2347 B   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=30/70  Signal level=-80 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:34   Missed beacon:0

I still have a few days before the return period ends. Meanwhile. I can prove all the patches you have.

the option of physically moving the antenna wire is not easy since the botton case is held in place by screws under adhesive rubber feets and removing the feets causes an important loss of adhesion.

Owner

lwfinger commented Jan 16, 2016

You need to test both ant_sel=1 AND ant_sel=2 as there is no way of knowing which antenna is selected in the EFUSE.

I did so, in the above example I post the output for both settings (ant_sel=1 AND ant_sel=2). The difference is minimal, both values results in poor signal quality. I can provide you ssh access to this laptop but I think I checked properly

Owner

lwfinger commented Jan 17, 2016

Thanks, but that won't be necessary. I found the bug and just pushed code that works here. With a single antenna connected to connector 2 and sudo modprobe -v rtl8723be ant_sel=2, I get

finger@linux:~/rtlwifi_new> sudo iwlist wlp2s0 scan | egrep "SSID|level"
Quality=70/70 Signal level=-38 dBm
ESSID:"Larry_ac"

With sudo modprobe -v rtl8723be ant_sel=1, I get

finger@linux:~/rtlwifi_new> sudo iwlist wlp2s0 scan | egrep "SSID|level"
Quality=30/70 Signal level=-80 dBm
ESSID:"lwfdjf-n"
Quality=44/70 Signal level=-66 dBm
ESSID:"NETGEAR81"
Quality=24/70 Signal level=-86 dBm
ESSID:"radius"

I just tried the new code and it's working great. HP Pavilion 15t with one antenna using ant_sel=2. Thanks a lot for working on this!

Brilliant, my wifi now works for the first time with this new version. HP Pavilion, Ubuntu 15.10 using ant_sel=2. Thanks!

Yes, now it works .... (goodbye microsoft).

Thank you very much Larry!!. Now the laptop is able to use the wifi with full signal strength.

I can see this kernel messages each 600 seconds but they seem harmless since all comunications are working.

[ 6951.251162] rtlwifi:rtl_cam_del_entry():<0-0> cam_bitmap: 0x14
[ 7551.253199] rtlwifi:rtl_cam_del_entry():<0-0> cam_bitmap: 0x12
[ 8151.256507] rtlwifi:rtl_cam_del_entry():<0-0> cam_bitmap: 0x14
[ 8751.256771] rtlwifi:rtl_cam_del_entry():<0-0> cam_bitmap: 0x12
[ 9351.260873] rtlwifi:rtl_cam_del_entry():<0-0> cam_bitmap: 0x14
[ 9951.261235] rtlwifi:rtl_cam_del_entry():<0-0> cam_bitmap: 0x12
[10551.262971] rtlwifi:rtl_cam_del_entry():<0-0> cam_bitmap: 0x14

Please if you have an Amazon wish list let me know it.

Owner

lwfinger commented Jan 18, 2016

That message is coming up because your TKIP rekeying interval is 600 seconds. Most people set their AP to rekey at 3600 sec, but the messages are harmless.

Thank you for the offer, but I do this as a volunteer.

This branch (rock.new_btcoex) works for me too with a HP Pavilion 360. Thanks. (The test branch did not).

Does this ant_sel option fix the drop-out problems or just the signal-strenght? or both?

Owner

lwfinger commented Jan 24, 2016

It only addresses the problem caused by having only one antenna and the manufacturer stupidly encoding the wrong one in the EEPROM. The best we can do about the drop-out problems is to use the "ips=0" option. Any further fixes would require knowledge of the internal workings of the chip, and no one outside of Realtek has that information.

I downloaded "rtlwifi_new-rock.new_btcoex" and executed:
make clean
make install

The .ko files in the module directory (/lib/modules/4.2.0-25-generic/kernel/drivers/net/wireless/rtlwifi) are updated (based on date and time). However the ant_sel parameter is not available. Output of "modinfo - p rtl8723be" is:
swlps: (bool) swenc:using hardware crypto (default 0 [hardware]) (bool) ips:using no link power save (default 1 is open) (bool) fwlps:using linked fw control power save (default 1 is open) (bool) msi:Set to 1 to use MSI interrupts mode (default 0) (bool) debug:Set debug level (0-5) (default 0) (int) disable_watchdog:Set to 1 to disable the watchdog (default 0) (bool)

What step did I miss?

Owner

lwfinger commented Jan 26, 2016

I do not know. Did you download a zip file or did you do a git clone?

It appears that you built the driver as root. That is a big no-no as any bug in a make file could destroy your system. It is not usually necessary to use the "make clean" step. You should do the following as a normal user

git clone http://lwfinger/rtlwifi_new.git
cd rtlwifi_new
git checkout rock.new_btcoex
make
sudo make install
sudo modprobe -rv rtl8723be
sudo modprobe -v rtl8723be ips=0 ant_sel=0

At that point, it should work.

hi lwfinger,
Firstly, thanks for the repo. You are amazing.

I ran the commands from your latest comment and the problem isn't solved. I am on an HP Pavilion 15ab laptop running Ubuntu 14.04, kernel version 3.16.0.
I later tried loading the module with both ant_sel=1 and ant_sel=2 but didn't notice any difference. The APs are only detected when i am sitting very close to them and the signal is also very weak.

Hi,

I have a HP Pavilion 15ab with Ubuntu 14.04.3 64bits, and have tried with latest kernels (3.19.0.47 and 4.2.0-25-generic) but couldn't make the card works.
After compile and install rock.new_btcoex branch and user ant_sel=2 the my network card see all then near APs correctly with strong signal, but can't connect to them.

[ 1113.294557] wlan0: authenticate with f8:63:94:cc:37:d3
[ 1113.306446] wlan0: send auth to f8:63:94:cc:37:d3 (try 1/3)
[ 1113.310955] wlan0: authenticated
[ 1118.329902] wlan0: authenticate with f8:63:94:cc:37:d3
[ 1118.342442] wlan0: send auth to f8:63:94:cc:37:d3 (try 1/3)
[ 1118.346553] wlan0: authenticated
[ 1123.344876] wlan0: aborting authentication with f8:63:94:cc:37:d3 by local choice (Reason: 3=DEAUTH_LEAVING)

This happens with master and standard driver too.

Found a solution in #83.
Booting with this options in /etc/modprobe.d/rtl8723be.conf works!

options rtl8723be ips=N fwlps=N swlps=N swenc=Y disable_watchdog=Y ant_sel=2 msi=1

I was reading some of the other issues and i found a command dmesg | tail -n 30

here's the output

[ 5122.853299] Error: Driver 'rtl8192cu' is already registered, aborting...
[ 5122.882498] systemd-udevd[15409]: renamed network interface wlan0 to wlan4
[ 5123.312596] IPv6: ADDRCONF(NETDEV_UP): wlan4: link is not ready
[ 5123.316230] IPv6: ADDRCONF(NETDEV_UP): wlan4: link is not ready
[ 5126.046247] IPv6: ADDRCONF(NETDEV_CHANGE): wlan4: link becomes ready
[ 5173.453655] rtl8723be: unknown parameter 'ant_sel' ignored
[ 5173.453659] rtl8723be: unknown parameter 'ant_sel' ignored
[ 5173.469429] Using firmware rtlwifi/rtl8723befw.bin
[ 5173.470332] ieee80211 phy4: Selected rate control algorithm 'rtl_rc'
[ 5173.471260] rtlwifi: wireless switch is on
[ 5173.471323] rtl8723be 0000:08:00.0: irq 68 for MSI/MSI-X
[ 5174.971459] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 5328.866203] usb 1-1: USB disconnect, device number 5
[ 5328.866525] rtw_cmd_thread: DriverStopped(1) SurpriseRemoved(1) break at line 482
[ 5903.454297] cfg80211: Calling CRDA to update world regulatory domain
[ 5903.459508] cfg80211: World regulatory domain updated:
[ 5903.459511] cfg80211:  DFS Master region: unset
[ 5903.459512] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[ 5903.459514] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[ 5903.459515] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[ 5903.459517] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm), (N/A)
[ 5903.459518] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[ 5903.459519] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[ 5903.469885] rtl8723be: unknown parameter 'ant_sel' ignored
[ 5903.469889] rtl8723be: unknown parameter 'ant_sel' ignored
[ 5903.485694] Using firmware rtlwifi/rtl8723befw.bin
[ 5903.486580] ieee80211 phy0: Selected rate control algorithm 'rtl_rc'
[ 5903.487508] rtlwifi: wireless switch is on
[ 5903.487551] rtl8723be 0000:08:00.0: irq 68 for MSI/MSI-X
[ 5904.988691] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

Notice that in some lines it says that ant_sel is an unknown parameter and is being ignored.

I was using a wireless adapter with card "rtl8192cu" as a substitute. I thought that maybe this was causing some trouble(as it had the same "rtlwifi" dependency) so i removed the module and tried running all commands again but it shows the same error (unknown parameter ant_sel ignored).

i checked the ~/rtlwifi_new/rtl8723be/sw.c file and it is indeed the correct one from the rock.new_btcoex branch. What should i do next?

Owner

lwfinger commented Jan 26, 2016

If you are seeing the unknown parameter line, then you ARE NOT running the modified driver. I do not know what you did wrong, but repeat carefully every step!

hey lwfinger,

it seems to work with the ant_sel 2 to option. i am so happy ! No drop outs scince 3 days!! xD the laptop was produced april 2015 its a Lenovo b50-10 !

I made it exactly how you said it on another isue:
"
git clone git://github.com/lwfinger/rtlwifi_new.git
cd rtlwifi_new
git checkout rock.new_btcoex
make
sudo make install

Reboot. After the system comes up:
sudo modprobe -rv rtl8723be
sudo modprobe -v rtl8723be ant_sel=1

Now test. If that still does not work, then try

sudo modprobe -rv rtl8723be
sudo modprobe -v rtl8723be ant_sel=2
"

with ant_sel=2 ! There are no other parameters in the modrobe file, just ant_sel=2 and it works!!! for you information. Very thx to you!!!

I have one more question: do I have to do this steps again if I upgrade on Kernel 4.4? Or at wich point I have to do this steps again?

Owner

lwfinger commented Jan 27, 2016

First of all, create (as root) a file named /etc/modprobe.d/50-rtl8723be.conf. This file should contain one line that says "options rtl8723be ips=0 ant_sel=2". Without this, you will need to do the modprobe pair EVERY reboot.

No out-of-kernel driver will survive a change of kernel, but you will not have to do all of the steps. Only the cd to the source directory, make, and 'sudo make install' will be necessary.

I downloaded the zip file from <https://github.com/lwfinger/rtlwifi_new/tree/
rock.new_btcoex>

when I go to /sys/modules/rtl8723be/parameters I only find:
"debug disable_watchdog fwlps ips msi swenc swlps"

Do I need to manually create the parameter in /sys/modules.rtl8723be/
parameters ?

I'll try the same steps with sudo...

On Monday, January 25, 2016 07:09:41 PM lwfinger wrote:

I do not know. Did you download a zip file or did you do a git clone?

It appears that you built the driver as root. That is a big no-no as any bug
in a make file could destroy your system. It is not usually necessary to
use the "make clean" step. You should do the following as a normal user

git clone http://lwfinger/rtlwifi_new.git
cd rtlwifi_new
git checkout rock.new_btcoex
make
sudo make install
sudo modprobe -rv rtl8723be
sudo modprobe -v rtl8723be ips=0 ant_sel=0

At that point, it should work.


Reply to this email directly or view it on GitHub:
#88 (comment)

You know it had to be something silly, right?

As a check I deleted the rtlwifi directory from /lib/modules.../wireless

when I ran "modprobe -v rtl8723be", the module loaded... turns out I had a
duplicate directory. I deleted that directory can confirmed the rtl8723be
couldn't be loaded.

Then I was able to run make and make install and get the current verion.

It works great with "ant_sel=2"

On Monday, January 25, 2016 07:09:41 PM lwfinger wrote:

I do not know. Did you download a zip file or did you do a git clone?

It appears that you built the driver as root. That is a big no-no as any bug
in a make file could destroy your system. It is not usually necessary to
use the "make clean" step. You should do the following as a normal user

git clone http://lwfinger/rtlwifi_new.git
cd rtlwifi_new
git checkout rock.new_btcoex
make
sudo make install
sudo modprobe -rv rtl8723be
sudo modprobe -v rtl8723be ips=0 ant_sel=0

At that point, it should work.


Reply to this email directly or view it on GitHub:
#88 (comment)

hi again,

so I tried the new code on a couple of different laptops with the same wireless card and it works flawlessly.

With me it's a different story altogether. Yesterday, i did something extremely idiotic. i deleted the rtl8723be.ko, rtlwifi.ko, rtl_pci.ko files in /lib/modules/updates/3.16.0-51-generic/updates/dkms and then repeated the process( make and make install) and then when i did sudo modprobe -v rtl8723be, this is what i got;-

insmod /lib/modules/3.16.0-51-generic/updates/dkms/btcoexist.ko 
modprobe: ERROR: could not insert 'rtl8723be': Invalid argument

I checked in /sys/module/ and no directory with the name rtl8723be exists.

i reinstalled the kernel image hoping that it would fix it but it didn't help.

Kindly suggest something as to how i should proceed.
(i'm really trying to avoid reinstalling ubuntu again)

Thanks

I would like to ask if this solution will be pushed to the kernel tree or it is maintened as an independent project.

Thanks for updating . You save my many hours. Shouldn't this be pushed to main branch?

Owner

lwfinger commented Feb 1, 2016

I will push the fix to mainline as soon as I get time to figure out how to do it. The btcoex routines in this repo are very different from those in the kernel. Unfortunately, the Realtek engineers used some coding features that are completely unacceptable for the kernel. That blocks the easy solution of updating those features.

aut0 commented Feb 13, 2016

Is this something that could also be fixed by HP e.g. with a BIOS update?

Owner

lwfinger commented Feb 13, 2016

It would require a reflashing of the EEPROM on the RTL8723BE chip. The BIOS for the computer is not involved.

jairook commented Feb 20, 2016

Hello,
Thanks @lwfinger and @alambike for the help.

Owner

lwfinger commented Feb 20, 2016

Why are you forcing the driver to use software encryption? That option is only there for testing and dire emergencies. If your card is that broken, then discard it!

Nearly all devices like yours can function with "ips=N ant_sel=2". If that fails, add the "msi=1".

jairook commented Feb 20, 2016

Ok, i don't much about this. My device is new and is the same as that of alambike, and i was facing the same issue as his. Hence, i used his way. I will edit the file as per you.
After making the edits,..
It is working great with "ips=N ant_sel=2 msi=1", i had to add msi=1.
Thanks for helping out.

I tried again with only the recommended options "ips=N ant_sel=2 msi=1" but can't make it works. The card sees the APs with good signal strength but can't connect:

Feb 21 12:47:52 alambike-HP-Pavilion-Notebook kernel: [  160.355172] wlan0: aborting authentication with f8:63:94:cc:37:d3 by local choice (Reason: 3=DEAUTH_LEAVING)

So I just get connect if I set "swenc=Y".
And, yet, some times after suspend the connections fails again, and have to reboot.

OK, the problem seems with ubuntu kernel 4.2 (linux-image-generic-lts-wily, 4.2.0.27.21), with 3.19 (linux-image-extra-3.19.0-49-generic, 3.19.0-49.55~14.04.1) works correctly with "ips=N ant_sel=2 msi=1"

Owner

lwfinger commented Feb 22, 2016

I have no idea what Ubuntu is doing with their kernels. Please verify your firmware. Running the command 'md5sum /lib/firmware/rtlwifi/rtl8723befw.bin' should result in

bc828ddc6cd700abb79a8df5794bcf04 /lib/firmware/rtlwifi/rtl8723befw.bin

jairook commented Feb 22, 2016

Mine shows different :

jai@Jai-HP-Pavilion-Notebook:~$ md5sum /lib/firmware/rtlwifi/rtl8723befw.bin
1850c1308fbcd95e9f6a7f58ede1e35f /lib/firmware/rtlwifi/rtl8723befw.bin

Should not this be different for every other piece of the same hardware.?

Owner

lwfinger commented Feb 22, 2016

Do 'sudo make install'.

Hi @lwfinger , when i run 'make' command, i am getting this error.
Could you please help?

make

make -C /lib/modules/4.4.0-22-generic/build M=/home/mani/Desktop/Untitled Folder/rtlwifi_new modules
make[1]: Entering directory '/usr/src/linux-headers-4.4.0-22-generic'
arch/x86/Makefile:148: CONFIG_X86_X32 enabled but no binutils support
Makefile:670: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
make[1]: *** No rule to make target 'Folder/rtlwifi_new'. Stop.
make[1]: Leaving directory '/usr/src/linux-headers-4.4.0-22-generic'
Makefile:58: recipe for target 'all' failed
make: *** [all] Error 2

Owner

lwfinger commented May 26, 2016

For that error, complain to your distro. They have built the kernel with CONFIG_CC_STACKPROTECTOR_STRONG=y, but they are distributing a compiler that cannot handle that parameter. There is nothing I can do.

@lwfinger : Thanks for your quick response.
Now in re-installed Ubuntu and did above steps. It works brilliantly.
But when i rebooted again, it all happened again. My connection was lost and make gives error.
Will i lose my setting everytime i reboot?
Thanks in advance.

I have a similar problem with the rtl8723be not connecting when using hardware encryption, but OK with software encryption with your rtl8723be module (and thanks for that). I followed the instructions, and added ant_sel=2 (along with disabling power saving so the connection is stable). After the sudo make install I get md5sums:
1850c1308fbcd95e9f6a7f58ede1e35f /lib/firmware/rtlwifi/rtl8723befw.bin 1850c1308fbcd95e9f6a7f58ede1e35f software/rtlwifi_new/firmware/rtlwifi/rtl8723befw.bin

Should I find & reinstall the ubuntu rtl8723befw.bin?

I'm using Linux Mint Cinnamon (based on ubuntu) on an HP Stream 11.

jetojedno commented Jun 11, 2016

I've reinstalled the linux-firmware package to get the "packaged" firmware:

dpkg -s linux-firmware | grep -i version
Version: 1.127.22

and now have a firmware with a different md5sum, but not the same as above:

md5sum /lib/firmware/rtlwifi/rtl8723befw.bin software/rtlwifi_new/firmware/rtlwifi/rtl8723befw.bin
826e722c97fc0d24567175f91b230dbf /lib/firmware/rtlwifi/rtl8723befw.bin
1850c1308fbcd95e9f6a7f58ede1e35f software/rtlwifi_new/firmware/rtlwifi/rtl8723befw.bin

With this firmware, the card won't connect with hardware encryption, so going back to software.

Any suggestions about how to get hardware encryption working?

jetojedno commented Jun 11, 2016

OK. I've downloaded the rtl8723befw.bin from http://ftp2.halpanet.org/source/_dev/linux-firmware.git/rtlwifi/rtl8723befw.bin which has the same md5sum as you've given, and put it in the right location. I now have:

md5sum /lib/firmware/rtlwifi/rtl8723befw.bin software/rtlwifi_new/firmware/rtlwifi/rtl8723befw.bin software/rtl8723befw.bin
bc828ddc6cd700abb79a8df5794bcf04 /lib/firmware/rtlwifi/rtl8723befw.bin
1850c1308fbcd95e9f6a7f58ede1e35f software/rtlwifi_new/firmware/rtlwifi/rtl8723befw.bin
bc828ddc6cd700abb79a8df5794bcf04 software/rtl8723befw.bin

WiFi now working with hardware encryption:

egrep '\w' /sys/module/rtl8723be/parameters/*
/sys/module/rtl8723be/parameters/ant_sel:2
/sys/module/rtl8723be/parameters/debug:1
/sys/module/rtl8723be/parameters/disable_watchdog:N
/sys/module/rtl8723be/parameters/fwlps:N
/sys/module/rtl8723be/parameters/ips:N
/sys/module/rtl8723be/parameters/msi:Y
/sys/module/rtl8723be/parameters/swenc:N
/sys/module/rtl8723be/parameters/swlps:N

Thanks, David

Owner

lwfinger commented Jun 11, 2016

I have no idea where the other firmware versions are derived, but the one with md5sum of bc828ddc6cd700abb79a8df5794bcf04 is correct. That is what is in the official Linux firmware repo, and it is what you get when you do a 'sudo make install' from this repo.

I've just retried make clean && make then sudo make install and I get the same wrong firmware module:

$ md5sum /lib/firmware/rtlwifi/rtl8723befw.bin ~/software/rtlwifi_new/firmware/rtlwifi/rtl8723befw.bin ~/software/rtl8723befw.bin
1850c1308fbcd95e9f6a7f58ede1e35f /lib/firmware/rtlwifi/rtl8723befw.bin
1850c1308fbcd95e9f6a7f58ede1e35f /home/david/software/rtlwifi_new/firmware/rtlwifi/rtl8723befw.bin
bc828ddc6cd700abb79a8df5794bcf04 /home/david/software/rtl8723befw.bin

I've copied the one with the right md5sum back :-)

pezarro commented Jun 16, 2016

I am running ubuntu 15.10 on an HP Pavilion 15-AB168CA which uses the realtech RTL8723BE chipset and appears to have the miss-configured antenna eprom issue. I am dual boot to windows 10. Wifi works as expected with Windows10.

I followed the instructions to compile and install the patch. I can see the patch driver is being used as the ant_sel option is available. I try both anntena options and performance is poor in both cases. I can only see my android which is sitting next to my laptop and none of the ~6 wifi networks that my android phone can see. Below are the instructions I ran to toggle between the antenna options.

What did I do wrong? Or, do you believe I have a different problem? Thanks in advance....

user@laptop:~$ sudo modinfo -p rtl8723be
swlps: (bool)
swenc:using hardware crypto (default 0 [hardware])
(bool)
ips:using no link power save (default 1 is open)
(bool)
fwlps:using linked fw control power save (default 1 is open)
(bool)
msi:Set to 1 to use MSI interrupts mode (default 0)
(bool)
debug:Set debug level (0-5) (default 0) (int)
disable_watchdog:Set to 1 to disable the watchdog (default 0)
(bool)
ant_sel:Set to 1 or 2 to force antenna number (default 0)
(int)

When I switch try both antenna options, there appears to be no difference. Wifi performance is poor.
user@laptop:~$ sudo modprobe -rv rtl8723be
[sudo] password for user:
rmmod rtl8723be
rmmod rtl_pci
rmmod btcoexist
rmmod rtlwifi
rmmod mac80211
rmmod cfg80211

user@laptop:~$ sudo modprobe -v rtl8723be ant_sel=1
insmod /lib/modules/4.2.0-36-generic/kernel/net/wireless/cfg80211.ko
insmod /lib/modules/4.2.0-36-generic/kernel/net/mac80211/mac80211.ko
insmod /lib/modules/4.2.0-36-generic/kernel/drivers/net/wireless/rtlwifi/rtlwifi.ko
insmod /lib/modules/4.2.0-36-generic/kernel/drivers/net/wireless/rtlwifi/rtl_pci.ko
insmod /lib/modules/4.2.0-36-generic/kernel/drivers/net/wireless/rtlwifi/btcoexist/btcoexist.ko
insmod /lib/modules/4.2.0-36-generic/kernel/drivers/net/wireless/rtlwifi/rtl8723be/rtl8723be.ko ant_sel=1

user@laptop:~$ iwconfig wlo1
wlo1 IEEE 802.11bgn ESSID:"AndroidAP"
Mode:Managed Frequency:2.412 GHz Access Point: 64:BC:0C:47:DB:14
Bit Rate=7.2 Mb/s Tx-Power=20 dBm
Retry short limit:7 RTS thr=2347 B Fragment thr:off
Power Management:off
Link Quality=52/70 Signal level=-58 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:1 Missed beacon:0

user@laptop:~$sudo modprobe -rv rtl8723be
rmmod rtl8723be
rmmod rtl_pci
rmmod btcoexist
rmmod rtlwifi
rmmod mac80211
rmmod cfg80211

user@laptop:~$ sudo modprobe -v rtl8723be ant_sel=0
insmod /lib/modules/4.2.0-36-generic/kernel/net/wireless/cfg80211.ko
insmod /lib/modules/4.2.0-36-generic/kernel/net/mac80211/mac80211.ko
insmod /lib/modules/4.2.0-36-generic/kernel/drivers/net/wireless/rtlwifi/rtlwifi.ko
insmod /lib/modules/4.2.0-36-generic/kernel/drivers/net/wireless/rtlwifi/rtl_pci.ko
insmod /lib/modules/4.2.0-36-generic/kernel/drivers/net/wireless/rtlwifi/btcoexist/btcoexist.ko
insmod /lib/modules/4.2.0-36-generic/kernel/drivers/net/wireless/rtlwifi/rtl8723be/rtl8723be.ko ant_sel=0

user@laptop:~$ iwconfig wlo1
wlo1 IEEE 802.11bgn ESSID:"AndroidAP"
Mode:Managed Frequency:2.412 GHz Access Point: 64:BC:0C:47:DB:14
Bit Rate=7.2 Mb/s Tx-Power=20 dBm
Retry short limit:7 RTS thr=2347 B Fragment thr:off
Power Management:off
Link Quality=48/70 Signal level=-62 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

alambike commented Jul 7, 2016

@pezarro, try with ant_sel=2

My line in /etc/modprobe.d/rtl8723be.conf that works flawlessly:

options rtl8723be ips=N ant_sel=2

pezarro commented Jul 8, 2016

@alambike, thanks! this is what worked for me:

mkdir -p ~/bin/realtek/
git clone git://github.com/lwfinger/rtlwifi_new.git
git checkout rock.new_btcoex
cd ~/bin/realtek/rtlwifi_new/
make
sudo make install
sudo modprobe -rv rtl8723be
sudo modprobe -v rtl8723be ips=0 ant_sel=2

I then created the file
/etc/modprobe.d/50-rtl8723be.conf

with contents:
options rtl8723be ips=0 ant_sel=2

This makes the kernel module change survive reboot.

Cheers,

pezarro commented Jul 8, 2016

Also, you can see the link quality is 70/70

user@laptop:~/bin/realtek$ iwconfig wlo1
wlo1 IEEE 802.11bgn ESSID:"AndroidAP"
Mode:Managed Frequency:2.437 GHz Access Point: 64:BC:0C:47:DB:14
Bit Rate=72.2 Mb/s Tx-Power=20 dBm
Retry short limit:7 RTS thr=2347 B Fragment thr:off
Power Management:off
Link Quality=70/70 Signal level=-14 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:103 Missed beacon:0

@alambike
Thanks, this:
mkdir -p ~/bin/realtek/
git clone git://github.com/lwfinger/rtlwifi_new.git
git checkout rock.new_btcoex
cd ~/bin/realtek/rtlwifi_new/
make
sudo make install
sudo modprobe -rv rtl8723be
sudo modprobe -v rtl8723be ips=0 ant_sel=2

I then created the file
/etc/modprobe.d/50-rtl8723be.conf

with contents:
options rtl8723be ips=0 ant_sel=2

This makes the kernel module change survive reboot.

Cheers,

This worked like a charm on my hp pavilion with current Sabayon 4.6 kernel, thanks again

Thanks @lwfinger and @alambike , changing antenna worked for me too.

tbcam88 commented Nov 2, 2016

Hi all,

I realise you guys are on/discussing Linux but I'm having similar RTL8723BE speed and signal issues using Windows 7 (Windows 10 works perfectly as OP originally stated...)

I've contacted Realtek regarding this but haven't had a response. I don't suppose any of you can shed any light on how this issue can be fixed on Windows 7 also?

Thanks!

Thanks @lwfinger and @alambike, now my HP ProBook 455 G3 recognized a much stronger wifi signal.

manihere commented Nov 6, 2016

Hi,

If anyone is receiving the following error, install gcc-4.9 to resolve. Follow this link here to install : http://askubuntu.com/questions/466651/how-do-i-use-the-latest-gcc-on-ubuntu

**Error

make -C /lib/modules/4.8.6-040806-generic/build M=/home/mani/Documents/m/rtlwifi_new modules
make[1]: Entering directory /usr/src/linux-headers-4.8.6-040806-generic' CC [M] /home/mani/Documents/m/rtlwifi_new/base.o gcc: error: unrecognized command line option ‘-fstack-protector-strong’ make[2]: *** [/home/mani/Documents/m/rtlwifi_new/base.o] Error 1 make[1]: *** [_module_/home/mani/Documents/m/rtlwifi_new] Error 2 make[1]: Leaving directory/usr/src/linux-headers-4.8.6-040806-generic'
make: * [all] Error 2

Owner

lwfinger commented Dec 2, 2016

A completely new version of the drivers has just been pushed. It fixes a lot of things. As a result, I am closing all open issues. If you get a new one, please create a new issue.

Note: The new driver fixes the problems with power save. It is recommended that you clear all ips, swlps, and fwlps options.

@lwfinger lwfinger closed this Dec 2, 2016

shahbaz275817 commented Dec 3, 2016

[Solved] kernel does not support PIC mode

After updating my Debian system, I was unable to compile/install the drivers. The error message seemed to be "kernel does not support PIC mode".Seems like a kernel configurations issue

`root@strange:~/rtlwifi_new# make
make -C /lib/modules/4.8.0-kali1-amd64/build M=/root/rtlwifi_new modules
make[1]: Entering directory '/usr/src/linux-headers-4.8.0-kali1-amd64'
CC [M] /root/rtlwifi_new/base.o
/root/rtlwifi_new/base.c:1:0: error: code model kernel does not support PIC mode
/******************************************************************************

/usr/src/linux-headers-4.8.0-kali1-common/scripts/Makefile.build:294: recipe for target '/root/rtlwifi_new/base.o' failed
make[4]: *** [/root/rtlwifi_new/base.o] Error 1
/usr/src/linux-headers-4.8.0-kali1-common/Makefile:1488: recipe for target 'module/root/rtlwifi_new' failed
make[3]: *** [module/root/rtlwifi_new] Error 2
Makefile:150: recipe for target 'sub-make' failed
make[2]: *** [sub-make] Error 2
Makefile:8: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.8.0-kali1-amd64'
Makefile:57: recipe for target 'all' failed
make: *** [all] Error 2
`

Luckily I found a fix and I have shared it below so that anyone who ran into this problem of kernel configuration issue in debian can use tihs. Just copy paste this commands in terminal.

$ export KCPPFLAGS="-fno-pie -Wno-pointer-sign -fno-stack-protector -mfentry" $ export CPPFLAGS="$KCPPFLAGS"

I too don't know about actually what those commands do but it fix my problem so if anyone can explain, it would be helpful.

Owner

lwfinger commented Dec 3, 2016

Symbol CPPFLAGS is the one that sets the global parameters for the compiler.

I would recommend adding that line to the rc file for your default shell, i.e. ~/.bashrc if you use bash. That way the revised value for CPPFLAGS will be available every rime you log in.

By the way, setting PIC as the default is a very stupid choice for any distro. You should consider changing. Who knows what other bad choices they have made?

Can someone (preferably lwfinger or someone who really understands the topic) post specific instructions for downloading and applying the latest rtlwifi_new driver in Lubuntu 15.10 with kernel 4.2.0-42generic or equivalent? We can't upgrade to Lubuntu 16.04 or 16.10 due to issues with specific software applications, but with (L)ubuntu version 15 the RTL8723be wifi is not reliable with all the random dropouts. Sometimes we lose over 50% of PING packets. I see many different and contradictory recommendations and CLI commands in all the ubuntu forums and I don't know enough about Linux to know which ones are best. And it seems rather scary to think that anytime the computer finds and installs an update we might have to "re-make" the driver? Is there a better way?

Owner

lwfinger commented Dec 29, 2016

The first thing you need to determine is if your computer is one of those with only one antenna, and with the EEPROM miscoded so that the driver is told that the other connector is being used. If that is true, then your wireless device effectively has no antenna. The way to test this is with the command

sudo iw dev wlan0 scan | grep signal

If your device has a name other than "wlan0", adjust the command appropriately. If the largest value for the signal is on the order of -70 dBm, then you have the problem. If you see values larger than -40, then your problem is something else.

If you have the antenna problem, AND you cannot run a kernel newer that 4.7, then this repo is your best bet. Do the following (one time only):

sudo apt-get install git
sudo apt-get install kernel-headers-$(uname -r)
git clone http://github.com/lwfinger/rtlwifi_new.git

Anytime you need to build or rebuild (more later), then do the following:

change directory to rtlwifi_new
git pull
make
sudo make install
sudo modprobe -rv rtl8723be
sudo modprobe -v rtl8723be

The pull gets you the latest version. The next two commands build the new version and install the new versions where the kernel can find them. The next two unload the old versions and load the new ones. These could be replaced by a reboot.

When do you need to rebuild the drivers? Linux is very particular about requiring drivers to be built using the same layout as the kernel. This is because drivers have unchecked access to the hardware. A random update of the system does not require external drivers to be rebuilt UNLESS the kernel is changed. At that point, the loaded drivers will revert to the standard ones, and you will need to repeat the build.

Finally, if you do have the antenna selection problem, you will need to conduct an experiment once the new drivers are built. Use the following sequence:

sudo modprobe -rv rtl8723be
sudo modprobe -v rtl8723be ant_sel=2
sudo iw dev wlan0 scan | grep signal

Did the printed signal values get better? If not, repeat the above with "ant_sel=1". If that does not help, then I have no idea what problem you have. If one of the two choices for ant_sel is definitely better, then run the following command:

echo "options rtl8723be ant_sel=X" | sudo tee -a /etc/modprobe.d/rtl8723be.conf

Replace X with 1 or 2 depending on which sequence gives you the stronger signal. You will only need to do this ONCE. The system will remember that value.

Owner

lwfinger commented Dec 29, 2016

This is the first instance where the antenna selection jumps. All the others have had the wrong configuration be fixed.

The driver you need for the BCM43142 is likely the hybrid wl driver from Broadcom. They have provided only that binary blob for that device.

Owner

lwfinger commented Dec 29, 2016

Using 'sudo make uninstall' should restore the original. I saw nothing in RED anywhere.

The fact that BCM hardware/software can switch antennas does not mean the Realtek drivers will do that.

You do not need to quote my previous mails. The issue thread has everything.

Sorry if I didn't understand the protocol for responding. GitHub strips out the red font comments in the email I used to respond point by point what happened when I followed the instructions, and I was hoping you would notice something that "went wrong" and could help get around it. I will restore the computer back to original configuration and await a workable solution. Thanks

samames commented Mar 4, 2017

I installed this driver using the following commands but can no longer start Debian in gui mode. Ctrl, alt and F1 so what appears to be the same segment of code running repeatedly without ending.

change directory to rtlwifi_new
git pull
make
sudo make install
sudo modprobe -rv rtl8723be
sudo modprobe -v rtl8723be

Please see the following YouTube video depicting the current repeating code: https://youtu.be/oVCPxK8Ii9E

I made a topic here which details my hardware setup which may be of use: http://forums.debian.net/viewtopic.php?f=7&t=131923

Please help! :)

xjcl commented Apr 13, 2017

Hi, just wanted to chip in and said that the approach of building the rock.new_btcoex branch worked for me. The config file also works flawlessly. Thanks!

xjcl commented Apr 18, 2017

Hm, I'd like to redact my previous statement. When waking from suspend, the laptop often doesn't try to connect to any of the available networks. After I try my self-defined command alias rewifi='sudo modprobe -rv rtl8723be; sudo modprobe -v rtl8723be ips=N fwlps=N swlps=N swenc=Y disable_watchdog=Y ant_sel=2 msi=1' for a couple times, it usually works.

zekage2 commented Jun 14, 2017

Hey, I just want to add that to get it to work I HAD to create the "/etc/modprobe.d/rtl8723be.conf file and then add "options rtl8723be ips=N fwlps=N swlps=N swenc=Y disable_watchdog=Y ant_sel=2 msi=1" like @alambike suggested. I've seen other people have problems using the same parameters but without the .conf file. So if you've tried everything else give it a go. Thanks @lwfinger and @alambike I really appreciate it.

xjcl commented Sep 25, 2017

I updated from Linux Mint 18 to Linux Mint 18.2 and now I'm back to my original issues :(( My wifi is basically unusable now for anything but text but even those may take minutes to load :(

xjcl commented Sep 25, 2017

Hm, this seems to be fixed by replacing ant_sel=2 with ant_sel=1. Remember that it previously worked for months on this machine using ant_sel=2.

sudo modprobe -rv rtl8723be
sudo modprobe -v rtl8723be ips=N fwlps=N swlps=N swenc=Y disable_watchdog=Y ant_sel=1 msi=1
Owner

lwfinger commented Sep 25, 2017

Remember that the entire ant_sel mess was done as a service to help those of you with a lousy vendor and who also refuse to open the case and move an antenna wire. There are no guarantees that the value will not change. In fact, ant_sel=2 was intended to be reserved for unexpected cases and the code for ant_sel=2 is essentially the same as ant_sel=0. The fact that it changed means we fixed a bug!

We fixed the power-save issue months ago, thus the Xps options should not be needed. Using the swenc option means that you are making your CPU work harder than necessary. I think you should use "ant_sel=1 msi=1" as your only options!

xjcl commented Sep 27, 2017

Hm, but even when I don't pass swenc=Y it seems to add that implicitly:

➜  py  sudo modprobe -v rtl8723be ant_sel=1 msi=1
insmod /lib/modules/4.10.0-35-generic/kernel/net/wireless/cfg80211.ko 
insmod /lib/modules/4.10.0-35-generic/kernel/net/mac80211/mac80211.ko 
insmod /lib/modules/4.10.0-35-generic/kernel/drivers/net/wireless/realtek/rtlwifi/rtlwifi.ko 
insmod /lib/modules/4.10.0-35-generic/kernel/drivers/net/wireless/realtek/rtlwifi/rtl_pci.ko 
insmod /lib/modules/4.10.0-35-generic/kernel/drivers/net/wireless/realtek/rtlwifi/rtl8723com/rtl8723-common.ko 
insmod /lib/modules/4.10.0-35-generic/kernel/drivers/net/wireless/realtek/rtlwifi/btcoexist/btcoexist.ko 
insmod /lib/modules/4.10.0-35-generic/kernel/drivers/net/wireless/realtek/rtlwifi/rtl8723be/rtl8723be.ko ips=N fwlps=N swlps=N swenc=Y disable_watchdog=Y ant_sel=2 msi=1 ant_sel=1 msi=1

So should I pass sudo modprobe -v rtl8723be swenc=N ant_sel=1 msi=1?

Owner

lwfinger commented Sep 27, 2017

That set of options is coming from a .conf file in /etc/modprode.d/. You can choose to do whatever you want! I just gave you my opinion.

xjcl commented Sep 27, 2017

So your opinion is I should pass swenc=N ant_sel=1 msi=1 rather than ant_sel=1 msi=1?

Owner

lwfinger commented Sep 27, 2017

modinfo rtl8723be lists the following:

parm: swenc:Set to 1 for software crypto (default 0) (bool)
parm: ips:Set to 0 to not use link power save (default 1) (bool)
parm: swlps:Set to 1 to use SW control power save (default 0) (bool)
parm: fwlps:Set to 1 to use FW control power save (default 1) (bool)
parm: msi:Set to 1 to use MSI interrupts mode (default 0) (bool)
parm: debug_level:Set debug level (0-5) (default 0) (int)
parm: debug_mask:Set debug mask (default 0) (ullong)
parm: disable_watchdog:Set to 1 to disable the watchdog (default 0) (bool)
parm: ant_sel:Set to 1 or 2 to force antenna number (default 0) (int)

As 0 is the same as N, the default is swenc=N. You can specify it as N or not, it will not make a difference.

khanzf added a commit to khanzf/freebsd that referenced this issue Oct 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment