Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-20 Thread nimaazx


Greg Erskine wrote: 
> Hi nimaazx,
> 
> It is best not to post non-piCorePlayer questions in a piCorePlayer
> thread.
> 
> We look at piCorePlayer threads and respond assuming the topic is
> related to piCorePlayer. It gets very confusing for everyone.
> :confused:
> 
> regards
> Greg

ok.
about my recent posts, i liked to share my solutions with anybody, that
is faced my problem. i got answers before posting.
my latest post was about shuting down os remotely.
thank for your concern.



nimaazx's Profile: http://forums.slimdevices.com/member.php?userid=68798
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-20 Thread Greg Erskine


nimaazx wrote: 
> right now I don't have pcp and raspberry pi until tomorrow

Hi nimaazx,

It is best not post non-piCorePlayer questions in a piCorePlayer thread.

We look at piCorePlayer threads and respond assuming the topic is
related to piCorePlayer. It gets very confusing for everyone. :confused:

regards
Greg



Greg Erskine's Profile: http://forums.slimdevices.com/member.php?userid=7403
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-20 Thread paul-


Take a look a the gpio-shutdown and gpio-poweroff overlays.  There is an
extra kernel module that needs loaded, but it's working rather well.

It will be integrated into the next pCP.

But I believe you can also setup the poweroff to work by just driving
GPIO3 low, and then automatically restart by driving it high.



piCorePlayer a small player for the Raspberry Pi in RAM. 
Homepage: https://www.picoreplayer.org

Please 'donate'
(https://www.paypal.com/cgi-bin/webscr?cmd=_donations=U7JHY5WYHCNRU=GB_code=USD=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted)
if you like the piCorePlayer

paul-'s Profile: http://forums.slimdevices.com/member.php?userid=58858
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-20 Thread nimaazx


i'm interested to ask a question but every time i forget. 
I connect my Raspberry pi to battery and a Physical key for powering off
(disconnecting power).
AS i know about picoreplayer. developers said it is loaded to RAM
completely. it means can power it off without shutdown from its OS.

but I'm searching a way to turn it off from OS and a few seconds later
power it off with my Physical key. 
like sending a command from LMS or windows script and run shutdown
command. I think about SSH but it is not optimum for many picoreplayers
at the same time.



nimaazx's Profile: http://forums.slimdevices.com/member.php?userid=68798
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-20 Thread nimaazx


Greg Erskine wrote: 
> hi nimaazx,
> 
> Did you miss this post?
> 
> 
> > 
Code:

  >   > #!/bin/sh
  > 
  > . /home/tc/www/cgi-bin/pcp-functions
  > 
  > echo $(pcp_lmsip)
  > 

> > 
> 
> 
> regards
> Greg

Hey Greg, I had seen your post before, but I did not test it. I'm
inspired by "telnet" method. I use cli lms. maybe there is a simple way
for doing this. right now I don't have pcp and raspberry pi until
tomorrow. 
but I really like share my code with you.



Code:

sudo echo "17" > /sys/class/gpio/export
  sudo chown -R tc /sys/class/gpio/gpio17/
  sudo echo "out" > /sys/class/gpio/gpio17/direction
  mac=$(sudo cat /sys/class/net/wlan0/address)
  command=$mac' connected ?'
  host='192.168.1.17 9090'
  #///
  program(){
  result=$(
  (
  echo "$command"
  sleep 1
  echo "exit"
  ) | timeout -t 5 telnet $host )
  
  if [ "$result" != "Terminated" ]
  then
data=$( (echo "$result") | cut -d ' ' -f3)
if [ $data -eq 1 ]
then
return 1
else
return 0
fi
  else
return 0
  fi
  } #end of program
  #
  
  while true;
  do
program
dd=$?
if [ $dd -eq 1 ]
then
echo "Connected"
sudo echo "1" > /sys/class/gpio/gpio17/value
else
echo "Not Connected"
sudo echo "0" > /sys/class/gpio/gpio17/value

fi
  sleep 2s
  done
  



yeah, "$(pcp_lmsip)" this is exactly what I want .instead of writing
this code I could just check "$(pcp_lmsip)" this variable.:p if it is
filled turn on led.
I don't know if possible 20 30 pcp telnet to one lms server at one time
and lms windows app can handle their requests every 5 sec to check their
connection, it works or not. but just checking "$(pcp_lmsip)" , is not
dependable to network and telnet.



nimaazx's Profile: http://forums.slimdevices.com/member.php?userid=68798
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-20 Thread Greg Erskine


hi again nimaazx,

Have you had a look at the basic piCorePlayer Command Line Interface
(CLI)

https://www.picoreplayer.org/pcp_cli.shtml

regards
Greg



Greg Erskine's Profile: http://forums.slimdevices.com/member.php?userid=7403
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-20 Thread Greg Erskine


Greg Erskine wrote: 
> hi nimaazx,
> 
> We have done a lot of your work already. As Paul said, look at
> /home/tc/www/cgi-bin/pcp-lms-functions.
> 
> In your script add ./home/tc/www/cgi-bin/pcp-lms-functions, then call
> function.
> 
> Here is the test page for this functions, [Main Page] in [Beta] Mode >
> [Extras] > [LMS CLI].
> 
> The "netstat" code is in /home/tc/www/cgi-bin/pcp-functions, look for
> routine pcp_lmsip.
> 
> regards
> Greg

hi nimaazx,

Did you miss this post?

regards
Greg



Greg Erskine's Profile: http://forums.slimdevices.com/member.php?userid=7403
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-20 Thread nimaazx


Hello again.
I wrote a sh script file that telnet to server every 5 seconds in
picoreplayer. if its mac address connected and lms server responds "1" ,
my led from gpio is on.

there is a question for me. 
I use a static ip address in my telnet command to connect to lms server
cli.
is there a way to find out a lms ip server from linux automatically?
as i read it before picoreplayer uses autodiscovery for findind lms. if
it is connected to lms server , the ip of lms should be store
somewhere.
and in this way if it can be implemented , if the lms server ip address
is changed or not static in my network or modem router, sh telnet can
work with this way.
works independently.
but right now it can work with my static ip address. 192.168.1.17 (it is
lms server addres)

if changed not work. because i use this address for conecting to my lms
cli.

what is your idea?
thanks again.



nimaazx's Profile: http://forums.slimdevices.com/member.php?userid=68798
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-02 Thread nimaazx


bpa wrote: 
> The following mnay be too much for you but you might as well have the
> info.
> 
> Player discover LMS servers using broadcast  on UDP on port 383 -
> iognore this if you see references to this. 
> 
> LMS talks to a player(e.g. squeezelite) using a protocol called
> slimproto on a TCP connection on port 3483 of the LMS server.  Slimproto
> enables player to be told by LMS  player to play music from an URL (can
> be remote but usually LMS) , vol up , vol down etc. Using slimproto
> Player tell LMS when it needs data, buffer empty etc.
> 
> To talk to an LMS server a player has to open a TCP connecton from the
> player to the LMS server on port 3483. This means if a player is
> actively connected to an LMS server there is a TCP connection on the
> player to destination port 3483.
> 
> The CLI is a totally separate LMS communication.  It is supported by LMS
> server usually on port 9090 (can be changed in settings). It is intended
> to be used by "remote" applications (i.e. not running on LMS server
> processor)  who want to "talk" to LMS server and get info from the LMS
> server about the LMS system, libraries etc.
> 
> I don't know what available on pcp. but if LMS is on a server with IP
> address 192.168.1.250 then this would be  (LMS inserts  betweens
> lines of the response which is encoded as %3A).  BLue is the user entry,
> red is LMS response - use your own IP address and MAC address of player
> has been altered.
> > 
Code:

  >   > 
  > telnet 192.168.1.250 9090
  > Trying 192.168.1.250...
  > Connected to 192.168.1.250.
  > Escape character is '^]'
  > players
  > players   count%3A2
  > players 0 1 connected
  > players 0 1 connected count%3A2 playerindex%3A0 
playerid%3A7x%3Adx%3A3x%3Aax%3A3x%3A7x uuid%3A ip%3A192.168.1.58%3A32806 
name%3ASqueezeLite seq_no%3A0 model%3Asqueezelite modelname%3ASqueezeLite 
power%3A1 isplaying%3A0 displaytype%3Anone isplayer%3A1 canpoweroff%3A1 
connected%3A1 firmware%3Av1.8-589
  > 7x:dx:3x:ax:3x:7x connected ?
  > 7x%3Adx%3A3x%3Aax%3A3x%3A7x connected 1
  > 
  > 

> > 
> 
> I don't know what is available on pcp but once you understand the CLI
> commands then for an application you might find it easier to use
> "curl" on port 9000 and using POST request JSON encoded commands
> instead of telnet - the CLI command is in the "params"
> example command
> > 
Code:

  >   > 
  > curl -X POST -d 
'{"id":0,"params":["00:04:20:ab:cd:ef",["playlist","index","+1"]],"method":"slim.request"}'
 http://yourserver:9000/jsonrpc.js
  > 

> > 

thank you very much. 
Thanks to other people for contributing to this discussion
I completely understand what you said. there are totally 2 ways. 
1- checking tcp 3483 port to understand by netstate command in sh file
scripting.
if it is connected GPIO pin number is going to be high and LED will be
on.

2- using CLI command via telnet from linux command. I guess it is
accessible in picoreplayer. I have to test it. I do not know about Curl.
but I guess it is not too complex.
I studied software engineering and have some experiences about networks
and security. I can handle it.

today I run squeezelite emulator on my windows 10 as a client and
logitech media server and I run that command you write with termux on my
android phone.
it is worked and responded : " xx%3Axx%3Axx%3Axx%3Axx%3Axx connected 1"
.
when it is not connected responded : 
"xx%3Axx%3Axx%3Axx%3Axx%3Axx connected %3F " or
"xx%3Axx%3Axx%3Axx%3Axx%3Axx connected ?"

"%3F" is mean "?". not responded 0 in result.

however right not I don't know Linux command to cut "1" from result. I
should work on it. 

all in all I must write a script in this form :

every 15 20 seconds while true :
do
//check connection
//if connected turn on led
end 

it must run from startup until turn off. what method do you think is
more reliable to run every 15 or 30 seconds. I don't know telnet(curl)
method is Affected
in bandwidth or not. I always use at least 10 zero w picoreplayer on my
network. this checking script must be run on every zero w every 15 20
seconds for checking connection.you think is there a problem about
telnet from many zero w to lms server ? in this method , i'm just
worried about bandwidth and this scriot maybe Disrupt while listening to
music and audio syncing lms.

what you think about this ?



nimaazx's Profile: http://forums.slimdevices.com/member.php?userid=68798
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-02 Thread paul-


There are a lot of LMS JSON calls built into pcp-lms-functions.  You can
include that in your scripts.



piCorePlayer a small player for the Raspberry Pi in RAM. 
Homepage: https://www.picoreplayer.org

Please 'donate'
(https://www.paypal.com/cgi-bin/webscr?cmd=_donations=U7JHY5WYHCNRU=GB_code=USD=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted)
if you like the piCorePlayer

paul-'s Profile: http://forums.slimdevices.com/member.php?userid=58858
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-02 Thread bpa


nc would be a good alternative especially as output can be redirected
into a file or piped for later processing

Example of the "players" command

Code:


  echo "players" | nc -w 1 192.168.1.250 9090
  



The "-w 1" (timeout of 1 sec) is needed if nc won't close the
connection.



bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-02 Thread DJanGo


bpa wrote: 
> I don't know what is available on pcp but once you understand the CLI
> commands then for an application you might find it easier to use "curl" 
Since another Member successfully uses my hd44780 script on PCP *nc*
should be available on pcp.



DJanGo's Profile: http://forums.slimdevices.com/member.php?userid=1516
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-02 Thread bpa


nimaazx wrote: 
> if i understand from you and another person in this topic said,  we can
> just check tcp port "3483". it is used for connecting to lms. when it is
> connected , We are sure 100% it is known by lms server.
The following mnay be too much for you but you might as well have the
info.

Player discover LMS servers using broadcast  on UDP on port 383 -
iognore this if you see references to this. 

LMS talks to a player(e.g. squeezelite) using a protocol called
slimproto on a TCP connection on port 3483 of the LMS server.  Slimproto
enables player to be told by LMS  player to play music from an URL (can
be remote but usually LMS) , vol up , vol down etc. Using slimproto
Player tell LMS when it needs data, buffer empty etc.

To talk to an LMS server a player has to open a TCP connecton from the
player to the LMS server on port 3483. This means if a player is
actively connected to an LMS server there is a TCP connection on the
player to destination port 3483.

The CLI is a totally separate LMS communication.  It is supported by LMS
server usually on port 9090 (can be changed in settings). It is intended
to be used by "remote" applications (i.e. not running on LMS server
processor)  who want to "talk" to LMS server and get info from the LMS
server about the LMS system, libraries etc.

I don't know what available on pcp. but if LMS is on a server with IP
address 192.168.1.250 then this would be  (LMS inserts  betweens
lines of the response which is encoded as %3A).  BLue is the user entry,
red is LMS response - use your own IP address and MAC address of player
has been altered.

Code:


  telnet 192.168.1.250 9090
  Trying 192.168.1.250...
  Connected to 192.168.1.250.
  Escape character is '^]'
  players
  players   count%3A2
  players 0 1 connected
  players 0 1 connected count%3A2 playerindex%3A0 
playerid%3A7x%3Adx%3A3x%3Aax%3A3x%3A7x uuid%3A ip%3A192.168.1.58%3A32806 
name%3ASqueezeLite seq_no%3A0 model%3Asqueezelite modelname%3ASqueezeLite 
power%3A1 isplaying%3A0 displaytype%3Anone isplayer%3A1 canpoweroff%3A1 
connected%3A1 firmware%3Av1.8-589
  7x:dx:3x:ax:3x:7x connected ?
  7x%3Adx%3A3x%3Aax%3A3x%3A7x connected 1
  
  



I don't know what is available on pcp but once you understand the CLI
commands then for an application you might find it easier to use "curl"
on port 9000 and using POST request JSON encoded commands instead of
telnet - the CLI command is in the "params"
example command

Code:


  curl -X POST -d 
'{"id":0,"params":["00:04:20:ab:cd:ef",["playlist","index","+1"]],"method":"slim.request"}'
 http://yourserver:9000/jsonrpc.js
  




bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-02 Thread nimaazx


bpa wrote: 
> The CLI command will be sent to the LMS server by the pie Zero w. This
> means there is a network connection between player Pi and LMS server Pi.
> The reponse to the command "connected" tells you the LMS Server can
> "see" the player and the TCP connection on port 3483 is OK and working. 
> If player is not connected to LMS as seen by LMS then connected state
> will be zero - you can only get this result from a Pi zero W when the
> TCP connection to server Pi is OK - so you can be sure the network
> connection is OK but the player connection on port 3483 is not OK.   You
> can use the "players" command to get a list of all known players and
> their connected status (i.e. whether a TCP port 3483 connection is
> active).
> 
> The ability to make a telnet connection to CLI port on LMS - means the
> LMS server is OK - what more do you need ?


Ok, thank you very much.
I understood what you said. I'm really interested  in details.
if I understand correclty , you tell that command can be run on zero w
with sh scripting language.
i'm too confused about commands in a document page.

in easy solution i can just check wifi connection and turn on led. but
as I tell you and you know that is maybe not reliable. 

if you know , please tell me what commands are in a client side and what
commands are in lms side.
how much I read documents i'm more confused.

as well as the telnet method you said is related to "" command
or is a separate method?

if i understand from you and another person in this topic said,  we can
just check tcp port "3483". it is used for connecting to lms. when it is
connected , We are sure 100% it is known by lms server.

I'm really sorry about my english. it is not my native language.



nimaazx's Profile: http://forums.slimdevices.com/member.php?userid=68798
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-02 Thread nimaazx


DJanGo wrote: 
> hi,
> 
> 
> 
> no ping is nothing other than icmp works that doesnt help nobody
> A Server wihout a static ip is  not a server
> > 
Code:

  >   > netstat -a|grep 3483|rev|cut -d ':' -f2-|cut -d ' ' -f1|rev

> > 
> 
> 
> ???
> slimp3 <> picoreplayer 
> WHAT is your goal?

I have not been much  familiar with linux bash command.I must search
before use them. I have to test this command tomorrow.
but about slimp3 , that commands are on logitech media server document
page. I think the client is not the matter what it is. Overall, I
doubted how and where to use these commands.
what commands in server side on my windows lms / or what commands must
be written in zero w client sh bash.



nimaazx's Profile: http://forums.slimdevices.com/member.php?userid=68798
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-01 Thread bpa


nimaazx wrote: 
> thank you but I think it is for server side. for example this command
> for using to detect players state.
> 
>  connected ?
> 
> Returns the connected state of the player, 1 or 0 depending on the state
> of the TCP connection to the player. SLIMP3 players, since they use UDP,
> always return 1.
> 
> Examples:
> 
> Request: "04:20:00:12:23:45 connected ?" 
> Response: "04:20:00:12:23:45 connected 1"
> 
> i need something else, vice versa...
> detecting server status from client side (zero w)
> or detecting my zero w is connected to server.
> if connected led is going to be on.
> disconncted or lms server not found/led off.

The CLI command will be issued ot the LMS server by the pie Zero w. This
means there is a network connection between player Pi and LMS server Pi.
The reponse to the command "connected" tells yo8i the Servers can see
the player and the TCP connection on port 3483 is OK and working.   If
player is not connected to LMS as seen by LMS then connected state will
be zero - you can only get this result from a Pi zero W when the TCP
connection to server Pi is OK - so you cna be sure the network
connection is oK but the player cxonnection on port 3483 is not OK.

The ability to make a telnet connection to CLI port on LMS - means the
LMS server is OK - what more do you need ?



bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-01 Thread DJanGo


hi,

nimaazx wrote: 
> ]
> maybe netstat is similar to ping command , good idea , I can check it by
> pinging lms ip address from zero w. but it needs to define static ip
> address for our logitech media server in network.
> main question is , is pinging trusty for my goal?

no ping is nothing other than icmp works that doesnt help nobody
A Server wihout a static ip is  not a server

Code:

netstat -a|grep 3483|rev|cut -d ':' -f2-|cut -d ' ' -f1|rev



nimaazx wrote: 
> thank you but I think it is for server side. for example this command
> for using to detect players state.
> 
>  connected ?
> 
> Returns the connected state of the player, 1 or 0 depending on the state
> of the TCP connection to the player. SLIMP3 players, since they use UDP,
> always return 1.
> 
> 
???
slimp3 <> picoreplayer 
WHAT is your goal?



DJanGo's Profile: http://forums.slimdevices.com/member.php?userid=1516
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-01 Thread nimaazx


bpa wrote: 
> You may need to start looking at using CLI and possibly JSON - it can ge
> complicated.
> 
> Look at this thread for ideas.
> https://forums.slimdevices.com/showthread.php?98116-How-to-connect-to-LMS-via-TCP-and-ask-number-of-active-players
> 
> Possible command are in the LMS technical information (webGUI Help /
> Technical Information / The Logitech Meda Server Command line interface 
> or 
> http://htmlpreview.github.io/?https://raw.githubusercontent.com/Logitech/slimserver/public/7.9/HTML/EN/html/docs/cli-api.html
> )


thank you but I think it is for server side. for example this command
for using to detect players state.

 connected ?

Returns the connected state of the player, 1 or 0 depending on the state
of the TCP connection to the player. SLIMP3 players, since they use UDP,
always return 1.

Examples:

Request: "04:20:00:12:23:45 connected ?" 
Response: "04:20:00:12:23:45 connected 1"

i need something else, vice versa...
detecting server status from client side (zero w)
or detecting my zero w is connected to server.
if connected led is going to be on.
disconncted or lms server not found/led off.



nimaazx's Profile: http://forums.slimdevices.com/member.php?userid=68798
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-01 Thread bpa


You may need to start looking at using CLI and possibly JSON - it can ge
complicated.

Look at this thread for ideas.
https://forums.slimdevices.com/showthread.php?98116-How-to-connect-to-LMS-via-TCP-and-ask-number-of-active-players

Possible command are in the LMS technical information (webGUI Help /
Technical Information / The Logitech Meda Server Command line interface
)



bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-01 Thread nimaazx


Greg Erskine wrote: 
> hi nimaazx,
> 
> I am not 100% sure what you are after. :confused:
> 
> From my experience if LMS is up, then squeezelite *always* connects,
> well 99.99% of the time.
> 
> The command netstat shows you the connection between squeezelite and
> LMS.
> 
> > 
Code:

  >   > tc@piCorePlayerSCREEN:~$ netstat -t
  > Active Internet connections (w/o servers)
  > Proto Recv-Q Send-Q Local Address   Foreign Address State
  > tcp0  0 192.168.1.15:48962  192.168.1.6:3483
ESTABLISHED
  > tcp0160 192.168.1.15:ssh192.168.1.16:54966  
ESTABLISHED
  > tcp0  0 192.168.1.15:46816  192.168.1.6:9000
ESTABLISHED
  > netstat: /proc/net/tcp6: No such file or directory
  > tc@piCorePlayerSCREEN:~$
  > 

> > 
> 
> regards
> Greg
Greg Erskine wrote: 
> hi nimaazx,
> 
> I am not 100% sure what you are after. :confused:
> 
> From my experience if LMS is up, then squeezelite *always* connects,
> well 99.99% of the time.
> 
> The command netstat shows you the connection between squeezelite and
> LMS.
> 
> > 
Code:

  >   > tc@piCorePlayerSCREEN:~$ netstat -t
  > Active Internet connections (w/o servers)
  > Proto Recv-Q Send-Q Local Address   Foreign Address State
  > tcp0  0 192.168.1.15:48962  192.168.1.6:3483
ESTABLISHED
  > tcp0160 192.168.1.15:ssh192.168.1.16:54966  
ESTABLISHED
  > tcp0  0 192.168.1.15:46816  192.168.1.6:9000
ESTABLISHED
  > netstat: /proc/net/tcp6: No such file or directory
  > tc@piCorePlayerSCREEN:~$
  > 

> > 
> 
> regards
> Greg

ok greg, thank you very much.
I describe what I want to run.
I have many zero w work with windows lms server.
yesterday I tested 4 synced zero w.
at first I took #1 to master in settings.
after that I disconnected each other during playing music to find out
what is the action of the others about syncing. Everythings looked
good.
but at first when I brought back #2 zero w again during playing, it was
not detected in lms and list.I restarted many times. not shown in lms.
I went to setting menu and change a setting something like this of each
player:
"pause at power off, resume at power on"

i dont know it is related or not but after doing this when each other
brought back and turned on worked good.

as i described my idea, I wanted to sure when each on is connected to
lms when they turned off and turned on again, after that my led
connected to gpio is going to be on to show zero w connected to server.
(with sh bash scripting) 
I did it and turned on my led with by just checking wifi connection not
checking zero w connected to lms server. I'm finding a way for this.

maybe netstat is similar to ping command , good idea , I can check it by
pinging lms ip address from zero w. but it needs to define static ip
address for our logitech media server in network.
main question is , is pinging trusty for my goal?
I mean when it can ping lms server, 
lms server can show the player name and detected in its player list?
maybe pinging is not related to detection process.
I searched in squeezelite command line or parameters for a flag or
Special characteristic is set when it connects to lms server.



nimaazx's Profile: http://forums.slimdevices.com/member.php?userid=68798
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-02-01 Thread nimaazx


Greg Erskine wrote: 
> hi nimaazx,
> 
> I am not 100% sure what you are after. :confused:
> 
> From my experience if LMS is up, then squeezelite *always* connects,
> well 99.99% of the time.
> 
> The command netstat shows you the connection between squeezelite and
> LMS.
> 
> > 
Code:

  >   > tc@piCorePlayerSCREEN:~$ netstat -t
  > Active Internet connections (w/o servers)
  > Proto Recv-Q Send-Q Local Address   Foreign Address State
  > tcp0  0 192.168.1.15:48962  192.168.1.6:3483
ESTABLISHED
  > tcp0160 192.168.1.15:ssh192.168.1.16:54966  
ESTABLISHED
  > tcp0  0 192.168.1.15:46816  192.168.1.6:9000
ESTABLISHED
  > netstat: /proc/net/tcp6: No such file or directory
  > tc@piCorePlayerSCREEN:~$
  > 

> > 
> 
> regards
> Greg

ok greg, thank you very much.
I describe what I want to run.
I have many zero w work with windows lms server.
yesterday I tested 4 synced zero w.
at first I took #1 to master in settings.
after that I disconnected each other during playing music to find out
what is the action of the others about syncing. Everythings looked
good.
but at first when I brought back #2 zero w again during playing, it was
not detected in lms and list.I restarted many times. not shown in lms.
I went to setting menu and change a setting something like this of each
player:
"pause at power off, resume at power on"

i dont know it is related or not but after doing this when each other
brought back and turned on worked good.

as i described my idea, I wanted to sure when each on is connected to
lms when they turned off and turned on again, after that my led
connected to gpio is going to be on to show its connected to server.
(with sh bash scripting) 
I did it and turned on my led with by just checking wifi connection not
checking zero w connected to lms server. I'm finding a way for this.

maybe netstat is similar to ping command , good idea , I can check it by
pinging lms ip address from zero w. but it needs to define static ip
address for our logitech media server in network.
main question is , is pinging trusty for my goal?
I mean when it can ping lms server, 
lms server can show the player name and detected in its player list?
maybe pinging is not related to detection process.
I searched in squeezelite command line or parameters for a flag or
Special characteristic is set when it connects to lms server.



nimaazx's Profile: http://forums.slimdevices.com/member.php?userid=68798
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix


Re: [SlimDevices: Unix] way to detect Picoreplayer connected to LMS

2019-01-31 Thread Greg Erskine


hi nimaazx,

I am not 100% sure what you are after. :confused:

>From my experience if LMS is up, then squeezelite *always* connects,
well 99.99% of the time.

The command netstat shows you the connection between squeezelite and
LMS.


Code:

tc@piCorePlayerSCREEN:~$ netstat -t
  Active Internet connections (w/o servers)
  Proto Recv-Q Send-Q Local Address   Foreign Address State
  tcp0  0 192.168.1.15:48962  192.168.1.6:3483
ESTABLISHED
  tcp0160 192.168.1.15:ssh192.168.1.16:54966  
ESTABLISHED
  tcp0  0 192.168.1.15:46816  192.168.1.6:9000
ESTABLISHED
  netstat: /proc/net/tcp6: No such file or directory
  tc@piCorePlayerSCREEN:~$
  



regards
Greg



Greg Erskine's Profile: http://forums.slimdevices.com/member.php?userid=7403
View this thread: http://forums.slimdevices.com/showthread.php?t=110118

___
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix