2

In trying to diagnose a slow/weak wifi connection in my fresh install of ubuntu 18.04 on a Lenovo Yoga C930, I discovered the below answer

Low Wifi Signal in ubuntu 14

The solution seems simple and it's related to a solution I employed in a similar issue in question

Follow up question to “Lenovo 18.04 No Wifi Adapter Found”

I found that restarting my system got my wireless connection working faster, and like the OP in the first referenced question, I have no issue with the signal strength on my dual booted Windows 10 platform. I would like to employ this solution to my machine, but I don't know if it is applicable to the different hardware or how to adapt it. Hence I am asking a clarifying question:

What does modprobe do in the code

sudo modprobe -v rtl8723be ant_sel=2

and how can I adapt it to suit my system and my issue?

As per request, results of lspci -nnk | grep 0280 -A3:

6b:00.0 Network controller [0280]: Intel Corporation Wireless-AC 9260 [8086:2526] (rev 29) Subsystem: Intel Corporation Device [8086:0014] Kernel driver in use: iwlwifi Kernel modules: iwlwifi

  • 1
    From manual of modprobe : program to add and remove modules from the Linux Kernel in this case it adds the rtl8723be module to for the kernel to be able to use it. – Michal Przybylowicz Aug 27 '19 at 15:19
  • What's a rtl8723be module? and how can I know if I need to add it on my machine? – Pinkie B Aug 27 '19 at 18:58
  • Please edit your question to show the result of the terminal command: lspci -nnk | grep 0280 -A3 – chili555 Aug 27 '19 at 21:10
  • sudo lshw should reveal your network devices. You may not have a realtek interface, but you should have something. Also see https://askubuntu.com/a/1104240/249734 – mckenzm Aug 28 '19 at 00:11

2 Answers2

8

The command was undoubtably preceeded by:

sudo modprobe -r rtl8723be

That has the effect of removing (-r) the module which was presumably loaded with its default parameters.

Many drivers, and, in particular, wireless drivers, have parameters that may be manipulated at the time the driver is loaded; that is, modprobed. You can review the available parameters with the command:

modinfo rtl8723be

We see the following parameters:

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:           aspm:Set to 1 to enable ASPM (default 1)  (int) 
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)

Of particular interest here is ant_sel; that is, the ability to select antenna 1 or antenna 2 in preference to antenna 0, which, I believe, means to auto select the correct antenna. However, the rtl8723be driver and hardware combination are not yet currently capable of auto selection. It is usually necessary to test and so determine the antenna that gives the strongest connection.

If you wish to make the parameter permanent, create a file that tells the system to always use the selected parameter whenever the module loads. From the terminal:

sudo -i
echo "options rtl8723be ant_sel=2"  >  /etc/modprobe.d/rtl8723be.conf
exit

EDIT: As we see from your lspci, your wireless driver is iwlwifi. You have an Intel wireless device, not a Realtek. Any driver parameter you set for rtl8723be will be ineffective as there is no Realtek device on your system to load the driver and apply the parameter.

Creation of the rtl8723be.conf file does no harm; however, it also does nothing helpful. If you want to remove the needless file, then open a terminal and do:

sudo rm /etc/modprobe.d/rtl8723be.conf

It is fairly common for new users of Ubuntu to read a forum post about solving a wireless issue and then blindly apply it to their system. They are usually disappointed when there is no improvement. While it is not dangerous to apply a .conf file to your system for a wireless driver that your system doesn't even use, it is futile if you don't know what driver you have. I urge all Ubuntu users to determine what wireless driver they have before applying any fixes to the system. You can do so with the terminal command:

lspci -nnk | grep 0280 -A3

After determining, for example, that you are using the driver iwlwifi, if you are having difficulties, search only for answers applicable to iwlwifi, such as "slow wireless" iwlwifi or "connection drops" iwlwifi.

Then I ran modinfo again, but the line for ant_sel doesn't appear to have changed;

It will never change. It reports what is available. What will change is /sys/module/rtl8723be/parameters/ant_sel. It reports what has actually been applied.

If you are having trouble with your wireless, I suggest that you ask a new question and tell us what issue you are facing with your Intel 9260 wireless.

chili555
  • 60,188
  • Thanks, @chili555, for a really great start. I tried both the modprobe and the echo commands you detailed above. Then I ran modinfo again, but the line for ant_sel doesn't appear to have changed; neither does my wifi signal. How can I verify if the commands had the desired effect? – Pinkie B Aug 28 '19 at 12:47
  • Please see my edit above in a few minutes. – chili555 Aug 28 '19 at 13:32
5

From here

As rtl8723be-options mentioned, paste option to /etc/modprobe.d/rtl8723be.conf

options rtl8723be ant_sel=2

Where, ant_sel can be 0, 1 and 2 for default, AUX and MAIN antenna position respectively. Note: Once ant_sel is changed, you have to do a cold reboot. The power should be off to ensure that the firmware is using the new value

After doing three experiments with ant_sel=0, 1, 2, you can write the best one to rtl8723be.conf.


Checking the option with modinfo:

sudo modinfo rtl8723be | grep ant_sel
parm: ant_sel:Set to 1 or 2 to force antenna number (default 0)