1

I've tried to connect to my RPi 2B over wifi with both a Windows device and a Mac. Neither of these devices can see the RPi when I try to ping it. The RPi does have internet access.

I've followed some other advice on the internet to see where the connection breaks down and have run into a result that doesn't seem to have happened to others - if I ping the windows pc (or mac) from the RPi, I can get a response from them. Furthermore, for a couple minutes afterwards, the RPi can be pinged by the other devices and even remotely accessed with puTTy. But if I don't do anything for a minute or two, the connection times out. If I keep doing things to communicate with the RPi, the connection will persist. But once I let it go for a few minutes, the connection will time-out and the only way to re-establish a connection is to go to the RPi and ping one of the devices again. I'm very new to RPi and linux and the terminal in general, please go easy on me.

  • First connect to rPi via serial port and then check network settings. – KernelPanic Apr 23 '15 at 5:14
  • What command to you write when trying to connect to your pi? – Bex Apr 23 '15 at 6:11
  • what wifi router and have you tried upgrading its firmware? – rob Apr 23 '15 at 9:32
2

Your wifi adapter on the RPi may be going into power saving mode after a period of inactivity. Once you initiate outbound communications from the RPi, it wakes up. I had several RPis with the Edimax nano adapter that would "disappear" frequently, only to reappear a few minutes later. I disabled the power saving options and they've been stable ever since. Google around for solutions for our specific wifi adapter.

For the Edimax EW-7811Un, the solution was to create /etc/modprobe.d/8192cu.conf and add the following:

options 8192cu rtw_power_mgnt=0 rtw_enusbss=0 rtw_ips_mode=1
1

Since your ssh gets disconnected only when you are idle these might help to keep the connection alive: sudo nano /etc/ssh/ssh_config

Host *
ClientAliveInterval 60
0

Maybe you should ping your pc from your Pi continuously to make sure there is connection activity between them. Check this http://www.tunnelsup.com/continuous-ping

  • puTTy is able to send null packets to keep the session alive. I've never needed to use this with my Pi's so there still might be something wrong here. – Ghanima Apr 23 '15 at 10:39
  • how about reflashing it again and make backup periodically to find the problem source – kurniawan dwi septian Apr 23 '15 at 11:11
0

I'd try following:

run ip addr, take a look at wlan0's inet address, make sure you're ssh to right ip address, also try from raspberry pi itself, try ssh to same ip address from wlan0's inet

pi@raspberrypi ~ $ ip addr | grep wlan0
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    inet 172.16.16.15/24 brd 172.16.16.255 scope global wlan0
pi@raspberrypi ~ $ 

also make sure service ssh status is running:

pi@raspberrypi ~ $ service ssh status
[ ok ] sshd is running.
pi@raspberrypi ~ $ 

lastly, make sure you're connecting to your private network and not like Optimum WiFi or similar as they block ssh port.

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.