Ubuntu 16.04 无法连接 Wifi

Ubuntu 16.04 无法连接 Wifi

我刚刚在我的HP-149tx和 Windows 一样。我无法从 Ubuntu 访问 Wifi。即使我将笔记本电脑靠近路由器,信号仍然太弱。我可以确认这是驱动程序问题,因为我可以从 Windows 顺利访问我的 Wifi。

我尝试纠正此问题,尝试按照上述说明下载并安装 wifi 驱动程序这里我在安装驱动程序时遇到的问题如下-:

(Reading database ... 174937 files and directories currently installed.)
Preparing to unpack rtlwifi-new-dkms_0.10_all.deb ...

------------------------------
Deleting module version: 0.10
completely from the DKMS tree.
------------------------------
Done.
Unpacking rtlwifi-new-dkms (0.10) over (0.10) ...
Setting up rtlwifi-new-dkms (0.10) ...
Loading new rtlwifi-new-0.10 DKMS files...
First Installation: checking all kernels...
Building only for 4.8.0-36-generic
Building for architecture x86_64
Building initial module for 4.8.0-36-generic
Error! Bad return status for module build on kernel: 4.8.0-36-generic (x86_64)
Consult /var/lib/dkms/rtlwifi-new/0.10/build/make.log for more information.

make.log 的内容如下:

DKMS make.log for rtlwifi-new-0.10 for kernel 4.8.0-36-generic (x86_64)
Sun Jul 30 17:10:27 IST 2017
make: Entering directory '/usr/src/linux-headers-4.8.0-36-generic'
  LD      /var/lib/dkms/rtlwifi-new/0.10/build/built-in.o
  CC [M]  /var/lib/dkms/rtlwifi-new/0.10/build/base.o
In file included from /var/lib/dkms/rtlwifi-new/0.10/build/base.c:30:0:
/var/lib/dkms/rtlwifi-new/0.10/build/wifi.h:1327:40: error: ‘IEEE80211_NUM_BANDS’ undeclared here (not in a function)
  struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS];
                                        ^
/var/lib/dkms/rtlwifi-new/0.10/build/base.c:138:10: error: ‘IEEE80211_BAND_2GHZ’ undeclared here (not in a function)
  .band = IEEE80211_BAND_2GHZ,
          ^
/var/lib/dkms/rtlwifi-new/0.10/build/base.c:150:10: error: ‘IEEE80211_BAND_5GHZ’ undeclared here (not in a function)
  .band = IEEE80211_BAND_5GHZ,
          ^
scripts/Makefile.build:289: recipe for target '/var/lib/dkms/rtlwifi-new/0.10/build/base.o' failed
make[1]: *** [/var/lib/dkms/rtlwifi-new/0.10/build/base.o] Error 1
Makefile:1491: recipe for target '_module_/var/lib/dkms/rtlwifi-new/0.10/build' failed
make: *** [_module_/var/lib/dkms/rtlwifi-new/0.10/build] Error 2
make: Leaving directory '/usr/src/linux-headers-4.8.0-36-generic'

我可以确认我的 wifi 局域网卡是 Realtek RTL8723BE 设备,因为我的 Windows 操作系统可以识别它,并且我已经为其安装了 Windows 等效驱动程序,并且它在那里运行良好。

modinfo rtl8723be 的输出如下:

alex@alex-HP-Notebook:~/Desktop/rtlwifi_new-master$ modinfo rtl8723be
filename:       /lib/modules/4.8.0-36-generic/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 <[email protected]>
author:         PageHe  <[email protected]>
srcversion:     1520FD8B69687790125304A
alias:          pci:v000010ECd0000B723sv*sd*bc*sc*i*
depends:        rtlwifi,rtl8723-common,rtl_pci,btcoexist,mac80211
intree:         Y
vermagic:       4.8.0-36-generic SMP mod_unload modversions 
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:Set debug level (0-5) (default 0) (int)
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)

我的路由器还配置了以下参数:

Wireless Band: 2.4 GHz
802.11 Mode: Mixed 802.11n, 802.11g, 802.11b
Auto Channel Scan enabled
Wireless Channel : 2.437 GHz - CH 6
Channel Width: Auto 20/40 MHz

答案1

很多时候,信号弱是因为天线连接到了卡上的连接 #1,而默认驱动程序期望在连接 #2 处看到信号。当然,您可以打开笔记本电脑并切换电线,或者您可以指示驱动程序明确选择有效的天线连接。首先,尝试连接 #1:

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

重启并测试。如果此方法无效,请尝试 #2:

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

答案2

4.8 或 4.10 内核不需要该rtkwifi-new模块。您需要将其卸载。

跑步

sudo apt purge rtlwifi-new-dkms
sudo add-apt-repository -r ppa:hanipouspilot/rtlwifi

然后使用这个答案解决信号弱的问题。

答案3

您尝试编译的代码可能适用于低于 4.7 的内核版本。这是具体的提交这些枚举被删除了。

在驱动程序的源代码中,您可以尝试此快速修复。

#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ 
#define IEEE80211_BAND_5GHZ NL80211_BAND_5GHZ 
#define ieee80211_band nl80211_band
#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS

答案4

你检查过你的 wifi 信号强度吗?我建议你使用 wifi 扫描仪https://www.netspotapp.com/wireless-network-wifi-scanner.html监控您的网络并首先确定问题区域。我认为问题可能出在您家的背景噪音水平上。

相关内容