I use PuTTY to control my pi a lot. Normally it works fine, but as of a few days ago my main computer will just stop receiving data from my pi and freeze, and I have to close PuTTY and open a new session, meaning that I lose connection with what I've been doing earlier. Sometimes it will do this on start-up and I can't connect until I reboot my pi manually(pulling the plug out). Any Suggestions?

  • You should indicate the pi model and OS you are using; I am presuming Raspbian (but I think this will apply to most others): Try grep "oom-killer" /var/log/syslog and if anything comes out with a timestamp in the window of your problem, edit it into your post.
    – goldilocks
    Commented May 2, 2015 at 17:12
  • 3
    Have you started doing more with GPIOs or added something new to the USB? I had this happen when I slightly overdrew the power.
    – d-cubed
    Commented May 3, 2015 at 1:41
  • Do you have a serial cable or a display or something plugged in? You should check if the pi hangs or crashes or if it just loses its network connection.
    – XTL
    Commented May 5, 2015 at 19:14

4 Answers 4


This is not an answer to avoid freezing but about keeping the session running and available if ssh connection is lost:

You can try tmux (or screen) they are meant for that:

tmux allows one to switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal. And do a lot more.

Connect to the pi:

ssh pi@raspberrypi

Launch tmux:


You can now work safely.

In case you get disconnected for any reason, you can log back:

ssh pi@raspberrypi

List the running tmux sessions:

tmux ls

This should display the list of open tmux sessions. Example:

0: 1 windows (created Sun Jul  5 12:05:35 2015) [80x23]
1: 1 windows (created Sun Jul  5 12:05:44 2015) [80x23]

You can than select the desired session with the attach command:

tmux -t 1

I experienced a similar issue. It seemed that if executing a command over ssh that returned more than a few lines that ssh would freeze. sudo apt-get upgrade would run fine, but ls -r or ifconfig would freeze after about 10 lines. Changing the MTU settings resolved the issue for me.

The following command resolved things. I was connected over wifi, so replace the interface name as necessary. Default MTU was 1500:

sudo ifconfig wlan0 mtu 500 up
  • Worked for me on jessie
    – Ron Smith
    Commented Sep 20, 2016 at 1:29

Is the Pi connected via Wifi and a USB ethernet adaptor? You may find the USB Wifi NIC is going to sleep, I edited /etc/modprobe.d/8192cu.conf and added

options 8192cu rtw_power_mgnt=0 rtw_enusbss=0

and it solved the problem for me but this info depends on the chipset, I'm using the Edimax USB wifi adaptors so you may have to search for the solution for your chipset.

  • Is this wheezy? File doesn't exist in Jessie.
    – geotheory
    Commented Dec 16, 2015 at 14:03

For me the problem was this: https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=122601

So after commenting out this chunk of /etc/rsyslog.conf the Pi is not doing unexpected rebootings anymore (which caused the broken pipe ssh freeze):

       *.=notice;*.=warn       |/dev/xconsole

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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