This is my fun raspberry pi project, which is based on the Tagespaul app Originally, this was developed as a birthday present to my girlfriend.
The Tagespaul 2.0 is powered by a raspberry pi 3.0 which is connected to 4 buttons and a chain of LED lights as well as a small sound system. The pi is embedded in a round plastic box (old protein shake) and surrounded by a lantern. This raspberry pi supports wifi, which allows to update the software as well as the sound via SSH.
The Tagespaul loop continuously runs a color program for the LED lights and listens to button triggers. Ones a button is triggered it activates one of
4 different sound options and color programs. The sound is randomly taken from a choice stored in sounds\*
and is different every day.
The PI checks the date via Wifi.
Connect a screen, mouse and keyboard to the PI and setup the wifi and enable ssh. Get the IP address of the PI with:
ifconfig wlan0
- Install the requirements to run the copy2rpi.py script with conda/mamba
mamba create --name tagespaul-remote --file requirements.txt
- Add the PI IP address in the
.env
file.
mamba activate tagespaul-remote
python copy2rpi.py
Each time you update this folder, e.g. when you add/change the sounds, you can update the folder on the PI with this script.
Activate SPI: https://www.raspberrypi-spy.co.uk/2014/08/enabling-the-spi-interface-on-the-raspberry-pi/
mkdir -p /home/pi/Projects/tagespaul_2.0
cd /home/pi/Projects/tagespaul_2.0/
pip3 install -r requirements_PI.txt
sudo apt-get install mplayer #we use mplayer to play the sounds
To run the script on PI startup add this text to the /etc/rc.local
file with:
sudo nano /etc/rc.local
sudo -H -u pi /usr/bin/python3 /home/pi/Projects/tagespaul_2.0/tagespaul/tagespaul.py > /home/pi/Projects/tagespaul_2.0/tagespaul/log.txt 2>&1
exit 0
And make /etc/rc.local
executable with:
sudo chmod +x /etc/rc.local
- fix sound folder (add empty folder)
- PI pi set
- remove
Note: does not work on pi yet
Install:
- https://askubuntu.com/questions/1102282/qdbus-returns-an-error-ubuntu-18-04 (qdbus-qt5)
- sudo apt install libdbus-1-dev
Play:
dbus-send --print-reply --session --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.OpenUri "string:spotify:album:4sb0eMpDn3upAFfyi4q2rw" #https://community.spotify.com/t5/Desktop-Linux/DBus-OpenUri-not-playing/td-p/1233569
Install: