I know there are aready many questions about this topic, but no answer could solve my problem.
I use a Raspberry Pi B+ with the operating System Raspbian Jessie. The Raspberry is said to synchronize with an intern NTP server for the correct time. Further the Raspberry Pi shall play an audio file at a concrete time.
The command for the audio is saved in a script.
crontab -e
@reboot sudo ntpdate -s 10.0.5.3
@hourly sudo ntpdate -s 10.0.5.3
00 9 * * * /home/pi/script.sh
20 9 * * * /home/pi/script.sh
00 12 * * * /home/pi/script.sh
40 12 * * * /home/pi/script.sh
00 16 * * * /home/pi/script.sh
script.sh:
omxplayer audio.wav
The log shows following:
Jan 29 10:00:01 PiName CRON[726]: (root) CMD (sudo ntpdate -s 10.0.5.3)
Jan 29 10:17:01 PiName CRON[757]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jan 29 11:00:01 PiName CRON[779]: (root) CMD (sudo ntpdate -s 10.0.5.3)
Jan 29 11:17:02 PiName CRON[807]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jan 29 12:00:01 PiName CRON[836]: (root) CMD (sudo ntpdate -s 10.0.5.3)
Jan 29 12:00:01 PiName CRON[837]: (root) CMD (omxplayer audio.wav)
Jan 29 12:00:03 PiName CRON[822]: (CRON) info (No MTA installed, discarding output)
The problem is that there is no sound played, if the time is reached. On another Raspberry Pi B with Raspbian wheezy, it works successful.
Thank you very much for every answer.