I installed v0.7.0 RC6 on a new Raspberry Pi 3 B+. It is working great except for a bug in the watchdog. If I deconnect the WAN cable on my router to test the watchdog, I get the following error after a while:
2019-01-07 11:53:09,897 - WARNING Download of ‘http://icecast.vrtcdn.be/mnm_hits-high.mp3’ failed: HTTPConnectionPool(host=‘icecast.vrtcdn.be’, port=80): Max retries exceeded with url: /mnm_hits-high.mp3 (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x332f150>: Failed to establish a new connection: [Errno 101] Network is unreachable’,))
I made a quick and dirty fix by disabling the watchdog feature and replacing it with the following script and a line in /etc/rc.local:
/usr/local/bin/network-monitor.sh:
#!/bin/bash
##################################################################
# Settings
# Which address do you want to ping to see if the internet connection is alive?
pingip='8.8.8.8'
MPDHOST=localhost
MPDPORT=6600
INTERVAL=15
##################################################################
mpc_status() {
$MPC status 2>/dev/null | grep -B1 '^\[playing\]' | tr '\n' ' '
}
MPC="mpc -h $MPDHOST -p $MPDPORT"
prev_status=$(mpc_status)
while sleep $INTERVAL; do
status=$(mpc_status)
if [ -n "$status" ]; then
if [ "$prev_status" = "$status" ]; then
echo "Performing Network check"
/bin/ping -c 1 $pingip > /dev/null 2> /dev/null
if [ $? -ge 1 ] ; then
echo "Network connection down! Try again in $INTERVAL seconds"
else
echo "Network is Okay, restart playing"
$MPC stop && $MPC play
fi
fi
else
echo "mpd not running/playing"
fi
prev_status="$status"
done