Skip to content

papabricole/rpiclock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry Pi clock

A clock + weather display using a Raspberry Pi with a 3.5" LCD display retrofitted inside an Areaware iPhone Dock. This hack require to hollow out the dock since it's a massive block of wood. The "iPhone" like front panel is composed of a laser cut plexiglass with the back painted black leaving a window for the display, and finally an aluminum band carefully bended and glued with epoxy.

Instructions (brain dump)

Tontec 3.5” Screen Driver Install Instructions - Model: MZ61581

Enable SPI and set overlay for Tontec MZ61581 Screen

sudo vim /boot/config.txt

And add these lines to the bottom

dtparam=spi=on
dtoverlay=mz61581

Then save and reboot

Set Tontec 3.5 Screen as the default display instead of HDMI

Here we will change the default output display from HDMI to Tontec Screen

sudo apt install xserver-xorg-video-fbturbo

sudo vim /usr/share/X11/xorg.conf.d/99-fbturbo.conf

Change
          Option          "fbdev" "/dev/fb0"
To
          Option          "fbdev" "/dev/fb1"

Edit cmdline.txt

Here we will enable Tontec Screen to display during the booting process

sudo vim /boot/cmdline.txt

Add fbcon=map:10 at the end of current line. (No need to start a new line)

Autostart

> cat .bash_profile 
if [ -z $DISPLAY ] && [ $(tty) = /dev/tty1 ]
then
  startx
fi


> cat .xinitrc 
#!/usr/bin/env sh
xset s off
xset -dpms 
xset s noblank

while true; do
  /usr/local/bin/rpiclock >> ~/rpiclock.log 2>&1
done;

Backlight

Turn off backlight

echo 1 | sudo tee /sys/class/backlight/*/bl_power

Turn on backlight

echo 0 | sudo tee /sys/class/backlight/*/bl_power

Crontab

sudo crontab -e
00 23 * * * echo 1 | sudo tee /sys/class/backlight/*/bl_power
00 07 * * * echo 0 | sudo tee /sys/class/backlight/*/bl_power

Firmware

sudo rpi-update e1050e94821a70b2e4c72b318d6c6c968552e9a2

About

Raspberry Pi clock

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published