Spotify on My Xiaomi Vacuum Cleaner

This is one of those projects where I never stopped to ask why. But just in case you also want a vacuum cleaner that can double as a Spotify Connect speaker, I can help point you in the right direction.

First, the end result:

This requires very little technical ability because all the hard work has been done by smart people.

  1. You will need to follow instructions here to get SSH access as root onto your Xiaomi Vacuum: https://github.com/dgiese/dustcloud.

  2. Install curl on your vacuum:
    apt-get install -y curl

  3. Follow the tl;dr instructions here to install raspotify: https://github.com/dtcooper/raspotify.

  4. Raspotify expects a systemd service manager but Ubuntu 14.04 uses upstart so we will need to create our own upstart .conf so it starts and runs Librespot as a service on boot.
    I made a super basic one which you can copy below:

    root@rockrobo:~# chmod 644 /etc/init/librespot.conf
    root@rockrobo:~# cat /etc/init/librespot.conf
    description "Librespot"
    start on filesystem and net-device-up IFACE=wlan0
    exec /usr/bin/librespot --name "rockrobo" --bitrate 320
    
  5. With that in place you should now be able to start Librespot as a service:
    service librespot start