I'm attempting to remotely access the desktop of my Raspberry Pi 2 using VNC. I followed these instructions to install TightVNC Server on the Pi (which is running NOOBS) and these instructions to install TightVNC Viewer on a PC running Windows 7.
192.168.#.#::5901 as the remote host in the "New TightVNC Connection" dialog, where
192.168.#.# is the IP address of the Pi determined using
hostname -I. With either of these, the connection sometimes succeeds but sometimes fails with the error:
"Error in TightVNC Viewer: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond."
I've also tried connecting to the Pi using
telnet 192.168.#.# 5901; similarly, this sometimes works and sometimes doesn't (when it doesn't work, the error is, "Could not open connection to the host, on port 5901: Connect failed").
Generally, I'll be able to connect successfully for a while, then connection attempts will fail, followed by a period where they succeed again, etc. (All using the same vncserver session on the Pi.)
Any suggestions about what might be causing this behaviour would be appreciated!
EDIT: during a period when connection attempts fail, it seems that loading something over the network on the Pi's end (e.g., visiting a new web page in the Epiphany web browser) will result in connection attempts succeeding again (but only for a while).
For example, if I start pinging the Pi (via
ping 192.168.#.# in the Windows command prompt) during a period when connection attempts fail, the result is "Request timed out". If I visit a website on the Pi while Windows is still pinging it (e.g., between the second and third pings), the result of the next ping attempt will be "Reply from 192.168.#.#: bytes=32 [...]" and a subsequent VNC connection attempt will succeed.