1

I am experiencing big problem with the Raspberry Pi 2 Wifi connection using a wifi dongle. The Wifi connection is working for a random time (sometimes a few minutes, sometimes a few hours) and then not working for another random time without changing anything.

This happens over and over again and I do not know how to solve this. Although I've tried several approaches I found in different Threads, i.e. this link https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=44044, nothing worked for me. I do not experience any problems with the router or the wifi with any other devices.

Please see below at the syslog that it says 'carrier lost' at the moment where the connection gets disrupted while I am pinging the router.

I already bought two usb dongles (Edimax EW-7811Un and LogiLink WL0084B) and another propper power supply that ensures a constant voltage of 5 Volts as I read that this is sometimes a problem. I also tried using a powered usb hub to connect the wifi stick but experienced the same behaviour.

My next step would be to ask the dealer for another Pi.

Can anybody help me with this problem? Help would be HIGHLY appreciated!!

Please find my setup and other information below:

After installing Raspbian Jessie (NOOBS) and updating and upgrading via apt-get:

sudo nano /etc/modprobe.d/8192cu.conf and I enter

options 8192cu rtw_power_mgnt=0 rtw_enusbss=0

sudo nano /etc/network/interfaces

auto lo

iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
ssid=“my_SSID“
psk=“my_password“
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}

This is all I do after using a fresh raspbian. WPA Mode of the Router is WPA/WPA2.

When the internet is not working and I cannot ping the router anymore:

64 bytes from 192.168.1.1: icmp_seq=1035 ttl=64 time=0.929 ms
64 bytes from 192.168.1.1: icmp_seq=1036 ttl=64 time=1.04 ms
64 bytes from 192.168.1.1: icmp_seq=1037 ttl=64 time=0.990 ms
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable

iwconfig

wlan0     IEEE 802.11bgn  ESSID:"o2-WLAN38"  Nickname:"<WIFI@REALTEK>"
      Mode:Managed  Frequency:2.467 GHz  Access Point: 9C:80:DF:4C:35:14   
      Bit Rate:150 Mb/s   Sensitivity:0/0  
      Retry:off   RTS thr:off   Fragment thr:off
      Power Management:off
      Link Quality=90/100  Signal level=100/100  Noise level=0/100
      Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
      Tx excessive retries:0  Invalid misc:0   Missed beacon:0

ifconfig -a

wlan0     Link encap:Ethernet  HWaddr 74:da:38:5b:66:65  
      inet addr:192.168.1.65  Bcast:192.168.1.255  Mask:255.255.255.0
      inet6 addr: fe80::76da:38ff:fe5b:6665/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:174 errors:0 dropped:26 overruns:0 frame:0
      TX packets:436 errors:0 dropped:1 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:367880 (359.2 KiB)  TX bytes:277624 (271.1 KiB)

sudo route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    303    0        0 wlan0
192.168.1.0     0.0.0.0         255.255.255.0   U     303    0        0 wlan0

syslog (at 22:16:57 the connection gets lost and I can neither load websites, ping the router etc.)

Feb  2 22:04:12 raspberrypi dhcpcd[527]: wlan0: Router Advertisement from fe80::1
Feb  2 22:08:07 raspberrypi dhcpcd[527]: wlan0: Router Advertisement from fe80::1
Feb  2 22:08:11 raspberrypi dhcpcd[527]: wlan0: Router Advertisement from fe80::1
Feb  2 22:08:15 raspberrypi dhcpcd[527]: wlan0: Router Advertisement from fe80::1
Feb  2 22:13:47 raspberrypi dhcpcd[527]: wlan0: Router Advertisement from fe80::1
Feb  2 22:14:04 raspberrypi systemd[1]: Starting Cleanup of Temporary Directories...
Feb  2 22:14:04 raspberrypi systemd[1]: Started Cleanup of Temporary Directories.
Feb  2 22:16:57 raspberrypi dhcpcd[527]: wlan0: carrier lost
Feb  2 22:16:57 raspberrypi wpa_supplicant[357]: wlan0: CTRL-EVENT-DISCONNECTED bssid=9c:80:df:4c:35:14 reason=0
Feb  2 22:16:58 raspberrypi avahi-daemon[515]: Withdrawing address record for 192.168.1.65 on wlan0.
Feb  2 22:16:58 raspberrypi avahi-daemon[515]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.1.65.
Feb  2 22:16:58 raspberrypi avahi-daemon[515]: Interface wlan0.IPv4 no longer relevant for mDNS.
Feb  2 22:16:58 raspberrypi dhcpcd[527]: wlan0: deleting route to 192.168.1.0/24
Feb  2 22:16:58 raspberrypi dhcpcd[527]: wlan0: deleting default route via 192.168.1.1
Feb  2 22:16:59 raspberrypi wpa_supplicant[357]: wlan0: Trying to associate with 9c:80:df:4c:35:14 (SSID='o2-WLAN38' freq=2467 MHz)
Feb  2 22:16:59 raspberrypi wpa_supplicant[357]: wlan0: Association request to the driver failed
Feb  2 22:16:59 raspberrypi wpa_supplicant[357]: wlan0: Associated with 9c:80:df:4c:35:14
Feb  2 22:16:59 raspberrypi wpa_supplicant[357]: wlan0: WPA: Key negotiation completed with 9c:80:df:4c:35:14 [PTK=CCMP GTK=TKIP]
Feb  2 22:16:59 raspberrypi wpa_supplicant[357]: wlan0: CTRL-EVENT-CONNECTED - Connection to 9c:80:df:4c:35:14 completed [id=0 id_str=]
Feb  2 22:16:59 raspberrypi dhcpcd[527]: wlan0: carrier acquired
Feb  2 22:16:59 raspberrypi dhcpcd[527]: wlan0: IAID 38:5b:66:65
Feb  2 22:16:59 raspberrypi dhcpcd[527]: wlan0: rebinding lease of 192.168.1.65
Feb  2 22:16:59 raspberrypi dhcpcd[527]: wlan0: soliciting an IPv6 router
Feb  2 22:17:00 raspberrypi dhcpcd[527]: wlan0: Router Advertisement from fe80::1
Feb  2 22:17:01 raspberrypi ntpd[616]: Deleting interface #3 wlan0, 192.168.1.65#123, interface stats: received=93, sent=95, dropped=0, active_time=1071 secs
Feb  2 22:17:01 raspberrypi ntpd[616]: 144.76.117.245 interface 192.168.1.65 -> (none)
Feb  2 22:17:01 raspberrypi ntpd[616]: 144.76.14.132 interface 192.168.1.65 -> (none)
Feb  2 22:17:01 raspberrypi ntpd[616]: 217.79.179.106 interface 192.168.1.65 -> (none)
Feb  2 22:17:01 raspberrypi ntpd[616]: 78.46.53.8 interface 192.168.1.65 -> (none)
Feb  2 22:17:01 raspberrypi ntpd[616]: peers refreshed
Feb  2 22:17:01 raspberrypi CRON[1327]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Feb  2 22:17:04 raspberrypi dhcpcd[527]: wlan0: leased 192.168.1.65 for 604800 seconds
Feb  2 22:17:04 raspberrypi dhcpcd[527]: wlan0: adding route to 192.168.1.0/24
Feb  2 22:17:04 raspberrypi dhcpcd[527]: wlan0: adding default route via 192.168.1.1
Feb  2 22:17:04 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Tue Feb  2 22:17:34 2016 [try http://www.rsyslog.com/e/2007 ]
Feb  2 22:17:04 raspberrypi avahi-daemon[515]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.1.65.
Feb  2 22:17:04 raspberrypi avahi-daemon[515]: New relevant interface wlan0.IPv4 for mDNS.
Feb  2 22:17:04 raspberrypi avahi-daemon[515]: Registering new address record for 192.168.1.65 on wlan0.IPv4.
Feb  2 22:17:06 raspberrypi ntpd[616]: Listen normally on 6 wlan0 192.168.1.65 UDP 123
Feb  2 22:17:06 raspberrypi ntpd[616]: peers refreshed
Feb  2 22:17:09 raspberrypi dhcpcd[527]: wlan0: carrier lost
  • Today I also tried using Ubuntu Mate with the GUI Wifi configuration. Same problems as with Raspbian. I will go the the store tomorrow to ask for another pi and we will see... – HybridPepper Feb 5 '16 at 21:49
1

WiFi by its nature goes up and down, but normally reconnects automatically.

Unfortunately you have disabled the software which would do this by the changes you have made to the configuration files.

With the settings as listed I am amazed that it worked at all.

The tutorial https://raspberrypi.stackexchange.com/a/37921/8697 shows the correct contents of these files and how it should be configured.

  • Thanks for the answer, unfortunately none of the described configuration in the tutorial works. I reinstalled raspbian to have a clean installation. After that I entered my password into the "pre-shared key" field after klicking the wifi symbol. I am connected to the wifi but I cannot ping the router nor load websites. After that I adapted the '/etc/network/interfaces' and '/etc/wpa_supplicant/wpa_supplicant.conf' as it is described under [link] (raspberrypi.stackexchange.com/questions/37920/…). Same behaviour with no sucess :( – HybridPepper Feb 3 '16 at 22:15
  • @HybridPepper: You can connect to the network, but cannot ping the router? That doesn't make sense :-/ – Jacobm001 Feb 6 '16 at 0:18
  • @Jacobm001 Yeah, that's the weard thing. Right now I tried what energyi suggested below, plugging all the peripherals exept the wifi dongle into the powered usb hub. I've been sucessfully pinging the router for 10 minutes now, we will see how it works out. I will keep you guys informed. – HybridPepper Feb 6 '16 at 11:21
  • @Jacobm001 Could the problem be caused by my router configuration? The router is 192.168.1.1 and I have a Computer connected via cable with a static ip address 192.168.1.2. There are two android smartphones connected to the router via wifi. – HybridPepper Feb 6 '16 at 12:44
  • I solved the problem by setting the router encryption to 'WPA (TKIP)' and it immediately worked perfectly and continued working for more than 24hours until now – HybridPepper Feb 8 '16 at 21:41
1

I found this to be a peripheral power problem. If you are trying to power too many USB devices, you want to get a self powered USB hub to get enough power to everything. I found pluging the wifi dongle directly to the Pi and the other keyboard/mouse and other stuff into the hub works very well. Hope this helps.

  • I tried what you suggested and it looks good so far. I will run a 24hour test by pinging the router because I got it working before but it kept disconnecting randomly. So I will let you know :) – HybridPepper Feb 6 '16 at 11:22
  • Nope, it dropped out after about 20 minutes. I will get new pi just to make sure that there is nothing wrong with the hardware... This is really frustrating and already took me a lot of time. I tried using Noobs 1.5.0 and the 2015-11-21 Raspbian jessie version experiencing the same problems with both versions. After I run sudo apt-get update and sudo apt-get upgrade with the Raspian jessie and I do a reboot it gets stuck on a black screen with a flickering blank space. I've already waited for hours and nothing happens, the only way is to format the sd card and write the image on it again – HybridPepper Feb 6 '16 at 12:42
0

As stated in this document : https://dontpressthat.wordpress.com/2017/11/03/prevent-raspberry-pi-dropping-wifi/

When you see "carrier lost" in your sys log after pi losing wifi connection, it may be caused by power saving, the fix from the document is to disable the power saving mode :

sudo iw wlan0 set power_save off

and to disable power saving automaticly on start up, add following lines to /etc/rc.local:

/sbin/iw dev wlan0 set power_save off

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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