LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-05-2016, 11:09 AM   #1
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Is there any reason why a usb wireless dongle would be affected by the presence of a usb disk?


I have a Ralink rt73usb wireless dongle that normally works without any problems. However I have noticed that when I have a pen drive plugged into an adjacent socket, the dongle plays up and I can't get the interface to work.

I don't think it's anything to do with the seating of the dongle in its socket, because that would prevent wlan0 from coming up at all. In fact it does come up as a local interface but fails to communicate properly with my router. It gets as far as sending out a DHCP request but then claims to have received no offers. ip link show gives "No carrier".

Can anyone suggest a way of investigating this. It's a trivial problem but it's illogical and it annoys me.
 
Old 12-05-2016, 01:14 PM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Probably the first place to start is with the lsusb -v command.

Also, carefully look at the system logs (probably /var/log/syslog or something like it ...) before and after you insert or remove these various devices.

If you want to thoroughly diagnose a situation like this, yeah it's a bit of work, but ... you should observe all possible situations, and take notes:
  • Disk (alone) is inserted, then removed.
  • Wireless (again, alone), is inserted, then removed.
  • Wireless inserted, then disk. (Then two possibilities as to which one is removed first.)
  • Disk first ... "ditto (two)."
Two entirely different software agents will respond in due course, both to the insertion of their device-of-interest, and to its removal. Looks like there are six total possibilities here.

Methodically work through all six of them and you should be able to find your problem, then tell the rest of us and mark this thread [SOLVED].

(And, mind you, I am not making any sort of 'humor [at your expense]' here!) This seems to be 'some kind of a timing problem,' and there are a mere six possible courses to consider.

Last edited by sundialsvcs; 12-05-2016 at 01:15 PM.
 
1 members found this post helpful.
Old 12-05-2016, 05:57 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
ideas.

interference, power issue, controller borked, connector borked, poor alignment.
 
Old 12-06-2016, 07:07 AM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574

Original Poster
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
It doesn't depend on a second usb device being connected. Today I booted with just the dongle and it failed. I've checked the logs carefully, comparing failed and successful attempts. In both cases the usb device is recognised and the correct driver loaded, followed by the loading of requested firmware. Then the device requests a DHCP address like this:
Code:
[   57.789572] wlan0: authenticate with 00:13:f7:45:a8:ff
[   58.022698] wlan0: send auth to 00:13:f7:45:a8:ff (try 1/3)
[   58.026270] wlan0: authenticated
[   58.028162] wlan0: associate with 00:13:f7:45:a8:ff (try 1/3)
[   58.037779] wlan0: RX AssocResp from 00:13:f7:45:a8:ff (capab=0x471 status=0 aid=2)
[   58.078671] wlan0: associated
In a bad run, this happens repeatedly, in a good run only once or twice.

syslog has it like this:
Code:
Nov  6 17:17:09 Oldboy wpa_supplicant[3606]: wlan0: Trying to associate with 00:13:f7:45:a8:ff (SSID='Barrier' freq=2462 MHz)
Nov  6 17:17:09 Oldboy kernel: [  551.772234] wlan0: associate with 00:13:f7:45:a8:ff (try 1/3)
Nov  6 17:17:09 Oldboy kernel: [  551.784323] wlan0: RX AssocResp from 00:13:f7:45:a8:ff (capab=0x471 status=0 aid=1)
Nov  6 17:17:09 Oldboy kernel: [  551.825137] wlan0: associated
Nov  6 17:17:09 Oldboy kernel: [  551.825332] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
Nov  6 17:17:09 Oldboy wpa_supplicant[3606]: wlan0: Associated with 00:13:f7:45:a8:ff
Nov  6 17:17:09 Oldboy wpa_supplicant[3606]: wlan0: WPA: Key negotiation completed with 00:13:f7:45:a8:ff [PTK=CCMP GTK=CCMP]
Nov  6 17:17:09 Oldboy wpa_supplicant[3606]: wlan0: CTRL-EVENT-CONNECTED - Connection to 00:13:f7:45:a8:ff completed [id=0 id_str=]
But today it came up quite suddenly and spontaneously about half an hour after booting.

It must be bad seating after all.
 
Old 12-06-2016, 11:23 AM   #5
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574

Original Poster
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Well, I've established that the presence of another usb device is not always necessary to cause the problem. The two usb sockets are adjacent, so plugging in another device could affect the seating of the dongle (which is quite large). But I'm still dissatisfied. Previous experience with usb suggests to me that a badly seated device usually affects the usb controller, which reports that the device is being repeatedly removed and reinserted. That isn't happening here. Instead the problems arise later, during dhcp negotiation.

One problem is that I have no idea how wpa_supplicant and the dhcp client cooperate over this job. Only wpa_supplicant and the kernel seem to report to syslog. There appear to be two steps: authentication and association. I assume authentication means that the router has decrypted the request and got plain text, and can therefore confirm that wpa_supplicant is using the correct key. But what is association? It's clearly not the association of an IP address with the card because that isn't happening.

PS: just found this. It's very helpful.

What happened this morning is that I booted around 12:00 and wifi didn't come up, but it came up spontaneously around 12:27 according to syslog. Any ideas?

Last edited by hazel; 12-06-2016 at 11:37 AM.
 
Old 12-06-2016, 12:45 PM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Based on what I am reading so far, I suggest that "USB is a red herring."

Most likely, your true culprit is "wpa_supplicant key-renegotiation," which indeed does occur "from time to time" and which certainly could have occurred "after about half an hour."

(So far as I know, the log in post #4 indicates successful(!) re-negotiation. And yet, the only subsequent comment you make refers to "bad seating after all.")

Therefore, I suggest that you should pursue this problem henceforth as: "never mind the fact that the interface is USB." The true root-cause is most likely to be the supplicant. I am so-far of the opinion that it has nothing to do with "seating," nor with any aspect of your [USB] hardware.

The difference between these two software agents is as follows:
  1. "wpa_supplicant" is responsible for periodically re-negotiating a random hardware cipher-key. (This is the primary security-improvement of WPAx versus WEP: although the same underlying hardware-encryption technology is still used, the key is no longer "simply, and unchangingly" tied to a "simple password." Instead, the two parties periodically negotiate a new key.)
  2. "dhcp_agent" is responsible for talking to a DHCP server to establish a local IP-address. (It is used in any network connection, "wireless" or not.) Ordinarily, this agent should perform and should complete its negotiations only once, and the periodic re-negotiation of a cipher key (by "wpa_supplicant") should not interfere with this, nor even be visible to it. The fact that you see "dhcp_agent" becoming involved again, indicates simply that the link dropped ... hence, "wpa_supplicant" did not succeed in doing its job.
Your "root cause problem" therefore appears now-revealed to be (IMHO) ... not USB, but the supplicant.

Last edited by sundialsvcs; 12-06-2016 at 12:48 PM.
 
1 members found this post helpful.
Old 12-06-2016, 01:08 PM   #7
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574

Original Poster
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Quote:
Originally Posted by sundialsvcs View Post
Most likely, your true culprit is "wpa_supplicant key-renegotiation," which indeed does occur "from time to time" and which certainly could have occurred "after about half an hour."
That's a huge step forward!
Quote:
(So far as I know, the log in post #4 indicates successful(!) re-negotiation.)
Yes, sorry. Tomorrow I'll post up a bad one so that you can see what that looks like.

Quote:
The difference between these two software agents is as follows: "wpa_supplicant" is responsible for periodically re-negotiating a random hardware cipher-key. (This is the primary security-improvement of WPAx versus WEP: although the same underlying hardware-encryption technology is still used, the key is no longer "simply, and unchangingly" tied to a "simple password." Instead, the two parties periodically negotiate a new key.)
So they use one-time keys? How are these related to the permanent shared secret that I created? A link would be useful.
Quote:
"dhcp_agent" is responsible for talking to a DHCP server to establish a local IP-address. Ordinarily, this agent should perform and should complete its negotiations only once, and the periodic re-negotiation of a cipher key (by "wpa_supplicant") should not interfere with this, nor even be visible to it. The fact that you see "dhcp_agent" becoming involved again, indicates simply that the link dropped ... hence, "wpa_supplicant" did not succeed in doing its job.
Well, now at least I know what to look for. My current guess is that dhcpc failed to find the server simply because there was no carrier. That's irrelevant. wpa is the system that's misbehaving. Tomorrow is another day!

Last edited by hazel; 12-06-2016 at 01:10 PM.
 
Old 12-07-2016, 11:29 AM   #8
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574

Original Poster
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
So here is an attachment showing today's work. wifi failed to come on at boot but it did later on. Maybe someone can see the difference between the unsuccessful attempts and the final successful one.
Attached Files
File Type: txt dongle.txt (9.5 KB, 9 views)
 
Old 12-25-2016, 01:18 PM   #9
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574

Original Poster
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
I'm bumping this thread because I've discovered something new and potentially useful. As you can see from the attachment to the previous post, the dongle will authenticate and associate with the router successfully but then deauthenticates before the dhcp client can make use of the link. And this happens repeatedly.

Dec 7 11:50:54 Oldboy kernel: [ 118.646471] wlan0: deauthenticating from 00:13:f7:45:a8:ff by local choice (Reason: 3=DEAUTH_LEAVING)

I assumed from this that the dongle was making some kind of decision to break the link for reasons that were not being made clear. Isn't that what you would naturally assume from the reference to "local choice"? Apparently that is not so. After much browsing, I found a list of the numeric codes for these reasons for deauthenticating at http://www.aboutcher.co.uk/2012/07/l...d-reason-codes .
Reason 3 is given as "The access point went offline, deauthenticating the client." In other words, it's the router that keeps dropping the connection. Now can anyone suggest why that is happening?
 
Old 12-26-2016, 07:01 AM   #10
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574

Original Poster
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
I give up! I spent most of yesterday evening googling this error message and concluded that even if it is the router that drops the connection, it does so because of misbehaviour by the client. For example, there was a big bug report a few years ago with contributions from over 100 Ubuntards who found their wifi didn't work properly any more after they upgraded to Lucid Lynx. Same symptoms: the NIC authenticated, associated, and then deauthenticated with reason 3. Many of them found "solutions" and curiously every one of these worked brilliantly for some users and not at all for others. And no one ever explained why.

I wrote out all these solutions, determined to go through them systematically today. I also planned to test the router by using my laptop, littleboy, first downstairs and then upstairs in the room where oldboy lives to see if there was any difference in reception. And waddyaknow! Wifi on oldboy came up at boot just the way it's supposed to. It hasn't done that for weeks. So no chance of testing anything.

I've decided that computers are just irrational and that I shall never understand them if I live to be 100.

Last edited by hazel; 12-26-2016 at 07:02 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Wireless dongle recommendations gusgorman Linux - Networking 5 11-21-2013 08:59 AM
Wireless N USB dongle Edimaxx EW-7811Un sysrez Linux - Hardware 11 08-21-2011 05:37 AM
I need a recommendation for a wireless USB dongle IMNOboist Linux - Hardware 2 10-15-2010 02:55 AM
Will someone suggest a usb wireless dongle dts0001 Linux - Networking 2 06-30-2009 02:19 AM
usb wireless dongle to use mode master +Yan Linux - Hardware 0 11-06-2008 08:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration