Made with Newbattle High School students and the University of Edinburgh as part of the Everybody Makes The School project. Play music snippets based on current weather conditions. Uses live data from Yahoo Weather and Spotify.
The requirements.txt file lists all the Python packages needed to run the app.
To install them run this command:
pip3 install -r requirements.txtDepending on the computer, these libraries may also be needed. Install them by running these commands:
sudo apt-get install python-gst-1.0
sudo apt-get install pulseaudioAPI keys for Yahoo and Spotify are stored in the .env file.
Treat these like passwords and keep them secret.
Internet connection test:
ping bbc.co.ukSound test:
speaker-test -c2This lets you control the sound levels if they need adjusted:
alsamixerWeather test:
python3 test_weather.pyVLC test:
python3 test_vlc.pypython3 cloud.pyOther libraries that might be needed:
gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly
https://crontab-generator.org/ https://www.raspberrypi.org/documentation/linux/usage/cron.md
python3 test_cron.py >> log.txt
python3 /home/pi/Desktop/newbattle-sound-cloud/test_cron.py >> /home/pi/Desktop/newbattle-sound-cloud/log.txt
* * * * * python3 /home/pi/Desktop/newbattle-sound-cloud/test_cron.py >> /home/pi/Desktop/newbattle-sound-cloud/log.txt
* * * * * python3 /home/pi/Desktop/newbattle-sound-cloud/test_vlc.py >> /home/p$https://developer.yahoo.com/weather/documentation.html
Condition codes https://developer.yahoo.com/weather/documentation.html#codes
This command switches the audio output to HDMI:
amixer cset numid=3 2Here the output is set to 2, which is HDMI. Setting the output to 1 switches to analogue (headphone jack). The default setting is 0 which is automatic.
