Skip to content

A touch screen (Adafruit PiTFT 3.5") Sonos controller for Raspberry Pi. Runs in a docker container.

License

Notifications You must be signed in to change notification settings

Villarrealized/sonos-pi-controller

Repository files navigation

sonos-pi-controller

A touch screen (Adafruit PiTFT 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.

Now Playing Raspberry Pi Controller mounted to wall

Features

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 (ex. 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

Planned Upgrades

  • Ability to view song queue, select a song in queue & adjust playback mode (normal, shuffle, repeat)
    • Replace select room icon with a queue icon
    • Room selection will be available via tapping on room name.

Installation & Requirements

You will need the following hardware:

Installation

  • Flash your Raspberry Pi with the latest Raspbian Lite (right now it's stretch)
  • 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 orientation
    • Choose PiTFT as text console.
    • 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 ---
  • Build base Dockerfile image with pygame, pip, and SDL 1.2 support
    docker build -t villarrealized/debian-pygame-base -f Dockerfile.base .
  • Build main Dockerfile image with
    docker-compose build
  • Copy sample.env to .env and adjust BACKLIGHT_TIMEOUT to your preference. Default is 30 seconds.
  • Run docker-compose up -d and enjoy your Raspberry Pi Sonos Controller!

Screenshots

Now Playing Select Room Group Rooms Music Library Select Artist Select Track Select Favorite Raspberry Pi Controller mounted to wall

Troubleshooting

If you have any issues getting started, please reach out and I will try to help.

If your touchscreen is not calibrated correctly, try running the calibration program:

sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate

About

A touch screen (Adafruit PiTFT 3.5") Sonos controller for Raspberry Pi. Runs in a docker container.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published