RTL8723BE wifi sees wifis but can't connect (DEAUTH_LEAVING)

Kernels & Hardware, configuring network, installing services

RTL8723BE wifi sees wifis but can't connect (DEAUTH_LEAVING)

Postby jimmyD » 2019-01-31 16:27

Good day everybody,
really appreciate your time trying to help me! :D

I struggle to get my Lenovo laptop's RTL8723BE wifi module to work, which is very well known for causing problems on linux.
It was working before (apart from the antenna select issue) and started to become useless with kernel 4.15. Now I have switched to Debian testing and have
already spent many hours trying to get it to work + trying other people's solutions. I think I'm quite close, as I'm able to scan wifis. But it won't connect.
firmware-realtek and firmware-linux-nonfree are the latest version.

I did try first with nmtui and then with wicd.

- nmtui says: "Activation failed, IP-configuration could not be reserved (no available IP, timeout etc)
- wicd: hangs at "Requesting IP address"[/list]

What came to my attention was that systemctl tells me networking service is "exited":

Code: Select all
networking.service         loaded active exited  Raise network interfaces


Here hopefully all relevant information:

dmesg output when trying to connect:

Code: Select all
[  235.866563] IPv6: ADDRCONF(NETDEV_UP): wlo1: link is not ready
[  236.040564] Generic PHY r8169-200:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=r8169-200:00, irq=IGNORE)
[  236.301529] IPv6: ADDRCONF(NETDEV_UP): enp2s0: link is not ready
[  236.302219] r8169 0000:02:00.0 enp2s0: Link is Down
[  236.912829] IPv6: ADDRCONF(NETDEV_UP): wlo1: link is not ready
[  237.917230] r8169 0000:02:00.0 enp2s0: Link is Up - 100Mbps/Full - flow control rx/tx
[  237.917256] IPv6: ADDRCONF(NETDEV_CHANGE): enp2s0: link becomes ready
[  240.050398] wlo1: authenticate with 9c:c7:a6:a8:30:4c
[  240.068672] wlo1: send auth to 9c:c7:a6:a8:30:4c (try 1/3)
[  240.077574] wlo1: authenticated
[  240.080481] wlo1: associate with 9c:c7:a6:a8:30:4c (try 1/3)
[  240.085674] wlo1: RX AssocResp from 9c:c7:a6:a8:30:4c (capab=0x431 status=0 aid=3)
[  240.085911] wlo1: associated
[  240.117402] IPv6: ADDRCONF(NETDEV_CHANGE): wlo1: link becomes ready
[  313.266186] wlo1: deauthenticating from 9c:c7:a6:a8:30:4c by local choice (Reason: 3=DEAUTH_LEAVING)
[  313.754271] IPv6: ADDRCONF(NETDEV_UP): wlo1: link is not ready
[  313.938232] Generic PHY r8169-200:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=r8169-200:00, irq=IGNORE)
[  314.195932] IPv6: ADDRCONF(NETDEV_UP): enp2s0: link is not ready
[  315.805465] r8169 0000:02:00.0 enp2s0: Link is Up - 100Mbps/Full - flow control rx/tx
[  315.805488] IPv6: ADDRCONF(NETDEV_CHANGE): enp2s0: link becomes ready


Code: Select all
uname -a
Linux foo 4.19.0-1-amd64 #1 SMP Debian 4.19.12-1 (2018-12-22) x86_64 GNU/Linux


Code: Select all
lspci -knn | grep Net -A2
03:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter [10ec:b723]
   Subsystem: Hewlett-Packard Company RTL8723BE PCIe Wireless Network Adapter [103c:81c1]
   Kernel driver in use: rtl8723be
   Kernel modules: rtl8723be


Code: Select all
nmcli dev wifi list
IN-USE  SSID                MODE   CHAN  RATE        SIGNAL  BARS  SECURITY
        MyOwnWifi           Infra  3     130 Mbit/s  100     ▂▄▆█  WPA2
        FRITZ!Box 7312      Infra  1     270 Mbit/s  84      ▂▄▆█  WPA1 WPA2
        Vodafone-2D1F       Infra  11    405 Mbit/s  77      ▂▄▆_  WPA2
        ...


Code: Select all
sudo rfkill list all
0: phy0: Wireless LAN
   Soft blocked: no
   Hard blocked: no
1: hci0: Bluetooth
   Soft blocked: no
   Hard blocked: no


Code: Select all
systemctl --type=service  | ag network
networking.service         loaded active exited  Raise network interfaces
NetworkManager.service     loaded active running Network Manager
systemd-resolved.service   loaded active running Network Name Resolution
systemd-timesyncd.service  loaded active running Network Time Synchronization
wicd.service               loaded active running Wicd a wireless and wired network manager for Linux


Code: Select all
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: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 30:e1:71:22:65:0c brd ff:ff:ff:ff:ff:ff
3: wlo1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 26:4c:49:24:93:26 brd ff:ff:ff:ff:ff:ff
5: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 100
    link/none


Code: Select all
cat /etc/resolv.conf
domain fritz.box
search fritz.box
nameserver 192.168.2.1


Code: Select all
cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug enp2s0
iface enp2s0 inet dhcp



Code: Select all
sudo modprobe -rv rtl8723be
rmmod rtl8723be
rmmod rtl_pci
rmmod rtl8723_common
rmmod btcoexist
rmmod rtlwifi
rmmod mac80211
rmmod cfg80211


Code: Select all
cat /etc/modprobe.d/rtl8723be.conf
options rtl8723be fwlps=N ips=N swenc=Y ant_sel=1


Notes on the side:
- I have a 2nd laptop also on debian testing which connects fine
- My router is a fritzbox 7390 with latest firmware.
- I suffered from https://bugs.launchpad.net/ubuntu/+sour ... ug/1521173 so I added "noaer"
- dmesg on boot says bluetooth drivers are missing

Code: Select all
[    3.410478] Bluetooth: hci0: RTL: rom_version status=0 version=1
[    3.410479] Bluetooth: hci0: RTL: rtl: loading rtl_bt/rtl8723b_fw.bin
[    3.411800] bluetooth hci0: firmware: direct-loading firmware rtl_bt/rtl8723b_fw.bin
[    3.411810] Bluetooth: hci0: RTL: rtl: loading rtl_bt/rtl8723b_config.bin
[    3.411822] bluetooth hci0: firmware: failed to load rtl_bt/rtl8723b_config.bin (-2)
[    3.411826] firmware_class: See https://wiki.debian.org/Firmware for information about missing firmware
[    3.411829] bluetooth hci0: Direct firmware load for rtl_bt/rtl8723b_config.bin failed with error -2
[    3.411833] Bluetooth: hci0: RTL: cfg_sz -2, total sz 22496
jimmyD
 
Posts: 8
Joined: 2019-01-31 16:18

Re: RTL8723BE wifi sees wifis but can't connect (DEAUTH_LEAV

Postby bw123 » 2019-01-31 17:47

"active exited" is normal for networking.service it is (only?) used to run the ifup config. It does not do exactly the same thing as the /etc/init.d/networking script so be careful trying to start/restart it to solve or test problems.

I think if it was me, I'd disable nm and wicd and try ifup first to eliminate the scan_rand_mac_address bug and whatever issues wicd might have.

Things may have changed, but in the past, I would never consider having both nm and wicd installed on the same system.
User avatar
bw123
 
Posts: 3787
Joined: 2011-05-09 06:02

Re: RTL8723BE wifi sees wifis but can't connect (DEAUTH_LEAV

Postby jimmyD » 2019-01-31 19:32

Thank you bw123!

Just keep in mind I have not used ifup before, so maybe I did something wrong. Following your advice I did:

Code: Select all
sudo apt-get purge wicd wicd-daemon wicd-gtk network-manager


And added these lines to my /etc/network/interfaces

Code: Select all
auto wlo1
iface wlo1 inet dhcp
  wpa-ssid MyOwnWifi
  wpa-psk <here I put the output of wpa_passphrase MyOwnWifi mypassword>


I used "wlo1" because "ip a" tells me that is the name of my wifi card.
Saved. Now I'm not sure if I need to restart the network service after I edit the file or not?

When I do:

Code: Select all
sudo systemctl restart networking.service

The command does not finish for more than one minute but also does not print anything.

Then I try to connect:

Code: Select all
sudo ifdown wlo1 && sudo ifup wlo1                                                                                     
Killed old client process
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlo1/58:00:e3:67:9d:e7
Sending on   LPF/wlo1/58:00:e3:67:9d:e7
Sending on   Socket/fallback
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlo1/58:00:e3:67:9d:e7
Sending on   LPF/wlo1/58:00:e3:67:9d:e7
Sending on   Socket/fallback
DHCPDISCOVER on wlo1 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on wlo1 to 255.255.255.255 port 67 interval 6
DHCPDISCOVER on wlo1 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on wlo1 to 255.255.255.255 port 67 interval 18
DHCPDISCOVER on wlo1 to 255.255.255.255 port 67 interval 20
DHCPDISCOVER on wlo1 to 255.255.255.255 port 67 interval 5
No DHCPOFFERS received.
No working leases in persistent database - sleeping


I could connect via lan cable using ifup, but still no luck with my wifi.

Code: Select all
sudo iwconfig wlo1                                                                                                     
wlo1      IEEE 802.11  ESSID:off/any 
          Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm   
          Retry short limit:7   RTS thr=2347 B   Fragment thr:off
          Encryption key:off
          Power Management:off


Do you have more advice for me?

PS: I can see in my fritz box that the mac address of my wifi made it into the list, but no more. It did no get an ip.
jimmyD
 
Posts: 8
Joined: 2019-01-31 16:18

Re: RTL8723BE wifi sees wifis but can't connect (DEAUTH_LEAV

Postby Head_on_a_Stick » 2019-01-31 19:47

jimmyD wrote:
Code: Select all
auto wlo1
iface wlo1 inet dhcp
  wpa-ssid MyOwnWifi
  wpa-psk <here I put the output of wpa_passphrase MyOwnWifi mypassword>

You're only supposed to use the psk= line from the wpa_passphrase output (without the psk= bit): https://wiki.debian.org/WiFi/HowToUse#W ... d_WPA2-PSK

Or just enter the plain, unobfuscated password (for test purposes at least).
User avatar
Head_on_a_Stick
 
Posts: 10377
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: RTL8723BE wifi sees wifis but can't connect (DEAUTH_LEAV

Postby shep » 2019-02-01 03:04

In an HP Stream 14 (Intel N4100)I spent about 2 hours today with Buster and an rtl8822BE card. I initially planned to put OpenBSD on the Stream and the rtl8822BE is not currently supported. HP parts manual indicated that the BIOS would not blacklist Intel AC 7265 cards and I found a pull on Ebay for about $8. If your wifi card is easy to access, it may be an option. The intel card worked out of the box both with manual config /etc/network/interfaces and wicd-gtk.
shep
 
Posts: 306
Joined: 2011-03-15 15:22

Re: RTL8723BE wifi sees wifis but can't connect (DEAUTH_LEAV

Postby jimmyD » 2019-02-02 14:15

@Head_on_a_stick That's what I was doing :) But didn't know I can use either clear text or obfuscated

@shep I'm not keen to open my laptop which is still under warranty, especially when the hardware DID work totally fine and stable with an older kernel :(
jimmyD
 
Posts: 8
Joined: 2019-01-31 16:18

Re: RTL8723BE wifi sees wifis but can't connect (DEAUTH_LEAV

Postby bw123 » 2019-02-02 14:50

If you'll notice in wiki example, many times ssid and plaintext pw are enclosed "in quotes" but I'm not sure that is always necessary. I don't use the interfaces file for ssid or psk like that, so I don't have any more advice. There are literally hundreds of threads about how to use wireless, ifupdown, etc.. and there are several well known methods to set it up, one of them is bound to work for you.

Restarting networking.service doesn't do the same thing as "/etc/init.d/networking restart" command that you will find in a lot of older examples on the net.
The better way IMO is ifdown -a first, edit the interfaces file, and then ifup the new config. There's no need to restart anything. Editing the interfaces file while interfaces are up will probably get things into a confused state. Likewise, running dhclient while it already has a lease is probably a bad idea. Take the interfaces down and release dhcp before editing interfaces file.
User avatar
bw123
 
Posts: 3787
Joined: 2011-05-09 06:02

Re: RTL8723BE wifi sees wifis but can't connect (DEAUTH_LEAV

Postby Head_on_a_Stick » 2019-02-02 16:31

In addition to bw123's fine advice above, check for an already-running instance of wpa_supplicant before trying ifupdown, conflict is a definite possibility here:
Code: Select all
pgrep -a wpa_supplicant

Terminate any excess processes with
Code: Select all
# pkill wpa_supplicant

And if you're having problems with DHCP leases then check your router settings and maybe try assigning static IP addresses, this link shows an example for an ethernet connection which you could adapt for wireless:

https://wiki.debian.org/NetworkConfigur ... e_manually

Also, have you tried disabling IPv6?
User avatar
Head_on_a_Stick
 
Posts: 10377
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: RTL8723BE wifi sees wifis but can't connect (DEAUTH_LEAV

Postby shep » 2019-02-02 17:18

For what it is worth, my rtl8822BE ran fine with Arch Linux using the stock 4.19/4.20 kernel. I was surprised when I migrated to Buster w/ 4.19 kernel that it did not work and I suspect the problem is not your network config but an upstream problem with Buster kernel/kernel modules. You could test by compiling your own kernel using newer upstream sources:

https://wiki.debian.org/BuildingKernelFromUpstreamSources.

Or try SID, it has slightly newer source:
SIDhttps://packages.debian.org/sid/kernel/linux-image-4.19.0-2-amd64
vs
BUSTERhttps://packages.debian.org/buster/linux-image-4.19.0-1-amd64.
If it is fixed by the newer kernel I'm sure the Debian Devs would want to include the fix and would appreciate a bug report.
shep
 
Posts: 306
Joined: 2011-03-15 15:22

Re: RTL8723BE wifi sees wifis but can't connect (DEAUTH_LEAV

Postby jimmyD » 2019-02-03 10:49

Thank you very much for your input. I was able to confirm that my /etc/network/interfaces file is correct and does work.
I plugged in a very old wifi usb stick, checked for the device name and copied the lines for wlo1, only changing the name. And am able to access the internet with it just fine. At least no more cable through the room. :)

Also I was able to use ifup to connect the internal wifi to my cell phone hotspot. So I was back to thinking it is a antenna configuration issue. And yes, once I moved my laptop right next to my router it did connect. But only 5 meters away on my desk it is unusable. Ping times go from 20ms to 3000ms.

Should I comment on this bug report that it still exists with a much newer kernel? Or create a new one?

https://bugs.launchpad.net/ubuntu/+sour ... ug/1788997

I have tried with ant_sel=1 which makes it worse, ant_sel=2 which is better but still unusable and this one I found used by others, but did not help:

Code: Select all
echo "options rtl8723be fwlps=N ips=N swenc=Y msi=1 ant_sel=2" | sudo tee /etc/modprobe.d/rtl8723be.conf
jimmyD
 
Posts: 8
Joined: 2019-01-31 16:18

Re: RTL8723BE wifi sees wifis but can't connect (DEAUTH_LEAV

Postby jimmyD » 2019-02-03 10:51

I'm not so confident to compile my own kernel and think I will wait for the regular release cycle. :-/
jimmyD
 
Posts: 8
Joined: 2019-01-31 16:18

Re: RTL8723BE wifi sees wifis but can't connect (DEAUTH_LEAV

Postby shep » 2019-02-03 18:18

Should I comment on this bug report that it still exists with a much newer kernel? Or create a new one?
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1788997
.

That is a Ubuntu bug report. I'm not sure the Debian developers would monitor Ubuntu bugs.
shep
 
Posts: 306
Joined: 2011-03-15 15:22

Re: RTL8723BE wifi sees wifis but can't connect (DEAUTH_LEAV

Postby bw123 » 2019-02-03 22:54

If it is a bug, maybe using ifup with --verbose will get you a clue where the problem is. The connection stuff from the supplicant is in /var/log/daemon.log so that's good for tracking down problems too. wpa_supplicant has like 9 levels of hell, or debug info, so I would go through those before deciding it is a kernel bug.

If it's obviously the module/kernel, yeah file or followup a bug (in debian bugtracker). It could be another component though. I think I would try a live system with nothing added or changed except the latest firmware for the device.

...And yes, once I moved my laptop right next to my router it did connect. But only 5 meters away on my desk it is unusable.
...


Ok I didn't see this before, so you can connect with the device? For sure try a fresh config without all the module params and tweaks.

reportbug program is really good at gathering important info like pkg versions and altered configs, maybe run it against wpasupplicant, and look at what it gathers, but then abort the bug report?
User avatar
bw123
 
Posts: 3787
Joined: 2011-05-09 06:02

Re: RTL8723BE wifi sees wifis but can't connect (DEAUTH_LEAV

Postby jimmyD » 2019-02-05 19:15

Thank you bw123

ifup --verbose did not give me more valuable information. Neither the email draft reportbug created.
I'm downloading a Debian 9.7 live usb image now to try out the hardware on an unaltered OS.
I assume if I cannot make it work I should file a bug for the package "firmware-realtek"?
jimmyD
 
Posts: 8
Joined: 2019-01-31 16:18

Re: RTL8723BE wifi sees wifis but can't connect (DEAUTH_LEAV

Postby jimmyD » 2019-02-05 19:57

Oh holy cow, this is crazy. After googling just one more time I came across that there is not only value 1 and 2 for ant_sel but also 0. :idea:
Plus handy instructions to try them out:

Code: Select all
sudo modprobe -r rtl8723be
sudo modprobe rtl8723be ant_sel=0
iwlist scan | egrep -i 'ssid|quality'
sudo modprobe -r rtl8723be
sudo modprobe rtl8723be ant_sel=1
iwlist scan | egrep -i 'ssid|quality'
sudo modprobe -r rtl8723be
sudo modprobe rtl8723be ant_sel=2
iwlist scan | egrep -i 'ssid|quality'


https://ubuntuforums.org/showthread.php?t=2399293

I removed /etc/modprobe.d/rtl8723be.conf completely first.
While I was downloading the iso torrent with my usb wifi, I was suddenly able to get an ip on my RTL8723BE. bmon then showed traffic on both wifis. I took the usb wifi out and with ant_sel 0, my RTL8723BE was suddenly chugging 4.7 MiB/s. Awesome :lol:

And "ping" here was really often not a good way of trying out if the connection is working or not in this whole story. ctorrent and bmon were much more helpful/forgiving by coincidence.

Ugh, now I pray this is stable. Thank you all!
jimmyD
 
Posts: 8
Joined: 2019-01-31 16:18

Next

Return to System configuration

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable