4

I recently bought a Raspberry Pi, B+ model. I´m trying to run programs on the Pi over a network but I´m not able to SSH into the Pi wirelessly. With Ethernet cable it works fine and with the wireless adapter it works fine too, until I unplug the HDMI cable connected to the Pi and a monitor. 10-20 sec later the Pi stops responding in the terminal and when I try to reconnect I get error messages:

ssh: connect to host 192.168.1.65 port 22: Host is down
ssh: connect to host 192.168.1.65 port 22: No route to host

What's interesting is, when I plug the HDMI back in, ssh works again...

2
  • Which OS distribution are you using?
    – TomG
    Dec 14 '14 at 19:15
  • Try sudo grep sshd /var/log/*. This will probably spit out more than you want to read, but you'll be able to tell better exactly which file sshd is logging to, then you can look through that for clues. Those files contain timestamps, so you can then test this easily enough and see if there's any relevant messages.
    – goldilocks
    Dec 16 '14 at 20:08
2

This should not be happening, in case you are unsure. Plugging or unplugging the HDMI should not cause a problem.

If the system is actually still running, you should be able to plug the HDMI cable back in and see whatever was there before. If not, this is a further clue it has stopped for some odd reason.

If it has stopped and the ethernet was on, the green LEDs indicating the link is up should go off -- that would be another clue.

If it appears it has shut down, you could unplug it, take the SD card out, and look at the end of logs in /var/log (e.g., messages and syslog, if they exist) for messages that look relevant and have an appropriate timestamp.

If the system still seems to be running (e.g., the ethernet link lights are on) but you can't get it to respond anymore, you'll have to unplug it anyway. Wait a couple of minutes to increase the likelihood of stuff being synced to disk, then unplug it and have a look in the logs as described above.

4
  • Yes, I know. A connected monitor shouldn't cause such a problem. The thing is though, the SSH starts to work again when I connect the HDMI. I've red something about the Pi activating some kind of power saving mode when some conditions are met, which then might be the cause of the problem. Anyways, thanks for the answer, I will look further into it.
    – Tom
    Dec 14 '14 at 16:46
  • 1
    I've edited that into the question since it is a significant point. Does the display look the same too? I'm asking just to be really sure that it's not rebooting because of some voltage drop/surge. Note that the pi does not have any kind of power saving mode. It's on, or off.
    – goldilocks
    Dec 14 '14 at 16:59
  • No, it does not reboot. The display looks exactly the same as when I unplug the HDMI cable.
    – Tom
    Dec 16 '14 at 18:59
  • You could try running top inside the ssh session when you pull the cable to see if something is, e.g., suddenly revving up the system, causing a resource problem. Watch it carefully for a minute or so while the system is idle, then during those 10-20 seconds after you pull the plug and before the connection freezes up. Gotta say this one is odd.
    – goldilocks
    Dec 16 '14 at 20:04
0

I had the same problem of only being able to connect while hdmi was plugged in, although with a different error: kex_exchange_identification: read: Connection reset by peer (the error message differs per client, though).

Even though the error is not exactly the same, it may be worth trying to reset permissions on your home directory on the Pi, so do (on the Pi)

sudo chmod 755 ~
sudo chmod 755 ~/.ssh
sudo chmod 755 ~/.ssh/authorized_keys

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.