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

Catch invalid user input in WebUI #114

Open
TuxMaus opened this issue Jan 10, 2024 · 3 comments
Open

Catch invalid user input in WebUI #114

TuxMaus opened this issue Jan 10, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@TuxMaus
Copy link

TuxMaus commented Jan 10, 2024

The display is switched off every full hour. It seams as there is a corn job executed every hour but I can`t find any suitable cronjob.

According to /data/etc/crontabs/root, the display should be switched off at midnight but not every hour:

0 8 * * * /usr/bin/photoframe.sh display on
0 24 * * * /usr/bin/photoframe.sh display off

And also /etc/crontabs/root has no corresponding entry:

13 * * * * /usr/sbin/logrotate /etc/logrotate.conf
0 2 * * 0 /usr/sbin/https-update
*/15 * * * * /usr/sbin/dyndns-update
*/30 * * * * /usr/bin/photoframe.sh sync

Any ideas where else to search?

@avanc
Copy link
Owner

avanc commented Jan 11, 2024

Hm, everything looks OK. Can you also check that /etc/cron.d is empty and /data/etc/cron.d does not exist?
When its turned off, can you activate it again via web interface?

@avanc avanc added the bug Something isn't working label Jan 11, 2024
@TuxMaus
Copy link
Author

TuxMaus commented Jan 11, 2024

Sorry, I forgot this info.

Yes, /etc/cron.d is empty and /data/etc/cron.d does not exist. The Display can be activated via the web interface and also via vcgencmd display_power 1.

But every time I swith the display on it will be switched off at full hour:

11.01.2024 06:56: display_power=1
11.01.2024 06:57: display_power=1
11.01.2024 06:58: display_power=1
11.01.2024 06:59: display_power=1
11.01.2024 07:00: display_power=0
11.01.2024 07:01: display_power=0
11.01.2024 07:02: display_power=0

I have absolutely no idea why the display is switched off. Is there any service running which can switch the display off?

@TuxMaus
Copy link
Author

TuxMaus commented Jan 12, 2024

Issue solved!

It was just a silly mistake in the time code for cron. The time code for the hour is defined in the range from 0 to 23. 24 for midnight is not known by cron and - as it seems - interpreted like the *. Therefore, the script was executed every hour and not just at midnight.

A small hint in the WebUI could problaby prevent others from doing the same mistake.

@TuxMaus TuxMaus closed this as completed Jan 12, 2024
@avanc avanc reopened this Jan 16, 2024
@avanc avanc self-assigned this Jan 16, 2024
@avanc avanc changed the title Display is switched off every hour (V 0.3.7) Catch invalid user input in WebUI Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants