I installed my old Pi 1B with Jessie intending to run it headless over wifi, accessed via ssh from a laptop. It worked fine for a couple of weeks, then suddenly I couldn't get a connection. I found that if I plug the TV in via hdmi I can get connected again over ssh/wifi. Then remove the hdmi and my ssh/wifi connection drops again. The Pi is not rebooting as I can get my connection again the instant the hdmi cable goes back in (well there is a couple seconds delay). I am using a 2.5A power supply endorsed by the Raspberry Pi Foundation so I don't think it's that. My wifi dongle is a tiny Edimax (I forget the model) that has always worked well in the past. I can't really tell whether it is the ssh or the wifi that is dropping out - though I can't ping it from my laptop either (with hdmi out) so that would suggest wifi rather than ssh.
Any ideas? Why would it suddenly stop working after two weeks? I didn't make any changes to the config on the Pi in that time.