Skip to content

Simple Clock for the Raspberry Pi, using OpenVG for its output

License

Notifications You must be signed in to change notification settings

simonhyde/PiClock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PiClock

Simple studio clock for linux. This was originally built using OpenVG on Raspberry Pi for its output, but now uses plain OpenGL and works fine on normal XOrg on Debian.

Checkout

Checkout this project by:

        # Install git if you don't already have it
	sudo apt-get install git
        # Checkout the main project and it's submodules
	git clone --recursive https://github.com/simonhyde/PiClock.git

Build

  1. First you'll need to install some dependencies (ntpdate is only suggested for runtime):
	sudo apt-get install libjpeg-dev libboost-program-options-dev libboost-system-dev libssl-dev libmagick++-dev libb64-dev freeglut3-dev libglew-dev x11-xserver-utils xinit ntp ntpdate libglfw3-dev premake4
  1. Change to the directory you checked the code out into; probably:
	cd PiClock
  1. Compile:
	make
  1. Run:
	./piclock

Configure NTP

You may want to add/change your NTP servers (in /etc/ntp.conf)

Running at startup

To configure this to run at startup, I did the following:

  1. Add a new user to run the clock:
	sudo adduser --disabled-password piclock
	sudo usermod --append --groups spi,video piclock
  1. Make the user profile run the clock:
	sudo editor ~piclock/.bashrc

	# And add a line to the end, something like: /home/pi/PiClock/piclock-startx-wrapper
  1. Enable text-mode autologin using raspi-config:
	sudo raspi-config
	
	#Boot Options, Desktop/CLI, Console Autologin
  1. Make the system auto-login as the piclock user:
	sudo editor /etc/systemd/system/getty@tty1.service.d/autologin.config

and change:

	ExecStart=-/sbin/agetty --autologin pi --noclear %I $TERM

to:

	ExecStart=-/sbin/agetty --autologin piclock --noclear %I $TERM

(ie change pi to piclock)

Switching to Read Only SD Card

Once you've got everything working, you may want to make the SD card read-only, to prevent future corruption/wearing out the SD card. The easiest way to do this nowadays is to use the Overlay FS option built into raspi-config, however this seems to cause the network interface to be accidentally renamed, so you first have to delete the rule that's messing that up:

	sudo rm /lib/udev/rules.d/73-usb-net-by-mac.rules

	sudo raspi-config
	#Advanced, Overlay FS, Enable Overlay FS, and set boot filesystem to write-protected/read-only

About

Simple Clock for the Raspberry Pi, using OpenVG for its output

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published