Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refreshing via crontab does not work #37

Closed
senseitsa opened this issue Nov 22, 2018 · 8 comments
Closed

Refreshing via crontab does not work #37

senseitsa opened this issue Nov 22, 2018 · 8 comments

Comments

@senseitsa
Copy link

My RPi is showing a website of local IP, and refreshes every 30 seconds via jquery. When the network goes down, the RPi brings up the "Page not found" page.

This means that the page cannot reload when the network comes up again, as it is stuck on the Page Not Found page.

I have tried reloading the page every minute using crontab (* * * * * xdotool key ctrl+R), however this doesn't seem to work. Any suggestions on how I can reload the page using crontab or a shell script?

@jareware
Copy link
Owner

That sounds odd.

I just tried disconnecting from my network so I got the "page not found" page on Chrome, turned the network back on, and sent the reload keypress, and it loaded just fine.

Can you recover from that situation in any other way? For example, using the keyboard/mouse to reload the page? Does that work?

@matristain
Copy link

In my case y have to do a
export DISPLAY=:0
Before any xdotool key , to make it work properly.
not sure if its your case or how to integrate it on crontab , but hope this help.

@jareware
Copy link
Owner

https://github.com/futurice/chilipie-kiosk/blob/6a4a3e6f8aac958c17059f99c2991eaa496c0368/home/crontab.example#L1

It already should be set for all commands in the crontab, though... 🤔

@senseitsa
Copy link
Author

Thanks for all your help. I've tried the following:

$ xdotool key ctrl+R
Error: Can't open display: (null)
Failed creating new xdo instance

Then tried the export command first, which worked fine:

$ export DISPLAY=:0
$ xdotool key ctrl+R
$ 

So I've updated the crontab entry to the following:
* * * * * export DISPLAY=:0;xdotool key ctrl+R

@jareware
Copy link
Owner

Hmm, very curious!

If it's not too much to ask, could you still try and see if you can make it work by changing the DISPLAY=:0.0 at the top of the crontab file to DISPLAY=:0 to see if that fixes it as well?

Because setting it at the top should definitely set it for the environment of all cronjobs.

@matristain
Copy link

I'm not very in to linux commands but could the "export" before DISPLAY=:0.0 at top of the crontab, might make it work?

@jareware
Copy link
Owner

According to this answer it should work on Debian, but should take a closer look.

@connoleg
Copy link

I'm struggling with this crontab doesnt change tabs. On boot the first tab displays but never changes. I can manually change the tab with export DISPLAY=:0 and xdtool ctrl-Tab etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants