Solved rtwn: Lenovo T430, wireless, no able to connect to AP

Hello,

I'm on 11-RELEASE on my Lenovo T430 laptop. I have some trouble to get the wireless network to work. The weird part is, that it works in rare occations. So every 50th boot or so, it connects to my AP just fine. However, rebooting or restarting or changing the interface will break the connection and it won't reconnect.

Hardware is the PCIe version of the RTL8188CE adapter:

pciconf -lcve
Code:
rtwn0@pci0:3:0:0:    class=0x028000 card=0x819510ec chip=0x817610ec rev=0x01 hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8188CE 802.11b/g/n WiFi Adapter'
    class      = network
    cap 01[40] = powerspec 3  supports D0 D1 D2 D3  current D0
    cap 05[50] = MSI supports 1 message, 64 bit enabled with 1 message
    cap 10[70] = PCI-Express 2 endpoint max data 128(128) RO
                 link x1(x1) speed 2.5(2.5) ASPM disabled(L0s/L1)
    ecap 0001[100] = AER 1 0 fatal 2 non-fatal 1 corrected
    ecap 0002[140] = VC 1 max VC0
    ecap 0003[160] = Serial 1 019181feff4ce000
  PCI-e errors = Correctable Error Detected
                 Non-Fatal Error Detected
                 Unsupported Request Detected
     Non-fatal = Completer Abort
                 Unsupported Request
     Corrected = Advisory Non-Fatal Error

/boot/loader.conf
Code:
if_rtwn_load="YES"
legal.realtek.license_ack=1

I copied the firmware files from /sys/contrib/dev/rtwn/ to /etc/firmware/

/etc/rc.conf
Code:
ifconfig_em0="up"
ifconfig_rtwn0="wlanether 00:21:cc:d3:e7:1b regdomain ETSI country DE"
wlans_rtwn0="wlan0"
ifconfig_wlan0="WPA"
cloned_interfaces="lagg0"
ifconfig_lagg0="laggproto failover laggport em0 laggport wlan0 DHCP"
/etc/wpa_supplicant.conf
Code:
network={
    ssid="AntiGeek 802.11bg"
    priority=1
    bssid=90:84:0d:db:07:6d
    psk=PASSWORDHASH
}

Software versions:
* 11.0-RELEASE-p2 (GENERIC amd64)
* wpa_supplicant v2.5 (I also tried the ports version)

Once I set the interface active with service netif restart, the following output gets written to /var/log/messages. It loops forever and never stays connected, even ifconfig(8) shows an associations for 1-2 seconds while the device is "up".

Step 1: Successfully associated
Code:
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500   ether 00:21:cc:d3:e7:1b
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
    media: IEEE 802.11 Wireless Ethernet OFDM/54Mbps mode 11g
    status: associated
    ssid "AntiGeek 802.11bg" channel 8 (2447 MHz 11g) bssid 90:84:0d:db:07:6d
    regdomain ETSI country DE authmode WPA2/802.11i privacy ON
    deftxkey UNDEF txpower 30 bmiss 7 scanvalid 60 bgscan bgscanintvl 300
    bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS wme roaming MANUAL
    groups: wlan

Step 2: The following log entries appear:
Code:
Nov  6 12:46:55 coffee kernel: wlan0: link state changed to DOWN
Nov  6 12:46:55 coffee wpa_supplicant[36053]: wlan0: CTRL-EVENT-DISCONNECTED bssid=90:84:0d:db:07:6d reason=3 locally_generated=1
Nov  6 12:46:55 coffee wpa_supplicant[36053]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="AntiGeek 802.11bg" auth_failures=4 duration=73 reason=CONN_FAILED

Step 3: The device scans again and eventually starts over (goto step 1)
Code:
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether 00:21:cc:d3:e7:1b
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
    media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
    status: no carrier
    ssid "" channel 2 (2417 MHz 11g)
    regdomain ETSI country DE authmode WPA1+WPA2/802.11i privacy ON
    deftxkey UNDEF txpower 30 bmiss 7 scanvalid 60 bgscan bgscanintvl 300
    bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS wme roaming MANUAL
    groups: wlan


Full log /var/log/messages (it loops forever)
Code:
Nov  6 12:32:29 coffee wpa_supplicant[13913]: wlan0: Trying to associate with 90:84:0d:db:07:6d (SSID='AntiGeek 802.11bg' freq=2447 MHz)
Nov  6 12:32:39 coffee wpa_supplicant[13913]: wlan0: Authentication with 90:84:0d:db:07:6d timed out.
Nov  6 12:32:39 coffee wpa_supplicant[13913]: wlan0: CTRL-EVENT-DISCONNECTED bssid=90:84:0d:db:07:6d reason=3 locally_generated=1
Nov  6 12:32:41 coffee wpa_supplicant[13913]: wlan0: Trying to associate with 90:84:0d:db:07:6d (SSID='AntiGeek 802.11bg' freq=2447 MHz)
Nov  6 12:32:51 coffee wpa_supplicant[13913]: wlan0: Authentication with 90:84:0d:db:07:6d timed out.
Nov  6 12:32:51 coffee wpa_supplicant[13913]: wlan0: CTRL-EVENT-DISCONNECTED bssid=90:84:0d:db:07:6d reason=3 locally_generated=1
Nov  6 12:32:51 coffee wpa_supplicant[13913]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="AntiGeek 802.11bg" auth_failures=1 duration=10 reason=CONN_FAILED
Nov  6 12:33:07 coffee wpa_supplicant[13913]: wlan0: CTRL-EVENT-SSID-REENABLED id=0 ssid="AntiGeek 802.11bg"
Nov  6 12:33:07 coffee wpa_supplicant[13913]: wlan0: Trying to associate with 90:84:0d:db:07:6d (SSID='AntiGeek 802.11bg' freq=2447 MHz)
Nov  6 12:33:07 coffee wpa_supplicant[13913]: wlan0: Associated with 90:84:0d:db:07:6d
Nov  6 12:33:07 coffee kernel: wlan0: link state changed to UP
Nov  6 12:33:17 coffee wpa_supplicant[13913]: wlan0: Authentication with 90:84:0d:db:07:6d timed out.
Nov  6 12:33:17 coffee kernel: wlan0: link state changed to DOWN
Nov  6 12:33:17 coffee wpa_supplicant[13913]: wlan0: CTRL-EVENT-DISCONNECTED bssid=90:84:0d:db:07:6d reason=3 locally_generated=1
Nov  6 12:33:17 coffee wpa_supplicant[13913]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="AntiGeek 802.11bg" auth_failures=2 duration=31 reason=CONN_FAILED
Nov  6 12:33:47 coffee wpa_supplicant[13913]: wlan0: CTRL-EVENT-SSID-REENABLED id=0 ssid="AntiGeek 802.11bg"
Nov  6 12:33:47 coffee wpa_supplicant[13913]: wlan0: Trying to associate with 90:84:0d:db:07:6d (SSID='AntiGeek 802.11bg' freq=2447 MHz)
Nov  6 12:33:47 coffee wpa_supplicant[13913]: wlan0: Associated with 90:84:0d:db:07:6d
Nov  6 12:33:47 coffee kernel: wlan0: link state changed to UP
Nov  6 12:33:51 coffee wpa_supplicant[13913]: wlan0: CTRL-EVENT-DISCONNECTED bssid=90:84:0d:db:07:6d reason=0
Nov  6 12:33:51 coffee kernel: wlan0: link state changed to DOWN
Nov  6 12:33:51 coffee wpa_supplicant[13913]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="AntiGeek 802.11bg" auth_failures=3 duration=30 reason=CONN_FAILED

The AP is an old Apple Time Capsule. I tried different configurations and even an open network without authentication, no luck:

/var/log/messages when connecting to an open network (no authentication)
Code:
Nov  6 13:03:09 coffee kernel: wlan0: Ethernet address: 20:68:9d:48:81:cd
Nov  6 13:03:09 coffee wpa_supplicant[40246]: Successfully initialized wpa_supplicant
Nov  6 13:03:11 coffee kernel: rtwn0: timeout waiting for firmware initialization to complete
Nov  6 13:03:21 coffee wpa_supplicant[40249]: wlan0: Trying to associate with 9e:84:0d:db:07:6d (SSID='open_wlan' freq=2447 MHz)
Nov  6 13:03:31 coffee wpa_supplicant[40249]: wlan0: Authentication with 9e:84:0d:db:07:6d timed out.
Nov  6 13:03:31 coffee wpa_supplicant[40249]: wlan0: CTRL-EVENT-DISCONNECTED bssid=9e:84:0d:db:07:6d reason=3 locally_generated=1
Nov  6 13:03:33 coffee wpa_supplicant[40249]: wlan0: Trying to associate with 9e:84:0d:db:07:6d (SSID='open_wlan' freq=2447 MHz)
Nov  6 13:03:43 coffee wpa_supplicant[40249]: wlan0: Authentication with 9e:84:0d:db:07:6d timed out.
Nov  6 13:03:43 coffee wpa_supplicant[40249]: wlan0: CTRL-EVENT-DISCONNECTED bssid=9e:84:0d:db:07:6d reason=3 locally_generated=1
Nov  6 13:03:43 coffee wpa_supplicant[40249]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="open_wlan" auth_failures=1 duration=10 reason=CONN_FAILED

The Lenovo T430 is a quiet common Laptop - so I hope that anybody has solved this issue or knows a workaround.

Best Regards,
Stefan
 
You can find more information in the bug report. The issue is resolved meanwhile. It was a configuration issue.

A working configuration looks like this:
ifconfig_em0="up"
wlans_rtwn0="wlan0"
ifconfig_wlan0="WPA country DE"

cloned_interfaces="lagg0"
ifconfig_lagg0="ether 20:68:9d:48:81:cd laggproto failover laggport em0 laggport wlan0 DHCP"


Pitfalls and learnings:
  • ifconfig_rtwn0="ether 00:21:cc:d3:e7:1b"
    Setting the ethernet address on the rtwn0 device causes issues. No matter if set via ether or wlanaddr.
  • ifconfig_wlan0="WPA ether 00:21:cc:d3:e7:1b"
    This does also not work for for me. Sequence problem: setting WPA to the end works.
I found that changing the ethernet address on the rtwn driver is somehow troublesome. Playing with different settings has lead to many system freezes. So I decided to configure the rtwn/wlan0 device only minimal and adapt everything around it. So I do not change the wlan MAC, but I change all other MAC adresses to match the one of the wlan adapter. I'm now doing so on the lagg0 device, which syncs the attached device MACs.

I noticed that adding "country DE" speeds up the connection process massively (I'm in Germany and the router is configured also for the German standards), so you want to set this for your country. I noticed that changing the country and then restarting the interface via "service netif restart" leads to a system freeze in about 20% of the cases.

Also when restarting netif, you need to manually kill wpa_supplicant upfront (not device specific, I just want to mention it...)

I still have some trouble with the device. Sometimes it connects and I can get ~20mbit/s with it. More often it connects and I get no more than 1Mbit/s (measured with iperf on the local network and via speedtest.net). It also gets unstable under heavly load. Downloading a file makes it very, very hard to open a website in parallel. Sometimes it stalles out until the transfer is complete.

I'm happy that I can read email via wifi, but optimisation ideas are very welcome! :)
 
  • Thanks
Reactions: mag
Thank you sHagen. I have a lenovo thinkpad X220 running 11.0-STABLE and i'm troubled with exactly the same problem. Hope someone has a solution for that.

My device in pciconf -lv is 'RTL8188CE 802.11b/g/n WiFi Adapter' and i have the following configuration:

/boot/loader.conf
Code:
if_rtwn_load="YES"
legal.realtek.license_ack=1
rtwn-rtl8192cfwU_load="YES"
rtwn-rtl8192cfwU_B_load="YES"

/etc/rc.conf
Code:
# Networking
wlans_rtwn0="wlan0"
ifconfig_wlan0="WPA"
ifconfig_em0="DHCP"
ifconfig_em0_ipv6="inet6 accept_rtadv"
 
Hi mag, what exactly is your problem? What does ifconfig show? You have the correct /etc/wpa_supplicant.conf in place?

With the config above the association with the AP should work. However no IP address will be assinged because you've not specified DHCP.

Change:
ifconfig_wlan0="WPA"
to:
ifconfig_wlan0="WPA SYNCDHCP"
or
ifconfig_wlan0="WPA DHCP"
 
k.jacker the link you've provided doesn't exist.

sHagen I'm manually running dhclient wlan0 in order to receive an ip address.
But whenever i run service netif restart wlan0 i can inspect in dmesg that a strange message about rtwn() driver appears (something about initialization timeout). I'm not in front in my computer right now but i'll post the message here later.

I can also inspect that after receiving an ip address and working for 1 or 2 minutes the speed of my laptops internet connection deprives substantially and is never restored.

Thank you for your info.
 
Back
Top