Montag, 20. Oktober 2014

Raspberry Standard Time

permanent standard time clock

powered by raspberry pi








Install rasperiam wheezy on  an 16GB SD Card. Resize the card to full access

buy a standard time DVD from http://www.standard-time.com

* copy the st24.mov to your favorite folder ie /home/pi/time

* autologin to your raspberry pi:

edit /etc/inittab change

# 1:2345:respawn:/sbin/getty --noclear 38400 tty1
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1


* edit /boot/config.txt change overscan

disable_overscan=1

* edit /etc/kbd/config to disable blank screen

BLANK_TIME=0
BLANK_DPMS=off
POWERDOWN_TIME=0


* Install omxplayer

* edit a script to restart at 00:00 the omxplayer i.e. startst.sh

for i in $(ps -ax | grep omxplayer | cut -d " " -f2 )
do
  echo $i
  sudo kill $i
 sleep 2
done
clear

dat=$(date | cut -c 12-19 | awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }')
/usr/bin/omxplayer -l $dat /home/pi/time/st24.mov


* cron your script every 00:00

crontab -l
#
59 23 * * * /home/pi/startst.sh

* To disable display during night hours you can cron this scripts to disable hdmi and enable hdmi


$ cat moff.sh
tvservice -o


$ cat mon.sh
#!/bin/bash
tvservice -p
sleep 1
sudo chvt 6
sleep 1
sudo chvt 7







Options to start with different players at actual time:


mplayer --ss hh:mm:ss (will not work in fullscreen on my 1920 x 1024 display)

omxplayer -l (in seconds) i.e 20:00:40 = 20 x 3600 + 0 x 60 + 40 x 1 = 72040



Keine Kommentare:

Kommentar veröffentlichen