You are not logged in.

#1 2017-12-02 21:37:43

chiral
Member
Registered: 2016-02-22
Posts: 25

Debugging an inconsistent public WiFi connection

tl;dr: I don't know how to debug a WiFi connection that keeps dropping when I connect to public networks.


A few weeks ago, someone more Linux-savvy than I suggested I couldn't connect to wifi because my built-in card was failing at the hardware level. I bought an inexpensive but well-reviewed USB WiFi dongle, and I've been having trouble getting it to work consistently.

Here's what I know:

- I run a systemd service called NetworkManager
- I configured that service not to manage my ethernet or built-in connection
- I use `nmcli dev wifi connect SSID password PASSWORD` to connect
- Occasionally, the above won't work unless I scan with `nmcli dev wifi list` first
- My connection sometimes stays up for a good long time, and then starts dropping every couple of minutes, requiring me to reconnect or even reboot before I can get on the internet again


When my internet connection fails:
- my desktop panel still shows the IP address I've been assigned
- I can ping that IP address and get a response; however,
- if I ping 8.8.8.8, or the address that I think the router has (based on what I saw in the browser when I clicked through for access), I get "Destination Host Unreachable"
 
I've taken to running `dmesg -w` to try and learn what events are happening when my connection fails, but I don't think there's a message appended when my connection drops. Here is some sample output of that command:

    [  180.383093] IPv6: ADDRCONF(NETDEV_UP): wlp0s20f0u3: link is not ready
    [  180.384556] rtl8192cu: MAC auto ON okay!
    [  180.395306] rtl8192cu: Tx queue select: 0x05
    [  180.898530] IPv6: ADDRCONF(NETDEV_UP): wlp0s20f0u3: link is not ready
    [  181.793087] Bluetooth: hci0: Waiting for firmware download to complete
    [  181.793294] Bluetooth: hci0: Firmware loaded in 1490548 usecs
    [  181.793329] Bluetooth: hci0: Waiting for device to boot
    [  181.809297] Bluetooth: hci0: Device booted in 15602 usecs
    [  181.809582] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-11-5.ddc
    [  181.813371] Bluetooth: hci0: Applying Intel DDC parameters completed
    [  181.941338] rtl8192cu: MAC auto ON okay!
    [  181.952652] rtl8192cu: Tx queue select: 0x05
    [  182.481296] IPv6: ADDRCONF(NETDEV_UP): wlp0s20f0u3: link is not ready
    [  182.543774] IPv6: ADDRCONF(NETDEV_UP): wlp0s20f0u3: link is not ready
    [  183.570728] rtl8192cu: MAC auto ON okay!
    [  183.581656] rtl8192cu: Tx queue select: 0x05
    [  184.111115] IPv6: ADDRCONF(NETDEV_UP): wlp0s20f0u3: link is not ready
    [  191.167891] wlp0s20f0u3: authenticate with 3c:ce:73:1f:9e:02
    [  191.184884] wlp0s20f0u3: send auth to 3c:ce:73:1f:9e:02 (try 1/3)
    [  191.218495] wlp0s20f0u3: authenticated
    [  191.218973] wlp0s20f0u3: associate with 3c:ce:73:1f:9e:02 (try 1/3)
    [  191.243236] wlp0s20f0u3: RX AssocResp from 3c:ce:73:1f:9e:02 (capab=0x401 status=0 aid=65)
    [  191.244329] wlp0s20f0u3: associated
    [  191.244461] IPv6: ADDRCONF(NETDEV_CHANGE): wlp0s20f0u3: link becomes ready
    [  191.323817] wlp0s20f0u3: Limiting TX power to 22 dBm as advertised by 3c:ce:73:1f:9e:02
    [  653.586256] wlp0s20f0u3: deauthenticating from 3c:ce:73:1f:9e:02 by local choice (Reason: 3=DEAUTH_LEAVING)
    [  653.621248] rtl8192cu: MAC auto ON okay!
    [  653.633119] rtl8192cu: Tx queue select: 0x05
    [  654.159451] IPv6: ADDRCONF(NETDEV_UP): wlp0s20f0u3: link is not ready
    [  654.259401] rtl8192cu: MAC auto ON okay!
    [  654.270434] rtl8192cu: Tx queue select: 0x05
    [  654.800130] IPv6: ADDRCONF(NETDEV_UP): wlp0s20f0u3: link is not ready
    [  655.851951] wlp0s20f0u3: authenticate with 3c:ce:73:1f:9e:02
    [  655.868257] wlp0s20f0u3: send auth to 3c:ce:73:1f:9e:02 (try 1/3)
    [  655.897019] wlp0s20f0u3: authenticated
    [  655.898940] wlp0s20f0u3: associate with 3c:ce:73:1f:9e:02 (try 1/3)
    [  655.936963] wlp0s20f0u3: RX AssocResp from 3c:ce:73:1f:9e:02 (capab=0x401 status=0 aid=65)
    [  655.938213] wlp0s20f0u3: associated
    [  655.938356] IPv6: ADDRCONF(NETDEV_CHANGE): wlp0s20f0u3: link becomes ready
    [  656.018267] wlp0s20f0u3: Limiting TX power to 22 dBm as advertised by 3c:ce:73:1f:9e:02


I'm on public wifi most of the time. It's taken me so very, very long to post this. What can I test or configure to keep this constant dropping from happening?

Last edited by chiral (2017-12-02 21:38:23)

Offline

#2 2017-12-02 22:09:08

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Debugging an inconsistent public WiFi connection

It would be a great help if you actually told us what wireless hardware you're using.

Try stopping NetworkManager and connecting manually instead. Does the issue persist?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2017-12-02 22:39:21

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Debugging an inconsistent public WiFi connection

Please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Co … s_and_code



Moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2017-12-03 03:43:22

chiral
Member
Registered: 2016-02-22
Posts: 25

Re: Debugging an inconsistent public WiFi connection

The hardware is an Edimax EW-7811Un 11n Wi-Fi USB Adapter, "nano size."

After stopping NetworkManager.service,
 

$ sudo ip link set wlp0s20f0u3 up                                              
$ wpa_passphrase mySSID mycoolpassword > wpa_supplicant.conf                  
$ sudo mv wpa_supplicant.conf /etc/wpa_supplicant/                           
$ sudo wpa_supplicant -B -i wlp0s20f0u3 -c /etc/wpa_supplicant/wpa_supplicant.conf 
Successfully initialized wpa_supplicant
$ sudo dhcpcd wlp0s20f0u3                                                   
DUID 00:01:00:01:21:b6:28:3f:74:da:38:d5:d2:2c
wlp0s20f0u3: IAID 38:d5:d2:2c
wlp0s20f0u3: adding address fe80::84d2:d521:744:94f8
wlp0s20f0u3: soliciting a DHCP lease
wlp0s20f0u3: soliciting an IPv6 router
wlp0s20f0u3: offered 192.168.43.159 from 192.168.43.1
wlp0s20f0u3: probing address 192.168.43.159/24
wlp0s20f0u3: carrier lost
wlp0s20f0u3: deleting address fe80::84d2:d521:744:94f8
timed out
dhcpcd exited

Trying again, after removing and reinserting the USB dongle,

$ sudo dhcpcd wlp0s20f0u3                                                    
wlp0s20f0u3: waiting for carrier
wlp0s20f0u3: new hardware address: 74:da:38:d5:d2:2c
timed out
dhcpcd exited

Meanwhile, dmesg output was doing a whole lot of this:

[ 4694.224102] wlp0s20f0u3: authenticate with ec:9b:f3:a1:98:30
[ 4694.266277] wlp0s20f0u3: send auth to ec:9b:f3:a1:98:30 (try 1/3)
[ 4695.109955] wlp0s20f0u3: authenticated
[ 4695.112539] wlp0s20f0u3: associate with ec:9b:f3:a1:98:30 (try 1/3)
[ 4695.216414] wlp0s20f0u3: associate with ec:9b:f3:a1:98:30 (try 2/3)
[ 4696.068408] wlp0s20f0u3: RX AssocResp from ec:9b:f3:a1:98:30 (capab=0x411 status=0 aid=1)
[ 4696.070325] wlp0s20f0u3: associated
[ 4696.070822] wlp0s20f0u3: deauthenticating from ec:9b:f3:a1:98:30 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 4699.716804] wlp0s20f0u3: authenticate with ec:9b:f3:a1:98:30
[ 4699.728215] wlp0s20f0u3: send auth to ec:9b:f3:a1:98:30 (try 1/3)
[ 4699.733808] wlp0s20f0u3: authenticated
[ 4699.735213] wlp0s20f0u3: associate with ec:9b:f3:a1:98:30 (try 1/3)
[ 4699.786863] wlp0s20f0u3: RX AssocResp from ec:9b:f3:a1:98:30 (capab=0x411 status=0 aid=1)
[ 4699.788256] wlp0s20f0u3: associated
[ 4699.788610] wlp0s20f0u3: deauthenticating from ec:9b:f3:a1:98:30 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 4704.294555] wlp0s20f0u3: authenticate with ec:9b:f3:a1:98:30
[ 4704.305751] wlp0s20f0u3: send auth to ec:9b:f3:a1:98:30 (try 1/3)
[ 4704.320722] wlp0s20f0u3: authenticated
[ 4704.324255] wlp0s20f0u3: associate with ec:9b:f3:a1:98:30 (try 1/3)
[ 4704.347329] wlp0s20f0u3: RX AssocResp from ec:9b:f3:a1:98:30 (capab=0x411 status=0 aid=1)
[ 4704.348510] wlp0s20f0u3: associated
[ 4704.349337] wlp0s20f0u3: deauthenticating from ec:9b:f3:a1:98:30 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 4710.312383] wlp0s20f0u3: authenticate with ec:9b:f3:a1:98:30
[ 4710.323359] wlp0s20f0u3: send auth to ec:9b:f3:a1:98:30 (try 1/3)
[ 4710.325046] wlp0s20f0u3: authenticated
[ 4710.326779] wlp0s20f0u3: associate with ec:9b:f3:a1:98:30 (try 1/3)
[ 4710.394846] wlp0s20f0u3: RX AssocResp from ec:9b:f3:a1:98:30 (capab=0x411 status=0 aid=1)
[ 4710.396009] wlp0s20f0u3: associated
[ 4710.397105] wlp0s20f0u3: deauthenticating from ec:9b:f3:a1:98:30 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 4715.771888] wlp0s20f0u3: authenticate with ec:9b:f3:a1:98:30
[ 4715.783297] wlp0s20f0u3: send auth to ec:9b:f3:a1:98:30 (try 1/3)
[ 4715.787799] wlp0s20f0u3: authenticated
[ 4715.793034] wlp0s20f0u3: associate with ec:9b:f3:a1:98:30 (try 1/3)
[ 4715.826279] wlp0s20f0u3: RX AssocResp from ec:9b:f3:a1:98:30 (capab=0x411 status=0 aid=1)
[ 4715.827354] wlp0s20f0u3: associated
[ 4715.827487] wlp0s20f0u3: deauthenticating from ec:9b:f3:a1:98:30 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 4726.641326] wlp0s20f0u3: authenticate with ec:9b:f3:a1:98:30
[ 4726.652161] wlp0s20f0u3: send auth to ec:9b:f3:a1:98:30 (try 1/3)
[ 4726.755041] wlp0s20f0u3: send auth to ec:9b:f3:a1:98:30 (try 2/3)
[ 4726.770776] wlp0s20f0u3: authenticated
[ 4726.771667] wlp0s20f0u3: associate with ec:9b:f3:a1:98:30 (try 1/3)

Offline

#5 2017-12-03 04:21:28

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Debugging an inconsistent public WiFi connection

Please paste the output of:

systemctl list-unit-files --state=enabled

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2017-12-03 19:02:19

chiral
Member
Registered: 2016-02-22
Posts: 25

Re: Debugging an inconsistent public WiFi connection

$ systemctl list-unit-files --state=enabled 
UNIT FILE                                   STATE  
org.cups.cupsd.path                         enabled
autovt@.service                             enabled
avahi-daemon.service                        enabled
dbus-org.freedesktop.Avahi.service          enabled
dbus-org.freedesktop.ModemManager1.service  enabled
dbus-org.freedesktop.NetworkManager.service enabled
dbus-org.freedesktop.nm-dispatcher.service  enabled
display-manager.service                     enabled
gdm.service                                 enabled
getty@.service                              enabled
haveged.service                             enabled
ModemManager.service                        enabled
NetworkManager-dispatcher.service           enabled
NetworkManager.service                      enabled
org.cups.cupsd.service                      enabled
systemd-timesyncd.service                   enabled
avahi-daemon.socket                         enabled
org.cups.cupsd.socket                       enabled
remote-fs.target                            enabled
pamac-cleancache.timer                      enabled

Offline

#7 2017-12-03 19:39:25

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Debugging an inconsistent public WiFi connection

You have NetworkManager enabled: so connecting manually will conflict and exhibit exactly the symptoms you are seeing.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2017-12-03 21:12:12

chiral
Member
Registered: 2016-02-22
Posts: 25

Re: Debugging an inconsistent public WiFi connection

But, if I run `nmcli` after stopping Network Manager, I get

Error: NetworkManager is not running.

From this I inferred that `nmcli` is an interface to Network Manager.

Offline

#9 2017-12-04 18:42:11

chiral
Member
Registered: 2016-02-22
Posts: 25

Re: Debugging an inconsistent public WiFi connection

Let me try saying this a different way. My goals as a user are:

- connect to wifi by entering an SSID and password somewhere
- stay connected longer than 2 minutes
- reconnect to networks I've connected to before
- either avoid using an applet like nm-applet, because I'm not using a desktop environment that comes with them configured, or,
- find a way to put such an applet into my i3 configuration.

I don't actually care whether I use NetworkManager, nmcli, a combination, or what --- I want to arrive at a location, find the SSID and password, and connect, without having to re-read the docs for wpa_supplicant connections. Can I get a recommendation on what services I need to enable or disable, and what interface I should use, to accomplish these goals?

Last edited by chiral (2017-12-04 18:45:23)

Offline

#10 2017-12-04 19:35:51

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Debugging an inconsistent public WiFi connection

chiral wrote:

But, if I run `nmcli` after stopping Network Manager, I get

Error: NetworkManager is not running.

From this I inferred that `nmcli` is an interface to Network Manager.

That's not how you connect manually. Read the wiki.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#11 2017-12-04 20:07:50

chiral
Member
Registered: 2016-02-22
Posts: 25

Re: Debugging an inconsistent public WiFi connection

The commands,

$ sudo ip link set wlp0s20f0u3 up                                              
$ wpa_passphrase mySSID mycoolpassword > wpa_supplicant.conf                  
$ sudo mv wpa_supplicant.conf /etc/wpa_supplicant/                           
$ sudo wpa_supplicant -B -i wlp0s20f0u3 -c /etc/wpa_supplicant/wpa_supplicant.conf 

are from the wiki, under manual setup. https://wiki.archlinux.org/index.php/Wi … nual_setup

Offline

#12 2017-12-04 20:12:48

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Debugging an inconsistent public WiFi connection

Yes, I'm familiar with the wiki...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#13 2017-12-04 20:16:12

chiral
Member
Registered: 2016-02-22
Posts: 25

Re: Debugging an inconsistent public WiFi connection

Great. Then maybe you know which page on the wiki, other than the section on connecting manually, that will tell me how to connect manually. I would really appreciate that information to read.

NOTE: As an accidentally discovered workaround, pinging a well-known Internet address and leaving that ping process running seems to be keeping my connection alive.

Last edited by chiral (2017-12-04 20:30:14)

Offline

#14 2017-12-04 20:32:30

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Debugging an inconsistent public WiFi connection

Well I'm not going to retype the page for you. You seem to have most of it in #11 (although I have no idea why you stopped before finishing the process).


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#15 2017-12-04 21:27:53

chiral
Member
Registered: 2016-02-22
Posts: 25

Re: Debugging an inconsistent public WiFi connection

I continued, as described in the wiki. The next command I entered after those was

$ sudo dhcpcd wlp0s20f0u3

and its result was

DUID 00:01:00:01:21:b6:28:3f:74:da:38:d5:d2:2c
wlp0s20f0u3: IAID 38:d5:d2:2c
wlp0s20f0u3: adding address fe80::84d2:d521:744:94f8
wlp0s20f0u3: soliciting a DHCP lease
wlp0s20f0u3: soliciting an IPv6 router
wlp0s20f0u3: offered 192.168.43.159 from 192.168.43.1
wlp0s20f0u3: probing address 192.168.43.159/24
wlp0s20f0u3: carrier lost
wlp0s20f0u3: deleting address fe80::84d2:d521:744:94f8
timed out
dhcpcd exited

and the dmesg output during this period was a cycle of

[ 4694.224102] wlp0s20f0u3: authenticate with ec:9b:f3:a1:98:30
[ 4694.266277] wlp0s20f0u3: send auth to ec:9b:f3:a1:98:30 (try 1/3)
[ 4695.109955] wlp0s20f0u3: authenticated
[ 4695.112539] wlp0s20f0u3: associate with ec:9b:f3:a1:98:30 (try 1/3)
[ 4695.216414] wlp0s20f0u3: associate with ec:9b:f3:a1:98:30 (try 2/3)
[ 4696.068408] wlp0s20f0u3: RX AssocResp from ec:9b:f3:a1:98:30 (capab=0x411 status=0 aid=1)
[ 4696.070325] wlp0s20f0u3: associated
[ 4696.070822] wlp0s20f0u3: deauthenticating from ec:9b:f3:a1:98:30 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 4699.716804] wlp0s20f0u3: authenticate with ec:9b:f3:a1:98:30
[ 4699.728215] wlp0s20f0u3: send auth to ec:9b:f3:a1:98:30 (try 1/3)
[ 4699.733808] wlp0s20f0u3: authenticated
[ 4699.735213] wlp0s20f0u3: associate with ec:9b:f3:a1:98:30 (try 1/3)
[ 4699.786863] wlp0s20f0u3: RX AssocResp from ec:9b:f3:a1:98:30 (capab=0x411 status=0 aid=1)

messages

Offline

#16 2017-12-04 22:48:50

seth
Member
Registered: 2012-09-03
Posts: 51,154

Re: Debugging an inconsistent public WiFi connection

Power saving, probably usb-autosuspend. (Afaics the device module itself provides no PM features)
Do you use stuff like powertop, tlp or laptop tools? (The implication is to try without them first and during testing the below)

https://wiki.archlinux.org/index.php/Po … utosuspend

echo "-1" | sudo tee /sys/module/usbcore/parameters/autosuspend

This will disable autosuspend for any device added *after* the call and this boot cycle (it. it does not survive a reboot), test whether that stabilizes the wifi.

Online

Board footer

Powered by FluxBB