sandraqu
Posts: 5
Joined: Fri Aug 09, 2013 2:54 pm

How to refresh Chromium web page from command line?

Mon Aug 12, 2013 8:01 pm

Hello,

We have setup a web page that autoloads in Chromium kiosk mode when the raspberry is turned on. We now want to refresh the webpage from SSH.

I have the following script

Code: Select all

WID=$(xdotool search --onlyvisible --class chromium|head -1)
xdotool windowactivate ${WID}
xdotool key ctrl+F5
running this script through SSH

Code: Select all

ssh -X 192.x.x.x -l pi 'echo raspberry|./scripts/refresh.sh'
produces this err

Code: Select all

Error: Can't open display: (null)
Failed creating new xdo instance
these are my refs
http://www.codepug.com/wiki/raspberry-pi-browser-kiosk
http://peter-hoffmann.com/2010/refresh- ... otool.html
http://icyrock.com/blog/tag/xdotool/ -- got getwindowactive command not found err. xdotool version 2.20100701.2961

smithg400
Posts: 152
Joined: Sat Dec 24, 2011 3:37 pm

Re: How to refresh Chromium web page from command line?

Mon Aug 12, 2013 9:17 pm

When you SSH into the PI the DISPLAY environment isn't set. You may get away with simply adding the line

Code: Select all

export DISPLAY=":0"
to the start of your script, though you are likely to also have to use xauth to authenticate the remote session.

sandraqu
Posts: 5
Joined: Fri Aug 09, 2013 2:54 pm

Re: How to refresh Chromium web page from command line?

Tue Aug 13, 2013 5:50 pm

Thank you. That worked. I also did the xauth aunthenticaction

ref
http://raspberrypi.stackexchange.com/qu ... entication

wanderer
Posts: 3
Joined: Fri Sep 14, 2012 3:24 am

Re: How to refresh Chromium web page from command line?

Mon Dec 02, 2013 6:02 pm

In my case I needed to set the display variable on my crontab command:
*/5 * * * * DISPLAY=:0 /home/pi/scripts/refresh.sh # refresh webpage every 5 minutes
Make sure to create crontab when logged in as kiosk user (not root!) via:

Code: Select all

crontab -e

arti0504
Posts: 24
Joined: Wed Jan 30, 2013 8:40 am

Re: How to refresh Chromium web page from command line?

Wed Apr 23, 2014 6:38 pm

Hello,

Could you write once again all script for refresh Chromium web page?

Return to “Beginners”