[SOLVED] Scheduled hdmi off - on

Hello,
I search all over the internet for solution but no luck…

Running RPI 1 with newest OSMC installed, everything seems to work.

I would like to turn off - on hdmi port at specific (night) hours.
I try with cronjob but not successufully.
Whit command
vcgencmd display_power 0
Hdmi port goes off and monitor turns off, that is great but when I try to do same with cron job I have no luck. Have created hdmioff.sh and chmoded to 777 then try to call from cronjob with: crontab -e
03 20 * * * /home/osmc/Pictures/hdmioff.sh

Is it important where to put this file? I just put it into pictures folder for now.
I am fighting with this for several days now…

Please help me.

Thanks in advance.

In your hdmioff.sh script, you will need to specify the full path to vcgencmd.

To find the location of a command:

osmc@kaled:~$ which vcgencmd
/opt/vc/bin/vcgencmd
osmc@kaled:~$

The reason for this is that jobs running under cron do not have the same environment as when logged in.

1 Like

One quick search in this forum (has a great search function build in) would have saved you all that searching on the internet

1 Like

GREAT HELP !

THANK you both !
I am realy happy now.

You was right, you must know what to search for.

Now I only have to find out how to implement switch off button. But that is another search to make.

There is no need to turn off the pi. It is designed to run at all times and use very little power while doing so. Cost savings is quite negligible.

It is not about power saving, but system saving.
I am building photo frame for older people and I afraid if they just unplug it everytime they change the place for it, will destroy sd card soner or later.
Dont you think so?

It will certainly corrupt the file system at some point, yes.