/PIXETTE

📟 Time/weather/currency display using a Raspberry Pi Zero with Waveshare LCD HAT

Primary LanguagePythonMIT LicenseMIT

📟 Time/weather/currency display using a Raspberry Pi Zero with Waveshare LCD HAT

Hardware

Installation

  1. Install system libraries
$ sudo apt install git cmake python3-pip python3-dev python3-pygame python3-gpiozero python3-requests libsdl2-dev libsdl2-ttf-dev
  1. Enable SPI

Enable SPI in Interfacing Options > SPI in raspi-config

$ sudo raspi-config
  1. Add the following lines to /etc/modules
spi-bcm2835
fbtft_device
  1. Add the following lines to /etc/modprobe.d/fbtft.conf
options fbtft_device name=adafruit18_green gpios=reset:27,dc:25,cs:8,led:24 speed=40000000 bgr=1 fps=60 custom=1 height=128 width=128 rotate=90
  1. Add the following lines to /boot/config.txt
disable_overscan=1
dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4
hdmi_force_hotplug=1
hdmi_cvt=128 128 60 1 0 0 0
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
display_rotate=0
  1. Copy between fb0 and fb1
$ git clone https://github.com/tasanakorn/rpi-fbcp
$ mkdir rpi-fbcp/build
$ cd rpi-fbcp/build/
$ cmake .. && make
$ sudo install fbcp /usr/local/bin/fbcp

To launch fbcp automatically at startup, add the following lines to /etc/rc.local before exit 0:

fbcp&

Test the configuration

To test the Raspberry Pi framebuffer configuration use the Linux Framebuffer Imageviewer:

$ sudo apt install fbi
$ sudo fbi -T 2 -d /dev/fb1 image.png

Usage

  • Install requirements
$ pip install -r requirements.txt
  • Run application with sudo (root access is necessary to modify the framebuffer).
$ sudo python3 -m pixette
  • Add this to /etc/rc.local to run PIXETTE at startup:
$ cd /home/pi/pixette
$ sudo python3 -m pixette &

License

PIXETTE is under the terms of the MIT License, following all clarifications stated in the license file.