Skip to content

Latest commit

 

History

History
72 lines (67 loc) · 4.14 KB

README.md

File metadata and controls

72 lines (67 loc) · 4.14 KB

phoniebox_installation

documenting building my phoniebox

Installing raspberry pi os

Spotify

  • mopidy-spotify doesn't play after reboot because it cannot login because internet is not up yet
  • Checking mopidy logs about spotify logins: journalctl -u mopidy -b --grep spotify.web (-b since last boot)
  • Restarting mopidy service: sudo systemctl restart mopidy (this work, after service restart, spotify connects)
    • setting allow_playlists = false in /etc/mopidy/mopidy.conf makes restarting mopidy service a lot faster (almost instant) because it doesn't sync all spotify playlists which takes 10-30s (obviously depending on the number of playlists in the account)
    • putting sudo systemctl restart mopidy into /etc/rc.local doesn't work (presumably because internet is not available yet when it runs)
    • As a workround: wrote a service script that keeps polling for internet connection and once established, restarts mopidy service, then exits. Must be running in background without blocking anything else. Also added a card that restarts mopidy service and plays a confirmation sound if login was succesful.
      • settings/rfid_trigger_play.conf: add trigger variable with card id
        ### Restart mopidy service and thus retry spotify login
        RESTARTMOPIDY="0003529101"
        
      • scripts/rfid_trigger_play.sh: add action called when card is scanned:
              $RESTARTMOPIDY)
              sudo service mopidy-retry-login restart
              ;;
      

workaround for spotidy

relax autohotstop

autohotstop service was to agressive and impatient, when scanning for SSIDs, we mostly received 'device busy'. After 5 retries it started the hotspot which disabled the already running wifi connection. I increased the retry it waits until wifi device is available from 5 to 10.

restart mopidy once internet is available

  1. checkout the 3 files in this repository and create a systemd service.
  2. service definition goes in /etc/systemd/system/mopidy-retry-login.service
sudo chmod a+x /usr/bin/wait-for-internet.sh
sudo chmod a+x /usr/bin/mopidy-restart-to-login.sh
sudo systemctl enable mopidy-retry-login

Improvements

faster startup