I have Pi at work which is always on and does some stuff. I want to see the progress of the work at home, for that I need to see a screenshot from Pi like every one hour. Is it possible to capture and download a screenshot from Pi when I am connected to it using SSH?
1 Answer
If you're running something that needs interaction you may want to consider using VNC.
sudo apt-get install tightvncserver
vncserver -geometry 1024x768 :1
DISPLAY=:1 lxsession &
And then from your remote system use a VNC client (what one you needs depends on your other system) to access and monitor the application. You can use SSH forwarding of port 5901 to access it over SSH without adjusting the firewall or router further, e.g.:
ssh -C -L 5901:localhost:5901 remotehost
To take a screenshot remotely with scrot as suggested in comments over SSH you'll need to specify the display:
sudo apt-get install scrot
DISPLAY=:0 scrot file.png
You can use scp to copy the file to the local computer for viewing, e.g.:
scp user@remotehost:file.png .
Under Windows use the PSCP tool from Putty.
-
You should make this two answers. I'd upvote them both, but I particularly found the DISPLAY=:0 tip helpful (I almost tl:dr'd over it after I reading about VNC on the first line) Mar 30, 2016 at 9:57
scrot
is a command line tool to take screenshots. See for example my answer here: raspberrypi.stackexchange.com/questions/7423/… You can then send them with scp, or by email, or you canssh -X
and use egqiv
to see them on your screen