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.
sudo vim /boot/config.txt
And add these lines to the bottom
dtparam=spi=on
dtoverlay=mz61581
Then save and reboot
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"
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)
> 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;
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
sudo rpi-update e1050e94821a70b2e4c72b318d6c6c968552e9a2