August 25, 2024
Description
Basically, If you own a 1960s Westinghouse H816L5 and want to install a RPI4 in it without chopping it up too much to use Spotify, this is for you. Or if you need to reprint a missing piece, these models might help you out.
If you don't own one already and are a brave person that is great at printing supports, then you can try to print a new one from the replacement mockups I modeled. (I have never tried this, and if you do, please, please, let me know how it goes).
https://github.com/MacGyverr/Westinghouse-Spotify-Clock
I owned a broken H816L5 and wanted to give it some new life so I replicated the Westinghouse H816L5 clock in TinkerCAD to design parts for mounting a Raspberry Pi and a modern clock, transforming it into a Spotify speaker while keeping the original shell mostly intact.
The project involved some modifications to the original structure, you'll need to grind down the internal lip behind the volume knob. It uses Raspotify and Spotipy, controlled by a Python script. It features three rotary encoders for track control/shuffle, power/play/pause/volume, and playlist navigation.
1. Prepare the Raspberry Pi:
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y install git pip espeak 2. Configure Rotary Encoders in config.txt:
sudo nano /boot/config.txtAdd the following lines
dtoverlay=rotary-encoder,pin_a=16,pin_b=12,relative_axis=1
dtoverlay=gpio-key,gpio=26,keycode=30,label="A"
dtoverlay=rotary-encoder,pin_a=5,pin_b=6,relative_axis=1
dtoverlay=gpio-key,gpio=13,keycode=48,label="B"
dtoverlay=rotary-encoder,pin_a=22,pin_b=27,relative_axis=1
dtoverlay=gpio-key,gpio=17,keycode=46,label="C" After editing, reboot and test with evtest. They are added this way for reliability and readability under Python.
3. Install Audio Hat Drivers for MIC ULTRA+:
git clone https://github.com/RASPIAUDIO/ultra2
cd ultra2
sudo ./install.sh sudo reboot 4. Install and Configure Raspotify:
* Follow the guide at [Raspotify](https://dtcooper.github.io/raspotify/)
* Edit /etc/raspotify/conf as per the provided conf file.
* Restart the service and set volumes using alsamixer.
5. Install Spotipy and Additional Packages for LEDs and TTS prompts:
sudo pip install spotipy
sudo pip install adafruit-circuitpython-neopixel
sudo pip3 install pyttsx3 6. Setup the primary Python Script for Control:
mkdir westinghouse
cd westinghouse/
nano monitor_input.pychmod +x monitor_input.py 7. Configure Spotify API Credentials:
export SPOTIPY_CLIENT_ID='xxxxxxxxxxxxxxxxxxxxxxxx' export SPOTIPY_CLIENT_SECRET='xxxxxxxxxxxxxxxxxxxx' export SPOTIPY_REDIRECT_URI='http://localhost:8080/callback' 8. Setup Python Script as a Service:
sudo nano /etc/systemd/system/monitor_input.py.servicePaste in the contents of the "monitor_input.py.service" file.
Set it as a service (so it will auto-start and reload if it crashes).
sudo systemctl enable monitor_input.py
sudo systemctl daemon-reload
sudo systemctl start monitor_input.py systemctl | grep running 9. Automatic Reboot Setup:Â
sudo crontab -e0 2*** /sbin/shutdown -r nowÂ
Category: Audio
License:
Creative Commons — Attribution — Noncommercial