|# Enable and disable HDMI output on the Raspberry Pi|
|tvservice -s | grep "TV is off" >/dev/null|
|case $1 in|
|if [ "$curr_vt" = "1" ]|
|echo "Usage: $0 on|off|status" >&2|
I have a standard console on VT1 and X11 on VT2. When I ran your script initially, it wasn't working. I poked around a bit and it seems that the VT numbers were getting mixed up for some reason. I added some sleeps in between the
...and it seems to be working consistently now. Thanks for your help with this solution!
Hi all. I am trying to use this script to turn my raspberry pi on/off at different times depending if its a work day or a weekend.
Sat-Sun: (leave it on all day)
So since I have a global on and off time of 7AM and 11PM every day we could say:
Then for the weekdays:
My question to you is one of order — how do I know if these will be executed in this order? Is there a better way to write this?
@leemcarthur: Did you ever figure out a solution?
Here's the solution. I think you will have problem each on/off for each day. See http://ediy.com.my/index.php/tutorials/item/106-raspberry-pi-schedule-turn-off-on-display
@Chalta if you add sudo to all of the commands, that should fix teh Couldn't get a file descriptor referring to the console error,
Enable and disable HDMI output on the Raspberry Pi
case $1 in
Hi, never done any coding whatsoever before, but thought I’d try my hand with dakboard. I’ve loaded it up and working on my monitor through raspberry pi, and followed the script above but I’m getting lost with how to complete the rest of it. Is there an idiots guide to getting this to work?
I have a whole other issue with crontab not running at all, or rather, running two processes right now:
ps -eaf | grep cron
root 360 1 0 20:58 ? 00:00:00 /usr/sbin/cron -f
So its running as the pi user as well as root? Could this be the issue why my rpi-hdmi.sh script isn't running?
Couldn't make this script work right on Pi3's.. screen would go off, then never go back on, error message was "failed to set"
Searched and found:
tvservice is not the best to turn off and on the screen. Much better way to do this (found after a day of searching) is using vcgencmd command (more on this here).