Page 1 of 1

Auto-reload plugin when connection changes to unavailable?

PostPosted: Mon Jul 31, 2017 4:48 am
by CrazyFin
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 2347 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 2347 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 2347 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?

Re: Auto-reload plugin when connection changes to unavailabl

PostPosted: Mon Jul 31, 2017 10:01 am
by autolog
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. :)

Re: Auto-reload plugin when connection changes to unavailabl

PostPosted: Fri Jul 20, 2018 6:42 am
by CrazyFin
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.