A touch screen (Adafruit PiTFT Plus 3.5") Sonos controller for Raspberry Pi. Runs in a Docker container.
This controller relies upon the SoCo library for communicating with Sonos speakers and the pygame library for the UI.
sudo apt install libsdl2-dev sudo apt-get install python3-sdl2 echo 'SUBSYSTEM=="backlight",RUN+="/bin/chmod 666 /sys/class/backlight/%k/brightness /sys/class/backlight/%k/bl_power"' | sudo tee -a /etc/udev/rules.d/backlight-permissions.rules
The sonos-pi-controller includes the following features:
- Familiar interface similar to the official Sonos controller
- Stays synced with all your other Sonos controllers
- View album art, track name, artist, album
- Select room (top right icon)
- Group rooms (bottom right icon)
- Select/deselect all rooms (top right party icon)
- Select music from music library (top left icon)
- Artists
- Albums
- Genres
- Playlists (Imported Playlists)
- Favorites (i.e., items added to 'My Sonos')
- Play & Pause
- Next & Previous Track
- Adjust volume (including grouped rooms)
- Mute and unmute
- Automatic backlight shutoff after period of inactivity
- Raspberry Pi 3B or armv7 compatible version
- Adafruit PiTFT Plus 3.5" TFT+Touchscreen
- Optional: PiTFT Pibow+ Case
- Flash your Raspberry Pi with the latest Raspberry Pi OS Lite (right now it's buster)
- Login to your Pi via SSH and install docker, docker-compose, and git.
- Here is a very helpful guide if you need help.
- Attach your touchscreen to the Pi, reboot, and run the installer script from Adafruit to setup your touchscreen.
- Choose 0 degrees (portrait) for the rotation.
- Answer Yes when asked Would you like the console to appear on the PiTFT display?.
- My personal settings in
/boot/config.txt
:gpu_mem=16 # --- added by adafruit-pitft-helper Tue 30 Oct 10:12:27 MDT 2018 --- dtparam=spi=on dtparam=i2c1=on dtparam=i2c_arm=on dtoverlay=pitft35-resistive,rotate=0,speed=32000000,fps=60 # --- end adafruit-pitft-helper Tue 30 Oct 10:12:27 MDT 2018 ---
- Copy
sample.env
to.env
and adjustBACKLIGHT_TIMEOUT
to your preference. The default is 30 seconds. - Start the container with:
docker-compose up -d
If your touchscreen is not calibrated correctly, try running the calibration program:
sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate