diff --git a/notes.md b/notes.md index 8368a2d..e77e15a 100644 --- a/notes.md +++ b/notes.md @@ -34,35 +34,10 @@ 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 = client_secret = + sudo systemctl enable mopidy sudo reboot @@ -127,6 +110,54 @@ sudo nano /etc/rc.local sudo reboot +### piplayer as service +sudo nano /lib/systemd/system/piplayer.service + [Unit] + Description=piplayer + After=mopidy.service + Requires=mopidy.service + + [Service] + Type=simple + #ExecStart=/usr/bin/python3 /home/pi/piplayer3.py > /tmp/piplayer3.log 2>&1 + ExecStart=/bin/bash -c 'exec python3 /home/pi/piplayer3.py >> /tmp/piplayer3.log 2>&1' + User=pi + + [Install] + WantedBy=multi-user.target + +sudo systemctl daemon-reload +sudo systemctl enable piplayer.service + +-- nach reboot +systemctl +systemctl list-dependencies piplayer +journalctl -e +sudo systemctl restart piplayer.service + + +# Fehlerbehebung +[1] Nov 22 19:05:20 raspberrypi ntpd[445]: frequency file /var/lib/ntp/ntp.drift.TEMP: Read-only file system +[2] Nov 22 19:58:37 raspberrypi mopidy[403]: ERROR Error reading playlist m3u:%5BRadio%20Streams%5D.m3u8: Permission denied +[3] Nov 22 20:29:43 raspberrypi mopidy[403]: ERROR Loading logging config '/etc/mopidy/logging.conf' failed. [Errno 2] No such file or directory: '/var/log/ + +--> Lösungen +[1] +sudo nano /etc/ntp.conf + #driftfile /var/lib/ntp/ntp.drift + driftfile /tmp/ntp.drift + +[2] +#sudo chmod 777 /var/lib/mopidy/playlists/\[Radio\ Streams\].m3u8 +sudo chmod 777 /media/share/Kinder/00_playlists/\[Radio\ Streams\].m3u8 + +[3] +sudo nano /etc/mopidy/logging.conf + #args = ('/var/log/mopidy/mopidy.log',) + args = ('/tmp/mopidy.log',) + + +# Switch to RAM disk and set the filesystem read-only ### fstab proc /proc proc defaults 0 0 /dev/mmcblk0p1 /boot vfat defaults,ro 0 2 @@ -139,6 +170,33 @@ tmpfs /home/pi/.config tmpfs nodev,nosuid,mode=1777,uid=pi tmpfs /var/lib/mopidy/.config tmpfs nodev,nosuid,mode=1777,uid=mopidy 0 0 +## Info ausgeben +dmesg +journalctl -e +cat /tmp/mopidy.log + + +## mopidy erst nach rc.local starten, damit log auf Netzlaufwerk liegen kann und alle Medien-Dateien erreichbar sind +sudo nano /lib/systemd/system/mopidy.service + After=rc.local.service + + +## piplayer3.log auf Server +sudo -u nobody touch /media/share/Kinder/piplayer3.log +sudo chmod 777 /media/share/Kinder/piplayer3.log +ls -l /media/share/Kinder/piplayer3.log + +sudo nano /lib/systemd/system/piplayer.service + #ExecStart=/bin/bash -c 'exec python3 /home/pi/piplayer3.py >> /tmp/piplayer3.log 2>&1' + ExecStart=/bin/bash -c 'exec python3 /home/pi/piplayer3.py > /media/share/Kinder/piplayer3.log 2>&1' + + + + + + + + #### mopidy Dokumentation http://localhost:6680/api_explorer/#/library.search https://docs.mopidy.com/en/latest/api/core/#mopidy.core.mopidy.core.LibraryController @@ -183,30 +241,6 @@ https://open.spotify.com/show/4zQKHBLkM3puG5n3jAU2H4 https://open.spotify.com/album/0BajiiFeEZv9eEx07Hw2C0 -### piplayer as service -sudo nano /lib/systemd/system/piplayer.service - [Unit] - Description=piplayer - After=mopidy.service - Requires=mopidy.service - - [Service] - Type=simple - #ExecStart=/usr/bin/python3 /home/pi/piplayer3.py > /tmp/piplayer3.log 2>&1 - ExecStart=/bin/bash -c 'exec python3 /home/pi/piplayer3.py >> /tmp/piplayer3.log 2>&1' - User=pi - - [Install] - WantedBy=multi-user.target - -sudo systemctl daemon-reload -sudo systemctl enable piplayer.service - --- nach reboot -systemctl -systemctl list-dependencies piplayer -journalctl -e -sudo systemctl restart piplayer.service