Auto-reload plugin when connection changes to unavailable?

Posted on
Mon Jul 31, 2017 4:48 am
CrazyFin offline
Posts: 330
Joined: Jan 08, 2015
Location: Stockholm, SWEDEN

Auto-reload plugin when connection changes to unavailable?

I have noticed that when my Xpenology NAS (Synology running on custom built hardware) is restarted the status of Squeezebox server in Indigo is "unavailable". (Squeezebox server is running on my Xpenology/Synology NAS.)

It seems that the Squeezebox Controller plugin is not able to re-connect to the Squeezebox server in these cases. Only way to get connection back is to reload plugin.

I have now created a trigger script that reloads the plugin automatically (after a 2 min delay in order to avoid restarting the plugin too early).

Here is the initial trigger condition:
Squeezbox plugin reload script.jpeg
Squeezbox plugin reload script.jpeg (40.11 KiB) Viewed 583 times


I have two conditions since I am not sure which one happens when Synology server is restarted:
Squeezbox plugin reload script - 2.jpeg
Squeezbox plugin reload script - 2.jpeg (66.87 KiB) Viewed 583 times


And here is the script that is executed if any of the 2 above conditions are true:
Squeezbox plugin reload script - 3.jpeg
Squeezbox plugin reload script - 3.jpeg (78.09 KiB) Viewed 583 times


@autolog: Would it be possible for you to check if it is possible to have the plugin reconnect automatically or is the only solution at the moment to solve this with a script reloading the plugin?

Posted on
Mon Jul 31, 2017 10:01 am
autolog offline
Posts: 2955
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT+1]

Re: Auto-reload plugin when connection changes to unavailabl

I'll add it to the list of things to fix when I restart work on the Indigo 7 version of the plugin.

In the interim, your solution looks good. :)

Posted on
Fri Jul 20, 2018 6:42 am
CrazyFin offline
Posts: 330
Joined: Jan 08, 2015
Location: Stockholm, SWEDEN

Re: Auto-reload plugin when connection changes to unavailabl

Solution has worked fine for almost a year now. :D

However, this morning my Squeezeboxes did not start playing automatically when I disarmed my perimeter alarm around the house.
I checked into Indigo and I could see that the status of Squeezebox server in Indigo was "disconnected" but my script had not reloaded the plugin.

I think the state change must have come during a restart (or power failure, we had a power failure in our area few days ago).

The script only reacts on state changes so something must have happened causing the script not to catch the disconnected state this time.

I think I need to figure out a way to do the state check of Squeezebox server when I arm and disarm my house since it is on those state changes I usually stop and start the music around in my house.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests