PDA

View Full Version : Auto sync players and auto start stream with Raspberry Pi



advancedcommil
2019-02-19, 12:57
I'm using a Raspberry Pi and was wondering if it was possible to create a startup script that will detect and synchronize all of the available recievers and play a designated audio steam

DJanGo
2019-02-19, 14:08
I'm using a Raspberry Pi and was wondering if it was possible to create a startup script that will detect and synchronize all of the available recievers and play a designated audio steam

Since some of us did - it its possible.

advancedcommil
2019-02-21, 13:25
Since some of us did - it its possible.

I used the search function of the forum and was unable to find any useful information. Do you know the direction I should be looking in?

bpa
2019-02-21, 15:38
There are many ways to control LMS from scripts. Most use the Command Line Interface of LMS usually on port 9090.

Depending on your skills and available commands on your Pi - you can use telnet, netcat or any other app which can "talk" on a TCP connection.

The command line is documented on yoru LMS server LMS WebUI Help / Technical Information / The Logitech Media Service Command Line Interface

Basics can be found here

http://wiki.slimdevices.com/index.php/Logitech_Media_Server_CLI
http://forums.slimdevices.com/showthread.php?104146-Command-Line-Interface-basics-(Windows-box)

Use Google with the initial term "site:forums.slimdevices.com" to search the slimdevices forums as it is much better than the forum's own search facility.

advancedcommil
2019-02-22, 12:48
There are many ways to control LMS from scripts. Most use the Command Line Interface of LMS usually on port 9090.

Depending on your skills and available commands on your Pi - you can use telnet, netcat or any other app which can "talk" on a TCP connection.

The command line is documented on yoru LMS server LMS WebUI Help / Technical Information / The Logitech Media Service Command Line Interface

Basics can be found here

http://wiki.slimdevices.com/index.php/Logitech_Media_Server_CLI
http://forums.slimdevices.com/showthread.php?104146-Command-Line-Interface-basics-(Windows-box)

Use Google with the initial term "site:forums.slimdevices.com" to search the slimdevices forums as it is much better than the forum's own search facility.

I was planning on just putting a startup.sh script on the desktop of the pi putting a line to get it to auto sync any new players and then play a track

bpa
2019-02-22, 13:02
I was planning on just putting a startup.sh script on the desktop of the pi putting a line to get it to auto sync any new players and then play a track

To automated this you need to first identify all the manual steps and then go through the CLI ref to find the CLI command that does the step.

I don't use it but I think you may find the Groups plugin will help automate syncing all the players see https://forums.slimdevices.com/showthread.php?108558-ANNOUNCE-Group-Players

Install it and play with it first and see what steps are needed.

You may need to consider whether the script is best on the LMS server or each of the players if there are multiple players with variations of this startup script.

DJanGo
2019-02-23, 01:01
I was planning on just putting a startup.sh script on the desktop of the pi putting a line to get it to auto sync any new players and then play a track

The benefit of asking complicated questions in a single line is always a good startingpoint of a very long thread.:mad:

advancedcommil
2019-02-23, 14:05
To automated this you need to first identify all the manual steps and then go through the CLI ref to find the CLI command that does the step.

I don't use it but I think you may find the Groups plugin will help automate syncing all the players see https://forums.slimdevices.com/showthread.php?108558-ANNOUNCE-Group-Players

Install it and play with it first and see what steps are needed.

You may need to consider whether the script is best on the LMS server or each of the players if there are multiple players with variations of this startup script.
I have successfully used PuTTY on my desktop to clear the playlist, add the file I want to play and then play, been having a few issues with telnet on the pi itself but definitely know exactly what the script needs to do to make the server work.

Now that you mention a script on the player instead of the server it would probably be best to do it that way in case a speaker is off when the server starts or if I want to add more as time goes on but I don't think I'm seeing what I am looking for in the documentation

bpa
2019-02-24, 02:18
but I don't think I'm seeing what I am looking for in the documentation

Sorry not a mind reader - what are you looking for specifcially ?

I'm guessing but perhaps change in player status. Two usual ways
1. Notifications (i.e. "listen 1" and async message such as "<playerid> client new" and "<player id client disconnect" are sent on CLI)
2. Polling - script every x secs check player status perhaps using "status" command
Putty and Telnet are ways to chec manually what to do. To make it happen automated and interactively - if you have a full Linux system, pexpect & expect are the sort of tools to use when real interactivity is required. If no interactivity is needed then you can get away with bash or other simpler scripts.

advancedcommil
2019-02-24, 09:50
Sorry not a mind reader - what are you looking for specifcially ?

I'm guessing but perhaps change in player status. Two usual ways
1. Notifications (i.e. "listen 1" and async message such as "<playerid> client new" and "<player id client disconnect" are sent on CLI)
2. Polling - script every x secs check player status perhaps using "status" command
Putty and Telnet are ways to chec manually what to do. To make it happen automated and interactively - if you have a full Linux system, pexpect & expect are the sort of tools to use when real interactivity is required. If no interactivity is needed then you can get away with bash or other simpler scripts.

I was saying I wasn't seeing anything in the Command Iine interface page that mentioned what command a player would have to send to the server to synchronize it with the rest of the players.

bpa
2019-02-24, 12:03
I was saying I wasn't seeing anything in the Command Iine interface page that mentioned what command a player would have to send to the server to synchronize it with the rest of the players.

Have you installed and played with the "Group Players" plugin as I suggested ?
AFAIK The "sync" command does the job of syncing players together but I think it is tedious using CLI. My thoughts are that if you use the Group Players plugin so that you predefine groups of players to be synced and then you can start playing on a group player and so let the plugin sync the players for you.