# Listener mopidy

1. install raspian lite 64
2. boot
3. configure default sound card

sudo apt install git vim zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"



* sudo apt install mpd mpc
* sudo raspi-config and enable spi
* wget -q -O - https://apt.mopidy.com/mopidy.gpg | sudo apt-key add -
* sudo wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/buster.list
* sudo apt update
* sudo apt install mopidy python3-rpi.gpio python3-spidev python3-pip python3-pil python3-numpy
* python3 -m venv ./
* sudo apt install cmake libcairo2-dev
* sudo bin/pip3 install Mopidy-PiDi pidi-display-pil pidi-display-st7789 mopidy-raspberry-gpio pillow image ST7789
* sudo touch /etc/mopidy/mopidy.conf

```
[raspberry-gpio]
enabled = true
bcm5 = play_pause,active_low,150
bcm6 = volume_down,active_low,150
bcm16 = next,active_low,150
bcm20 = volume_up,active_low,150

[pidi]
enabled = true
display = st7789

[mpd]
hostname = 0.0.0.0

[http]
hostname = 0.0.0.0

[audio]
mixer_volume = 40
output = alsasink

[stream]
enabled = true
protocols =
    http
    https
    mms
    rtmp
    rtmps
    rtsp
timeout = 5000
metadata_blacklist =

```

* sudo usermod -a -G spi,i2c,gpio,video mopidy
* sudo systemctl enable mopidy
* sudo systemctl start mopidy


* sudo vim /var/lib/mopidy/portal.m3u

```
#EXTM3U
#EXTINF:0,Portal
    http://108.204.128.201:1313/portal.m3u
```

* sudo apt install ncmpcpp

* sudo systemctl stop mopidy
* sudo systemctl start mpd
* mpc add http://108.204.128.201:1313/portal.m3u
* mpc play

* sudo vim /etc/mpd.conf
  * configure audio output
* sudo systemctl restart mpd
