Setting up a toniebox like audio playback device
- Install raspberry pi OS on SD card using raspberry pi imager (https://www.raspberrypi.org/software/)
- create
sshfile on SD card to enable ssh - boot sd card in raspberry pi
- Ssh into it
- Switch python version(*):
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10 - Add mopidy gpg key
wget -q -O - https://apt.mopidy.com/mopidy.gpg | sudo apt-key add - sudo wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/buster.list- Install python3-spotify
sudo apt-get update
sudo apt-get install python3-spotify
- Find api key https://github.com/search?q=spotify-appkey
- install pyalsaaudio
pip install pyalsaaudio - if you have installed the full raspbian you might want to get rid of the screen reader install instruction audio file playing every 30s:
ps -eaf | grep wizand then kill the processpiwizsudo rm /etc/xdg/autostart/piwiz.desktop
- copy files
- copy service file to root
sudo cp myscript.service /etc/systemd/system/myscript.service - reload services
sudo systemctl daemon-reload - enable service
sudo systemctl enable myscript.service
*(undo with sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10