简体   繁体   中英

Raspberry Pi Refresh Browser

I have a raspberry pi set up to act as a signage system using a google presentation url as what its displaying. Problem is I need this page to be refreshed every 5 minutes to grab new information added or removed from the slideshow.

What I had set up was a small cron job running every 5 minutes

*/5 * * * * export DISPLAY=:0 && /bin/bash /home/pi/refresh.sh 
[xdotool search “Chromium” windowactivate --sync key F5] <- Contents of refresh.sh

However as I have noticed from watching the display it is not auto refreshing and if I run that command manually from ssh it refreshes just fine.

Does anybody have any tips? Maybe I'm missing something?

I actually got it to work by modifying the refresh.sh with

sudo -u pi screen -d -m export DISPLAY=:0 && xdotool search "Chromium" windowactivate --sync key F5 > /dev/null 2>&1

I guess the cronjob runs under a separate shell that when it tried to fetch the display with xdotool it wasn't able to. With this the cron job actually fires up a shell as the pi user and then executes the xdotool which then runs the command like it should and then once that command is done the screen session dies. Effectively doing exactly what I needed for the digital sign.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM