Radio doesn't return after internet dropout: mpd-watchdog

As requested here, could mpd-watchdog please be included in the pimusicbox package?
Without this installed, if my internet connection drops out for more than about a minute, the radio stream will not come back without user intervention. But with this installed, one’s internet connection can be off for a seemingly infinite period and when the internet returns so will the radio stream.
I’ve tested it countless times, comparing the result with and without mpd-watchdog installed, and it definitely remedies the problem for me.

Many thanks

I have the same issue with ver. 0.5.2

Per :o)

Me too. But it’s still rectified by installing mpd-watchdog

In the ssh console just type “mpc repeat on”. It worked for me :smile:

I suppose that would work. But, if you switch between listening to the radio and listening to Spotify frequently it can be annoying if it repeats the Spotify playlist. Mpd-watchdog doesn’t require ‘mpc repeat on’, and also keeps radio streams playing indefinetly, even after a length internet dropout.

I have internet connection issues, as well and would love if the radio stream continues after connection is on again. I will try “mpc repeat on” but it would be great if it could be added to pi musicbox as a standard. =)

Unfortunately, “mpc repeat on” does not solve the issue. How can I install mpd-watchdog?

I’m sure there are better ways to do it. But here’s one way to install it:

  1. Download the three files in this folder:
  2. Place the three downloaded downloaded files into the ‘config’ folder on the Pi Musicbox SD card.
  3. With the Pi running, open an SSH client, and enter:
    mv /boot/config/mpd-watchdog /usr/bin && mv /boot/config/mpd-watchdog.init /etc/init.d/mpd-watchdog && mv /boot/config/mpd-watchdog.default /etc/default/mpd-watchdog && update-rc.d mpd-watchdog defaults
  4. Reboot the Pi
1 Like

Thanks Jack, I installed mpd-watchdog using your instructions and it’s working well. It would be great if this was part of the default Pi Musicbox installation.

FYI: mpd-watchdog is now available for Debian-based systems from my my personal APT archive, so you might as well try

    wget -q -O - | sudo apt-key add -
    sudo wget -q -O /etc/apt/sources.list.d/tkem.list
    sudo apt-get update
    sudo apt-get install mpd-watchdog

and you should be done (no reboot required).

If you have installed mpd-watchdog as described by @JackRichardson, you have to remove the manually installed files first; sorry for the inconvenience, Jack :wink:


I’m not very familar with mpd-watchdog. What stops it from coming along and restarting playback when I’ve decided to manually pause?

If the user manually pauses anything playing, mpd-watchdog will not stop you from pausing.

The problem mpd-watchdog solves for me is ensuring that a stream continues playing even if the internet drops out for more than a few minutes. Try it!

To simulate an internet connection outage, simply unplug your ethernet, or for wifi, turn off the router. If you have a radio stream playing and the internet reconnects within about about 30 seconds, then the stream seems to continue playing when the internet returns. However, if the internet is off for say more than a minute, the stream will appear to still be playing, but no audio is outputted. Without mpd-watchdog I have to manually click on the radio stream again - annoying when I wake up, and turn on my speakers to find no audio after there was a short internet outage overnight.

I was specifically interested in what prevents it restarting the song when
I decide to manually pause it.

@kingosticks: mpd-watchdog only acts if mpd state is “playing”.

The full answer can be found here:

Oh, I’m a total idiot, it looks at the elapsed time too (obviously).

Although, apparently the problem preventing it from inclusion previously was that it restarted things if you had an empty playlist. Perhaps that was with an older version of Mopidy.

Before including it, please note that mpd-watchdog is no longer actively developed/supported, since I don’t use it any longer myself. Was great back when I was running stock mpd and had a crappy network connection. Whether it was switching to Mopidy or fixing my network, I no longer have any of the issues described by @JackRichardson and others. However, as long as it helps somebody, I’ll make it available. Just don’t ask me to fix or change anything, thank you :wink:

Yep, no worries. Thanks for making it available.

This will work for Spotify to??