11-28-2018, 08:42 AM
(11-28-2018, 05:20 AM)@Tim Curtis Wrote: moOde is a great way to learn some Linux SSH :-)
Open System config and turn on the SSH term server. Then OPEN it and enter userid = pi and password = moodeaudio.
Then follow my instructions in post #11
Very funny Tim!



Yes, moOde indeed forces one to learn Linux...
My issue is that librespot dont reconnect. It's not a local network issue, as it happens on different locations. And its quite random, restarting librespot fixes the issue instantly - but quite annoying to do so.
Have you seen this thread on librespot repo?
https://github.com/librespot-org/librespot/issues/134
The random stop working issue is a known issue, and they(devs) have a hard time getting it solved.
A user came up with a "fix" .. Its not really a fix; just a bandaid.
https://github.com/librespot-org/libresp...-441499150
Quote:Quote:Is there any way to mitigate this problem?This doesn't address the cause but aids with the symptoms:
Is it possible to somehow detect that it disconnected and restart it manually (using some shell script)?
https://gist.github.com/JeremieRapin/bc3...503270df16
Script to be run as a cronjob every minute which checks the status and restarts the service if an error is spotted.
Code:#!/bin/sh
# Add the following line in /etc/crontab
# * * * * * root /home/pi/watchdog.sh
#
status=$(sudo systemctl status raspotify | grep -E "(WARN|ERROR|101)")
if [ ! -z "$status" ]; then
sudo systemctl restart raspotify
fi
systemctl dont show the status of librespot, as its run as part of rc-local.service in moOde.
"systemctl status librespot" shows = "Unit librespot.service could not be found."
I dont have the faintest idea of how to get systemctl to show the status of librespot

systemctl status rc-local:
Code:
pi@radio:~ $ sudo systemctl status rc-local
● rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/lib/systemd/system/rc-local.service; static; vendor preset: enabled)
Drop-In: /lib/systemd/system/rc-local.service.d
└─debian.conf
/etc/systemd/system/rc-local.service.d
└─ttyoutput.conf
Active: active (running) since Wed 2018-11-28 09:14:49 CET; 21min ago
Process: 466 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/rc-local.service
├─ 479 /usr/bin/udisks-glue
├─ 514 /usr/bin/php /var/www/command/worker.php
├─ 812 sudo /usr/local/bin/shairport-sync -a Moode Airplay -S soxr -w -B /var/local/www/commandw/spspre.sh -E /var/local/www/commandw/spspost.sh -- -d hw:0
├─ 821 /usr/local/bin/shairport-sync -a Moode Airplay -S soxr -w -B /var/local/www/commandw/spspre.sh -E /var/local/www/commandw/spspost.sh -- -d hw:0
├─ 831 sudo librespot --name Moode Spotify --bitrate 320 --initial-volume 92 --cache /var/local/www/spotify_cache --backend alsa --device default:CARD=sndallodigione --onevent /var/local/www/commandw/spoteven
├─ 839 librespot --name Moode Spotify --bitrate 320 --initial-volume 92 --cache /var/local/www/spotify_cache --backend alsa --device default:CARD=sndallodigione --onevent /var/local/www/commandw/spotevent.sh
├─1014 /bin/bash /var/www/command/watchdog.sh
└─5370 sleep 6
Code:
pi@radio:~ $ pgrep -l librespot
839 librespot
( I will update when it occurs again)
So this fix doesnt work out of the box when using moOde

Any help?