7

before voting this question down or closing it i know there are allready answers on this here but they do not work for me. I have a Raspberry B+ with wheezy lates version and a Usb WiFi Dongle :

Ralink Technology, Corp. RT5370 Wireless Adapter

What I want is to connect to my pi at any time from my windows pc with putty. The Problem I have is I can only connect directly after a reboot and after not typing for 1 Minute or so the connection is lost and I can not reconnect unless I restart my pi.

Zion
  • 321
  • 2
  • 3
  • 4

4 Answers4

7

Clarifications first

Did you try to keep a ping command running on the Raspberry (ping your router IP for example)? Does it stop after awhile? Or does it work but you can't connect to SSH somehow?

Disable WiFi power saving

Are you using power saving mode on the WiFi dongle? Check it:

$ iw wlan0 get power_save
Power save: on

If it is ON, perhaps try to set it to OFF: iw wlan0 set power_save off.

To make this change persistent, if you are using NetworkManager you can follow this gist to disable WiFi power saving. If you are not using NetworkManager, on Raspbian/Debian you can edit the file /etc/network/interfaces and add a post-up entry for your interface, example:

iface wlan0 inet dhcp
  wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
  post-up iw wlan0 set power_save off

Check the power supply

As I said in a comment, try to put your USB WiFi dongle on a external USB hub with its own power. It is possible that for example when the USB dongle needs to increase the Tx Power of the transmission because of for exemple some more noise in your radio environment, the RPi can't give enough power and the USB dongle behaviour can be undefined (e.g. it is turned off). You could also use a more powerful USB power supply for your RPi. What is the power of yours? Can it deliver up to 2A at 5V? (check on the power supply itself, it is often written in really small).

Check your logs

Check your system logs (e.g. /var/log/messages) does it tell you about some problems related to your WiFi hardware or about the network?

Check your hardware

When you start the RPi and that you have WiFi working, do you see the USB dongle in the list reported by lsusb -v? And after you lost the wifi, is it still listed by the same command?

Check the connection info

When you have the WiFi up and running, what are the output of iw wlan0 link and iw wlan0 station dump?
Then once the wifi is lost, what are the output of both commands?

And once you have lost wifi, are you still able to view your wifi network?

$ sudo iw wlan0 scan | less

Run the above on your RPi when it has lost the connection, and see in the output (might take several seconds to be displayed) if there is your wifi network name.

Huygens
  • 733
  • 5
  • 12
2

It doesn't really make sense that this is some kind of intentional "sleep" mode. What is the point of a wifi adapter that cuts out after a minute or two?

In other words, I do not think your problem is caused by such a feature, so trying to disable it will not help. I have an adapter with this exact same chip that I use without problems on the pi, by the way.

You need to make make sure the pi is keeping the correct time (look at the output of date), then allow this to happen and look through /var/log/syslog afterward; the messages in there are timestamped. Look and see if there is any explanation. If the adapter really were putting itself to sleep, I think there would be an indication. If the adapter doesn't have a light in it to indicate whether it is working, it may actually be something unrelated.

goldilocks
  • 60,325
  • 17
  • 117
  • 234
0

I tried running /sbin/ifup wlan0 and it worked. I got the connect:Network is unreachable error when I tried downloading packages. Found the fix here: "connect: Network is unreachable" on a working (connected) wlan0 interface

0

On some other dongles, there are parameters of the module (8192cu) set on by default and requiring the creation of a file in /etc/modprobe.d/. Your problem wouldn't be likewise?

I don't know if this is a standard but I've had to create (thanks lsmod) a module_name.conf in there with

options `module_name` rtw_power_mgnt=0 rtw_enusbss=0

to force them to sleep==0.

Greenonline
  • 2,969
  • 5
  • 27
  • 38