3

I want to do the following:

Use my raspberry pi as a smart display, kind off like what the Chromecast does when it's not streaming anything. I also want it to turn on and off at certain times, like turn on 8am and turn off 10pm or something like that.

The problem is, that I struggle with turning it on or off. Since the raspberry pi doesn't have a real-time clock and I don't want to attach an extra circuit, I tried to only turn off my display with Cec-Client or vcgencmd. To run the command on a specific time, I tried to run it with cron.

The command was then the following:

0 8 * * * echo "on 0" | /usr/bin/cec-client -s

(also tried some little variations off it)

But nothing ever happens.

Can somebody please help me out, I'm open for completely different solutions if you happen to have a better one.

Aurora0001
  • 6,357
  • 3
  • 25
  • 39
Waenger
  • 31
  • 2

1 Answers1

1

@MarkSmith made a good suggestion. To help your troubleshooting, ask cron to redirect its error messages (stderr) to a file so that you can see it:

0 8 * * * echo "on 0" | /usr/bin/cec-client -s >> /home/pi/cronjoblog 2>&1 

Assuming that you are logged in as user pi, this will put any error message generated in the file cronjoblog in your home directory. Actually, the >> will append the output to the end of the file, so if you run this several times, the error messages will be added to the end of the file. If you want to overwrite the file instead of append, replace the >> with >

Seamus
  • 23,558
  • 5
  • 42
  • 83