Fix Wireless Disconnects in Linux

By | 2013/10/22

If your Linux wireless constantly disconnects, it could be from repeated attempts related to something called CRDA. Trying the following below may help fix this for you!


The dmesg command will show something like this when a disconnect occurs:

[ 3088.520304] wlan0: deauthenticating from 00:xx:xx:xx:xx:xx by local choice (reason=3)
[ 3088.531710] cfg80211: Calling CRDA to update world regulatory domain
[ 3088.542515] cfg80211: World regulatory domain updated:
[ 3088.542519] cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 3088.542521] cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 3088.542524] cfg80211:     (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[ 3088.542526] cfg80211:     (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[ 3088.542528] cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 3088.542530] cfg80211:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 3094.553232] wlan0: authenticate with 00:xx:xx:xx:xx:xx (try 1)
[ 3094.556240] wlan0: authenticated
[ 3094.556978] wlan0: associate with 00:xx:xx:xx:xx:xx (try 1)
[ 3094.559466] wlan0: RX ReassocResp from 00:xx:xx:xx:xx:xx (capab=0x431 status=0 aid=6)
[ 3094.559473] wlan0: associated

To fix the disconnects, set the regulatory domain to your location. For example the Debian file to edit is /etc/default/crda

sudo vim /etc/default/crda

Set REGDOMAIN= to your regulatory domain. I’m in the US, so mine is going to be US.

stmiller@bruckner:~$ cat /etc/default/crda 
# Set REGDOMAIN to a ISO/IEC 3166-1 alpha2 country code so that iw(8) may set
# the initial regulatory domain setting for IEEE 802.11 devices which operate
# on this system.
#
# Governments assert the right to regulate usage of radio spectrum within
# their respective territories so make sure you select a ISO/IEC 3166-1 alpha2
# country code suitable for your location or you may infringe on local
# legislature. See `/usr/share/zoneinfo/zone.tab' for a table of timezone
# descriptions containing ISO/IEC 3166-1 alpha2 country codes.

REGDOMAIN=US

Save that file, then enjoy uninterrupted wireless networking.

4 thoughts on “Fix Wireless Disconnects in Linux

  1. Scott Miller Post author

    Well, that did not help 100% for me on Debian. With a Thinkpad T430s, using the kernel from wheezy backports (3.10 kernel) the disconnects are finally resolved.

    Reply
  2. Igor

    Thanks for the tip. I have this problem on my Thinkpad R61 laptop. The wireless disconnects randomly, usually after an hour or so. No rhyme or reason. I am certainly willing to try your easy mod. I hope for the best. Thanks again.

    Reply
  3. Enrique Ojeda

    It works perfectly, thanks for the tip =)

    Reply
  4. Mark

    I think my embedded linux is spooked. I am using IW to connect to an open wifi network as a client. I am able to connect but after the “Calling CRDA to update world regulatory domain” line, the network automatically disconnects by itself:

    9911111111:~# iw wlan0 connect -w
    [ 632.083177] wlan0: authenticate with 40:XX:XX:XX:XX:XX
    [ 632.095944] wlan0: send auth to 40:XX:XX:XX:XX:XX (try 1/3)
    [ 632.983020] wlan0: send auth to 40:XX:XX:XX:XX:XX (try 2/3)
    [ 633.098577] wlan0: authenticated
    [ 633.103038] wlan0: associate with 40:XX:XX:XX:XX:XX (try 1/3)
    [ 634.013030] wlan0: associate with 40:XX:XX:XX:XX:XX (try 2/3)
    [ 635.013042] wlan0: associate with 40:XX:XX:XX:XX:XX (try 3/3)
    [ 635.099163] wlan0: RX AssocResp from 40:XX:XX:XX:XX:XX (capab=0x501 status=0 aid=4)
    [ 635.107102] wlan0: associated
    wlan0 (phy #0): connected to 40:XX:XX:XX:XX:XX
    9911111111:~# iw wlan0 link
    Connected to 40:XX:XX:XX:XX:XX (on wlan0)
    SSID: BKSV
    freq: 5240
    RX: 3923 bytes (56 packets)
    TX: 909 bytes (19 packets)
    signal: -80 dBm
    tx bitrate: 6.0 MBit/s
    bss flags: short-slot-time
    dtim period: 0
    beacon int: 100

    9911111111:~# [ 637.551291] cfg80211: Calling CRDA to update world regulatory domain
    9911111111:~# iw wlan0 link
    Not connected.

    Have no idea how to proceed.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.