12

I have 3 raspberryPIs and all them are dropping wifi connection after sometime.

  1. Wifi chipset is Ralink RT5370
  2. Tried power supply with 1000A and 1500A
  3. Power management is turned off.
  4. ifconfig gives this:

enter image description here

But when I do a ping google.com, it times out. So technically it has a valid IP address and it is connected.

The problem is consistently reproducible when I do data intensive job from the internet. Like when I do a apt-get install nmap, it hangs after 48-50% and the network drops.

So how can I troubleshoot this problem?

iwconfig: enter image description here

/etc/network/interfaces file

enter image description here

zengr
  • 515
  • 2
  • 5
  • 17

9 Answers9

7

I see that you mentioned the power management, but this may help somebody else as it helped me:

I used the steps from https://learn.adafruit.com/adafruits-raspberry-pi-lesson-3-network-setup/test-and-configure#fixing-wifi-dropout-issues to disable the power-saving mode in WiFi and it helped with my rpi2, no powered USB hub needed.

Create new file:

sudo nano /etc/modprobe.d/8192cu.conf

and paste this:

# Disable power saving
options 8192cu rtw_power_mgnt=0 rtw_enusbss=1 rtw_ips_mode=1

then reboot

sudo reboot
Ekus
  • 171
  • 1
  • 2
  • 2
    it seems that disabling power management solved the problem for me as well. I have a Pi1 and I'm using the 8188eu driver (TL-WN725N dongle) – Giordano Jul 14 '16 at 15:25
6

Forget the "rating" of the PSU - this is often misleading, and the Pi limits current, so it is not possible to draw more than 1A, even if the PSU can really supply this.

Use a powered hub (or otherwise power the WiFi adapter). The Pi can supply at most 300mA to peripherals, and this is often insufficient for WiFi.

One other option is to bypass the polyfuse.

Milliways
  • 59,890
  • 31
  • 101
  • 209
  • 1
    Can you point me to a good powered hub? The wifi is a USB dongle, how can I power it externally? – zengr Apr 12 '14 at 05:40
  • 1
    See http://elinux.org/RPi_Hub if you want to check out recommendations. Frankly most of the stuff written on hubs is BS. Most hubs work OK. The only real difference is whether they backpower the Pi. See http://www.raspberrypi.org/help/faqs/#powerHub – Milliways Apr 12 '14 at 06:44
  • I pasted the wrong link for hubs http://elinux.org/RPi_Powered_USB_Hubs – Milliways Apr 12 '14 at 08:41
  • 1
    @zengr If you plug the dongle into the powered USB, it will be powered (at least should be) correctly via the hub. Hubs, if they are externally powered, can provide much more power than the Raspberry Pi, which has to limit the power coming in, to protect components. Thus, since it can't pull as much power in, it can't put as much power out, and thus a wifi dongle, or other power-heavy USB items, may not be able to run directly plugged into the Pi. – RPiAwesomeness Apr 12 '14 at 13:46
  • 1
    Ah I see, you are suggesting to use something like this: http://www.ebay.com/itm/New-10-Port-High-Speed-USB-2-0-Hub-Expansion-Power-Adapter-for-Notebook-PC-/221278941555 . That's a problem for me since I am planning to use RPIs as a router placed on walls. This will really make it complicated and hard to hang it. If power is a problem, then it means if I remove keyboard and the monitor, it should perform better just with the dongle? – zengr Apr 13 '14 at 03:34
  • @RPi Awesomeness I see no need to "to limit the power coming in", and the design is a poor engineering compromise. If they were serious they would have had a separate limiter for the USB ports, which would have made them standards compliant, and incidentally avoided most of the problems users post on this site. Unfortunately the horse has bolted. – Milliways Apr 13 '14 at 05:39
  • @zengr removing the keyboard and the monitor may help, but depending on the current drawn by the wifi dongle may not be sufficient. You could bypass the polyfuse or provide a feed from the PSU to the wifi dongle. Both of these require some soldering. Another option, if you don't require the 2nd USB is to plug your PSU into the USB port. – Milliways Apr 13 '14 at 05:39
  • @Milliways I was referring to the fact that the Raspberry Pi limits the power that can come in, not the hub. Sorry if that isn't clear. – RPiAwesomeness Apr 13 '14 at 12:26
5

In new Linux OS version installed via NOOBS, the name of the 8192 driver has been changed from 8192cu to rtl8192cu. You will need to set the power management options in /etc/modprobe.d/8192cu.conf file as follows:

options rtl8192cu rtw_power_mgnt=0 rtu_enusbss=0

If you do not rename this driver in options, the options are not recognized by the OS during boot up.

For naming conventions, I renamed 8192cu.conf file to rtl8192cu.conf.

Jacobm001
  • 11,898
  • 7
  • 46
  • 56
Rofe
  • 51
  • 1
  • 1
3

The other solutions here did not help me, however this solution from modmypi.com did:

Edit the wlan0 section of: /etc/network/interfaces

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

The above code block turns WiFi power saving off, brings up the wlan interface automatically, and ensures you are using DHCP.

zengr
  • 515
  • 2
  • 5
  • 17
Ralph
  • 447
  • 5
  • 8
  • this solution is also easy to check, as running this correctly reports the power save is off: iw wlan0 get power_save – eglasius Aug 14 '23 at 11:33
3

the final solution is running a scrip to reconnect the net. here is a script: https://github.com/wxlcat/NetReconnector

nickwang
  • 31
  • 1
2

I encountered this problem with the with the Edimax WiFi Adapter (EW-7811UN).

After a bit of frustration I finally solved it. This is taken from my post on sparkfun.com

Many users complain that this drops connections. I found this to be true, but after some digging I found that the root of the problem was not the adapter, but Raspian attempting to save power by shutting off the WiFi adapter when it becomes idle. If you are experiencing dropped connections, open terminal and make a file 8192cu.conf in directory /etc/modprobe.d/ with the command:

sudo nano /etc/modprobe.d/8192cu.conf

Then add the following line to the file

options 8192cu rtw_power_mgnt=0 rtw_enusbss=0

You should be all set! No more dropped connections!

Accentrix
  • 122
  • 1
  • 2
  • 9
2

From the perspective today. You should not work rename your 8192cu.conf to rtl8192cu.conf because it is blacklisted on dist Linux 4.14.72-v7+ due to driver problems. Even the other informations above won't work for me.

If you want to confirm it by urself just look...

ls -a /etc/modprobe.d/

You will see "blacklist-rtl8192.cu.conf"

You can try this. It helped me with my bad connection and i'm on a fresh installed raspbian light with linux latest dist 4.14.72-v7+

 sudo iwconfig wlan0 channel auto
 sudo iwconfig wlan0 power off
 sudo iwconfig wlan0 txpower auto
 sudo iwconfig wlan0 rate auto
 sudo iwconfig wlan0 rts 2304
 sudo iwconfig wlan0 frag 2304

confirm with sudo iwconfig that all settings applied.

rts and frag can b set 0 - 2347 and represents bytes. You can play with this values and look what fits best for you.

The problem ist that you have to restart your wlan after that and after reboot your settings get lost. So put them into startup properly to start them with your system.

sudo nano /etc/rc.local

paste above the stuff before exit 0 and don't forget to save!

Last but not least. Your HDMI Cable can make you hard times also. Don't use cheap cables because the signals will be interrupted from the wlan. Even hardmetal cases and +48v phantom sound stuff can interrupt your wifin con on pie. (my cable made me hard times and i read about it in the raspbian forums)

The script will be lost every time after restart. You should build a bashscript or start up script to load it on start (Follow link for more infos on that):Execute script on start-up

Alex
  • 21
  • 2
  • The problem ist that you have to restart your wlan after that and after reboot your settings get lost. - Can' you put them in a .conf file to get read when the module is loaded? – Dirk Sep 28 '18 at 15:52
  • you can write a script and load it on start~ https://raspberrypi.stackexchange.com/questions/8734/execute-script-on-start-up

    added this to my comment above~

    – Alex Oct 08 '18 at 14:39
0

I tried this fix, and it seemed to help some, but I was still getting dropouts. But another forum suggested setting rtw_enusbss=0, and that seems to be working better.

0

What worked for me:

  1. Go to the menu options.
  2. Preferences -> Raspberry PI Configuration -> Localisation -> Set WiFi Country.
  3. Set the country.
  4. Reboot.

Problem solved.