2

I have a fresh install of Ubuntu 14.04.04 which I installed side by side Windows 10.

I have the problem that my wireless connection drops randomly. When I start the system it is all fine, but after some random time the connection is gone and it doesn't come back no matter what I try unless I restart system.

I tried debugging using dmesg command and I thought it was related to IPV6 conflicts so I set the option to ignore in the network manager and it didn't help. I also set network settings manually and also didn't help.

One last thing: I already have a problem on Windows 10 which I explain thoroughly here Laptop freezes randomly.

I am now thinking if the wireless card be causing this behavior on Windows !

Here is subset of the output from dmesg, please let me know if you need more:

[   15.847672] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   16.192616] r8169 0000:03:00.1 eth0: link down
[   16.192644] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   16.573804] audit: type=1400 audit(1457382167.018:23): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/sbin/dhclient" pid=956 comm="apparmor_parser"
[   16.573811] audit: type=1400 audit(1457382167.018:24): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=956 comm="apparmor_parser"
[   16.573815] audit: type=1400 audit(1457382167.018:25): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/connman/scripts/dhclient-script" pid=956 comm="apparmor_parser"
[   16.574035] audit: type=1400 audit(1457382167.018:26): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/sbin/tcpdump" pid=963 comm="apparmor_parser"
[   16.574116] audit: type=1400 audit(1457382167.018:27): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/lightdm/lightdm-guest-session" pid=955 comm="apparmor_parser"
[   16.574121] audit: type=1400 audit(1457382167.018:28): apparmor="STATUS" operation="profile_load" profile="unconfined" name="chromium" pid=955 comm="apparmor_parser"
[   16.574177] audit: type=1400 audit(1457382167.018:29): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=956 comm="apparmor_parser"
[   17.649530] init: alsa-restore main process (1074) terminated with status 99
[   17.804612] wlan0: authenticate with 64:d1:a3:2f:fd:c8
[   17.815714] wlan0: send auth to 64:d1:a3:2f:fd:c8 (try 1/3)
[   17.820034] wlan0: authenticated
[   17.822276] wlan0: associate with 64:d1:a3:2f:fd:c8 (try 1/3)
[   17.826528] wlan0: RX AssocResp from 64:d1:a3:2f:fd:c8 (capab=0x411 status=0 aid=3)
[   17.827360] wlan0: associated
[   17.827366] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   18.369446] IPv6: wlan0: IPv6 duplicate address fe80::ba86:87ff:feef:7fa5 detected!
[   25.349143] ahci 0000:00:17.0: port does not support device sleep
[   42.991776] audit_printk_skb: 132 callbacks suppressed
[   42.991779] audit: type=1400 audit(1457382193.435:74): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/cups/backend/cups-pdf" pid=2181 comm="apparmor_parser"
[   42.991784] audit: type=1400 audit(1457382193.435:75): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/cupsd" pid=2181 comm="apparmor_parser"
[   42.992060] audit: type=1400 audit(1457382193.435:76): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/cupsd" pid=2181 comm="apparmor_parser"
[  150.210576] [drm:intel_pipe_update_end [i915]] *ERROR* Atomic update failure on pipe A (start=10062 end=10063)
[  202.451361] [drm:intel_pipe_update_end [i915]] *ERROR* Atomic update failure on pipe A (start=13198 end=13199)

After dropping the connection last time, I disabled networking then enabled it and this is what dmesg shows at the bottom:

[   23.743542] init: plymouth-upstart-bridge main process ended, respawning
[   23.751996] init: plymouth-upstart-bridge main process ended, respawning
[   26.284762] ahci 0000:00:17.0: port does not support device sleep
[   44.981590] audit_printk_skb: 132 callbacks suppressed
[   44.981592] audit: type=1400 audit(1457459828.800:68): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/cups/backend/cups-pdf" pid=1736 comm="apparmor_parser"
[   44.981597] audit: type=1400 audit(1457459828.800:69): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/cupsd" pid=1736 comm="apparmor_parser"
[   44.981873] audit: type=1400 audit(1457459828.800:70): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/cupsd" pid=1736 comm="apparmor_parser"
[  530.625719] systemd-hostnamed[2849]: Warning: nss-myhostname is not installed. Changing the local hostname might make it unresolveable. Please install nss-myhostname!
[  875.637661] wlan0: deauthenticating from 64:d1:a3:2f:fd:c8 by local choice (Reason: 3=DEAUTH_LEAVING)
[  890.043165] cfg80211: World regulatory domain updated:
[  890.043168] cfg80211:  DFS Master region: unset
[  890.043169] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[  890.043171] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[  890.043172] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[  890.043173] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm), (N/A)
[  890.043174] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[  890.043175] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[  896.305532] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  896.325321] r8169 0000:03:00.1 eth0: link down
[  896.325356] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[  898.031771] wlan0: authenticate with 64:d1:a3:2f:fd:c8
[  898.052478] wlan0: send auth to 64:d1:a3:2f:fd:c8 (try 1/3)
[  898.654827] wlan0: send auth to 64:d1:a3:2f:fd:c8 (try 2/3)
[  899.654614] wlan0: send auth to 64:d1:a3:2f:fd:c8 (try 3/3)
[  900.654536] wlan0: authentication with 64:d1:a3:2f:fd:c8 timed out

NOTE: The networks still shows up as connected so it does not try to connect automatically, but I have no connectivity whatsoever.

  • Please see the instructions here: askubuntu.com/questions/425155/… – mchid Mar 7 '16 at 21:49
  • @mchid Where do I post information from that file ? Could you also please check the question again as I have added some more information at the bottom. Thanks – Ibrahim Najjar Mar 8 '16 at 18:17
  • Just copy and paste the contents of ~/wireless-info.txt to paste.ubuntu.com and then provide a link to the ubuntu pastebin post in your question. Here is an example: paste.ubuntu.com/15329959 – mchid Mar 8 '16 at 19:49
  • 1
    @mchid Done. paste.ubuntu.com/15337147 – Ibrahim Najjar Mar 9 '16 at 20:37
  • Thanks, I posted an answer. It looks like you are on a really crowded frequency this problem is quite common and switching to a less congested frequency almost always solves this issue. Also, your regulatory domain is not set to your actual location which appears to be Eu/Amsterdam. If that is not correct, let me know and I will edit the answer. – mchid Mar 9 '16 at 22:48
2

Okay first of all, your wireless regulatory domain is not set which is restricting your frequency range.

Based on the output you pasted, it looks like you are in Amsterdam. If you are not in Amsterdam, it is important you run the following command with the correct two letter country that corresponds to your actual location. Also, if you travel to a different country, you should set the correct country to where ever you travel to so that you do not violate local radio frequency restrictions.

If you are not in Amsterdam, you can find a full list of two letter codes that correspond to all areas by running the command cat /usr/share/zoneinfo/zone.tab. Again, use the correct country code.

In this example, I will post commands that will set the local country to Amsterdam using the country code NL

sudo iw reg set NL
sudo sed -i 's/REGDOMAIN=/REGDOMAIN=NL/g' /etc/default/crda
sudo sed -i 's/REGDOMAIN=/REGDOMAIN=NL/g' /lib/crda/setregdomain

You should now have access to channels 12 & 13 on frequencies 2.467 and 2.472 respectively. You may want to use one of these channels in the future if one of these frequencies becomes less crowded.

Next, there are 8 wifi networks using the same frequency channel that you are using and this can cause the major connectivity and performance issues.

You should use a frequency that is not so crowded. There are:

  • 8 people are using 2.462 (channel 11).
  • 3 people are using 2.457 (channel 10).
  • 2 People are using 2.422 (channel 3).
  • 4 people are using 2.412 (channel 1).

Frequencies not in use are:

  • 2.417 (channel 2)
  • 2.432 (channel 5)
  • 2.447 (channel 8)
  • 2.467 (channel 12)

It looks like the least crowded frequency is 2.432 on channel 5.

I strongly suggest you configure your wireless router to use the 2.432 frequency on channel 5 to prevent issues.


Also if you leave Europe, you can unset the Amsterdam regulatory domain by running the following command:

sudo sed -i 's/REGDOMAIN=NL/REGDOMAIN=/g' /etc/default/crda

Please post any errors or let me know if this doesn't help.


EDIT 1

Because that didn't work, you can often compensate for these types of issues by increasing your tx retry threshold.

By default, this is set to 7 to save power but many have found this is not sufficient in some areas.

Run the following command when you have these issues to increase retry from 7 to 12:

sudo iwconfig wlan0 retry short 12 

The above setting is not permanent and you will need to run this command after a reboot. You can check the retry limit by running the following command:

iwconfig | grep limit:..

Next, you should adjust some of the powersave functions set by the module. Although "powersave" shows off in iwconfig, you most likely still have some of these parameters set through the module that need to be disabled in order to get good performance. This is typical for realtek drivers.

Run the following command to create a config file for your driver module:

sudo nano /etc/modprobe.d/rtl8723be.conf

Copy and paste the following lines into the file:

options rtl8723be ips=0
options rtl8723be fwlps=0
options rtl8723be swlps=0
options rtl8723be msi=0
options rtl8723be swenc=0
options rtl8723be debug=1

Press CTRL + o and then press ENTER to save the file. Press CTRL + x to exit nano.

You can set debug= from 0 to 5. I believe 5 is the most verbose and 0 is off.

The module settings here are permanent. If you want to edit these settings, just edit the file /etc/modprobe.d/rtl8723be.conf.

(Note: Some people suggest setting swenc=0 to swenc=1 but the difference probably isn't noticeable either way.)

Finally, run the following command to reload the module:

sudo modprobe -r -f rtl8723be
sudo modprobe rtl8723be
sudo service network-manager restart

Again, please post any errors or future issues.

  • Applied the changes and testing them, will let you know of the result. Thanks for all the help and +1 for that. – Ibrahim Najjar Mar 10 '16 at 18:22
  • Unfortunately it didn't work. – Ibrahim Najjar Mar 10 '16 at 18:42
  • @IbrahimR.Najjar Sorry it took so long to get back with you. I posted more stuff after "EDIT 1" in the posted answer. Again, please post any more errors or if it doesn't seem to help, thanks! – mchid Mar 15 '16 at 22:38
  • Something new happened. For the first time ever the machine when running Windows 10 has frozen while surfing the web (usually I am inside a full screen application like a video game or video clip etc ..), When that happened I noticed the connection was dropped by looking at the icon but the computer was completely frozen. Now I have huge suspensions that the wireless card is actually defected. I have updated the driver on Windows and will test for a while and then apply your changes on Ubuntu. Do you know of any way to somehow monitor wireless card hardware events ? – Ibrahim Najjar Mar 16 '16 at 21:43
  • 1
    @IbrahimNajjar - as an experiment you can try turning power management off for your wireless adapter. unix.stackexchange.com/questions/269661/… – Robert Baker Jan 16 at 0:48

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.