Files
piplayer/notes.md
T
2017-10-10 23:30:19 +02:00

8.0 KiB

To Do

mopidy / spotify

Installation

https://www.raspberrypi.org/documentation/remote-access/ssh/ --> file "ssh" on boot partition

[basic setup]

sudo apt-get install python-pip sudo apt-get install python3-pip sudo pip3 install requests

curl https://get.pimoroni.com/phatdac | bash --> reboot --> test curl https://get.pimoroni.com/phatdac | bash

nach https://docs.mopidy.com/en/latest/installation/ 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/jessie.list sudo apt-get update sudo apt-get install mopidy

nach https://github.com/mopidy/mopidy-spotify#installation sudo apt-get install mopidy-spotify

https://docs.mopidy.com/en/latest/ext/web/#mopidy-api-explorer sudo pip install Mopidy-API-Explorer --> http://localhost:6680/api_explorer/

sudo apt-get install ncmpcpp

--> https://www.mopidy.com/authenticate/#spotify

installation for user pi

create config

mopidy config nano ~/.config/mopidy/mopidy.conf

[http] hostname = ::

[local] enabled = false

[spotify] username = tliero@gmx.net password = ******** client_id = client_secret =

#[spotify_web] #client_id = #client_secret = <secret from authentication

nach https://github.com/pimusicbox/mopidy-musicbox-webclient#installation pip install mopidy-musicbox-webclient

Service einrichten (https://docs.mopidy.com/en/latest/service/)

sudo mopidyctl config

sudo nano /etc/mopidy/mopidy.conf [http] hostname = :: static_dir = /opt/webclient

[local] enabled = false

[spotify] username = tliero@gmx.net password = ******** client_id = client_secret =

sudo systemctl enable mopidy sudo reboot sudo systemctl status mopidy --> http://192.168.1.142:6680/mopidy/

sudo apt-get install git

moped web client https://github.com/martijnboland/moped

sudo mkdir /opt/webclient cd /opt/webclient sudo git clone https://github.com/martijnboland/moped.git sudo mv moped/dist/* . cd .. sudo chown -R mopidy webclient sudo service mopidy restart --> http://192.168.1.142:6680/

alternativ: musicbox web client https://github.com/pimusicbox/mopidy-musicbox-webclient

sudo mkdir /opt/mopidy-musicbox-webclient cd /opt/mopidy-musicbox-webclient/ sudo git clone https://github.com/pimusicbox/mopidy-musicbox-webclient cd mopidy-musicbox-webclient sudo python setup.py install cd .. sudo mv mopidy-musicbox-webclient/dist/* . cd .. sudo chown -R mopidy mopidy-musicbox-webclient sudo service mopidy restart --> http://192.168.1.142:6680/musicbox_webclient/

sudo mkdir /media/share sudo chmod 777 /media/share sudo nano /etc/rc.local

mount share

sudo mount -t cifs -o user=guest,password= //192.168.1.110/hidrive/Media/Audio /home/pi/share #sudo mount -t cifs -o user=guest,password= //192.168.1.125/hidrive/Media/Audio /media/share sudo reboot

mopidy Dokumentation

http://localhost:6680/api_explorer/#/library.search https://docs.mopidy.com/en/latest/api/core/#mopidy.core.mopidy.core.LibraryController https://docs.mopidy.com/en/latest/ext/file/ https://docs.mopidy.com/en/latest/service/

ncmpcpp

sudo apt-get install ncmpcpp https://wiki.archlinux.org/index.php/ncmpcpp#Basic_usage

JSON-RPC

curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.describe"}' http://127.0.0.1:6680/mopidy/rpc

curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.playback.pause"}' http://127.0.0.1:6680/mopidy/rpc curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.playback.resume"}' http://127.0.0.1:6680/mopidy/rpc

curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.clear"}' http://127.0.0.1:6680/mopidy/rpc

curl -X POST -H Content-Type:application/json -d '{"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.add" , "params": {"uri": "spotify:user:tliero:playlist:08pbBkT5Vd2xXhxrMCVbAH"}}' http://127.0.0.1:6680/mopidy/rpc curl -X POST -H Content-Type:application/json -d '{"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.add" , "params": {"uri": "spotify:track:5tf1VVWniHgryyumXyJM7w"}}' http://127.0.0.1:6680/mopidy/rpc curl -X POST -H Content-Type:application/json -d '{"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.add" , "params": {"uri": "file:///home/tilman/Musik/04%20-%20The%20Funeral.mp3"}}' http://127.0.0.1:6680/mopidy/rpc curl -X POST -H Content-Type:application/json -d '{"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.add" , "params": {"uri": "http://www.wdr.de/wdrlive/media/kiraka.m3u"}}' http://127.0.0.1:6680/mopidy/rpc

curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.playback.play"}' http://127.0.0.1:6680/mopidy/rpc

curl -X POST -H Content-Type:application/json -d '{"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.add" , "params": {"uri": "file:///media/share/Singles/04%20-%20The%20Funeral.mp3"}}' http://192.168.1.142:6680/mopidy/rpc curl -X POST -H Content-Type:application/json -d '{"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.add" , "params": {"uri": "file:///home/pi/sounds/scanning.mp3"}}' http://192.168.1.142:6680/mopidy/rpc curl -X POST -H Content-Type:application/json -d '{"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.add" , "params": {"uri": "http://www.wdr.de/wdrlive/media/kiraka.m3u"}}' http://192.168.1.142:6680/mopidy/rpc curl -X POST -H Content-Type:application/json -d '{"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.add" , "params": {"uri": "spotify:user:tliero:playlist:08pbBkT5Vd2xXhxrMCVbAH"}}' http://192.168.1.142:6680/mopidy/rpc

Spotify URLs

https://open.spotify.com/track/3jQyadhLTxpxadQlkFh2b8 https://open.spotify.com/episode/1o8HWRR0mx5TfyxLlnKv8e https://open.spotify.com/show/4zQKHBLkM3puG5n3jAU2H4 https://open.spotify.com/album/0BajiiFeEZv9eEx07Hw2C0

Hardware

CNY70

Einrichtung

  • SD Card read only: "Raspberry in Blue", c't 21/2016, S. 152
    • Update unter https://www.heise.de/ct/ausgabe/2016-21-Den-Raspi-als-Bluetooth-Empfaenger-einsetzen-3330683.html In der Befehlsfolge auf Seite 154 fehlt in der ersten Zeile ein Leerzeichen. Der Befehl zum Löschen der Dateien lautet korrekt: sudo rm -rf /var/lib/dhcp/ /var/spool /var/lock /etc/resolv.conf
    • Falls Sie das Dateisystem doch nochmal ändern oder Updates einspielen wollen, können Sie es mit "sudo mount -o rw,remount /" und "sudo mount -o rw,remount /boot" wieder temporär beschreibbar machen.

Scripting

Gehäuse

  • Buttons per Acryl-Transfer beschriften? ch.16.05.110-115.pdf
  • Beim Zusammenbau Kamera vor dem Verkleben testen

Sonstiges

  • Backup SD Card sudo dd if=/dev/mmcblk0 of=/media/tilman/ROT/raspberry-pi-zero_before-read-only.img bs=4M
  • Passwort ändern und aufkleben

Google Drive

sudo mount -o rw,remount / && sudo mount -o rw,remount /boot nach https://github.com/astrada/google-drive-ocamlfuse/wiki/How-to-install-from-source-on-Debian-Jessie https://github.com/astrada/google-drive-ocamlfuse/wiki/Authorization https://github.com/astrada/google-drive-ocamlfuse/wiki/Headless-Usage-%26-Authorization

Noch schreiben

  • Spiegel-Problem
  • Ausblick: App
  • Google
  • Stromverbrauch messen