Home of the Squeezebox™ & Transporter® network music players.
Page 3 of 23 FirstFirst 1234513 ... LastLast
Results 21 to 30 of 229
  1. #21
    Junior Member
    Join Date
    Dec 2017
    Posts
    8
    Quote Originally Posted by ynot1234567890 View Post
    Not sure off hand, but the easiest way I know to troubleshoot is outlined in the troubleshooting guide on the Github. https://github.com/ynot123/LMS_Contr...bleshooting.md Refer to the section about running the query commands in a shell from your HASSIO installation.

    Yes you definitely need to have access to port 9090 on LMS from your HASSIO installation to make this work. I assume you have modified the shell scripts properly to suit your installation?

    Running the query functions in a shell as outlined in the troubleshooting.md file provides simple feedback on what's being returned from LMS. This should provide some insight into what's happening. Unless your default LMS install is highly customized, it should pretty much just work.

    If you can't figure it out from there, feel free to send me a copy of one of your query scripts and I can take a peek. Include what systems and versions you're running.

    Thanks, Ynot.
    Here is my output from qry_alb.sh:
    Artists are:
    artists 0 20 search%3A_supertramp tags%3Aa

    Artist check zero is: artists 0 20 search%3A_supertramp tags%3Aa

    qry_alb.sh: line 14: [: too many arguments

    Artist found so moving on to albums....

    Album check zero is: albums 0 20 artist_id%3Aartists 0 20 search0X0P%2B0_supertramp tags0X0P%2B0a search%3A_breakfast _in_america tags%3Aal


    Albums are:
    albums 0 20 artist_id%3Aartists 0 20 search0X0P%2B0_supertramp tags0X0P%2B0a search%3A_breakfast_in_america tags%3Aal
    qry_alb.sh: line 53: [: too many arguments

    Artist ID is:artists 0 20 search%3A_supertramp tags%3Aa
    Album ID is: albums 0 20 artist_id%3Aartists 0 20 search0X0P%2B0_supertramp tags0X0P%2B0a search%3A_breakfast_in_amer ica tags%3Aal
    now Posting results

    {"attributes": {}, "context": {"id": "c006ab421c63435b82fc2aea73428c5a", "user_id": null}, "entity_id": "sensor.art_i d", "last_changed": "2018-10-24T00:20:41.190793+00:00", "last_updated": "2018-10-24T00:20:41.190793+00:00", "state": "artists 0 20 search%3A_supertramp tags%3Aa"}
    {"attributes": {}, "context": {"id": "299e07f6762f481cb97c2ea0320b6a18", "user_id": null}, "entity_id": "sensor.alb_i d", "last_changed": "2018-10-24T00:43:56.234218+00:00", "last_updated": "2018-10-24T00:43:56.234218+00:00", "state": "albums 0 20 artist_id%3Aartists 0 20 search0X0P%2B0_supertramp tags0X0P%2B0a search%3A_breakfast_in_america tags%3Aa l"}

    Here is my output from qry_alb_song.sh:
    Artists are:
    artists 0 20 search%3A_pearl_jam tags%3Aa

    Artist check zero is: artists 0 20 search%3A_pearl_jam tags%3Aa

    qry_alb_song.sh: line 14: [: too many arguments

    Artist found so moving on to albums....

    Album check zero is: albums 0 20 artist_id%3Aartists 0 20 search0X0P%2B0_pearl_jam tags0X0P%2B0a search%3A_alive tags%3Aal


    Albums are:
    albums 0 20 artist_id%3Aartists 0 20 search0X0P%2B0_pearl_jam tags0X0P%2B0a search%3A_alive tags%3Aal
    qry_alb_song.sh: line 90: [: too many arguments

    Album found so moving on to songs....
    qry_alb_song.sh: line 115: printf: `B': invalid format character

    But it hangs and does not finish.
    Where do I enter username/password for CLI interface port 9090? I think that is my issue.

  2. #22
    Senior Member
    Join Date
    Feb 2017
    Posts
    141
    Quote Originally Posted by bitterroots View Post
    Here is my output from qry_alb.sh:
    Artists are:
    artists 0 20 search%3A_supertramp tags%3Aa

    Album found so moving on to songs....
    qry_alb_song.sh: line 115: printf: `B': invalid format character

    But it hangs and does not finish.
    Where do I enter username/password for CLI interface port 9090? I think that is my issue.
    You are quite right, didn't realize you were using secure system (mine is open and only exposed to local network).

    So that being said, reviewing the LMS CLI documentation (On your LMS: http://localhost:9000/html/docs/cli-api.html (replace "localhost" with your server's address), you need to issue the login request upon initial connection before submitting any requests. The command is in the form of "login username correctpassword" to open, proceed with your queries and you can then close the connection (not sure is you really need to) using "login username wrongpassword".

    Basically modify each shell script that queries the LMS server to include the login and give it a try. You can always issue the commands by typing them in manually as well to ensure proper syntax.

    If you make this work, I would appreciate a copy of one of the shell scripts and I will include this as an optional format on the GitHub project for other users. If you can't make it work, let me know and I'll see if I can make some time to test on my install over the next week or two.

    Ynot.
    Software - Logitech Media Server Version: 8.0 (Docker), Home Assistant 0.105.5, DialogFlow - V.2 API, LMS Controls App - Voice Control of LMS, OpenMediaVault 5.2
    Add-ons - Spotty, UPnP / DLNA Bridge, Cast Bridge,
    Players - Sonos, UPnP, PI3 - PI Core Player 3.5.0 with IQAudio TopHat, Android- SB Player with Viper4Android Convolution Engine, GoogleHome and Google Minis
    Hardware - HP Desktop - i7-3.4Ghz, 4GB Ram, 6TB storage, Debian

  3. #23
    Junior Member
    Join Date
    Dec 2017
    Posts
    8
    Quote Originally Posted by ynot1234567890 View Post
    You are quite right, didn't realize you were using secure system (mine is open and only exposed to local network).

    So that being said, reviewing the LMS CLI documentation (On your LMS: http://localhost:9000/html/docs/cli-api.html (replace "localhost" with your server's address), you need to issue the login request upon initial connection before submitting any requests. The command is in the form of "login username correctpassword" to open, proceed with your queries and you can then close the connection (not sure is you really need to) using "login username wrongpassword".

    Basically modify each shell script that queries the LMS server to include the login and give it a try. You can always issue the commands by typing them in manually as well to ensure proper syntax.

    If you make this work, I would appreciate a copy of one of the shell scripts and I will include this as an optional format on the GitHub project for other users. If you can't make it work, let me know and I'll see if I can make some time to test on my install over the next week or two.

    Ynot.
    I was thinking along those lines. Doesn't LMS port 9000 need to be open for Home Assistant to access it? Also, any idea on the other errors in the script? Or is it anything to be concerned about. I will let you know what I find out.

  4. #24
    Senior Member
    Join Date
    Feb 2017
    Posts
    141
    Quote Originally Posted by bitterroots View Post
    I was thinking along those lines. Doesn't LMS port 9000 need to be open for Home Assistant to access it? Also, any idea on the other errors in the script? Or is it anything to be concerned about. I will let you know what I find out.
    Port 9000 is not used in the scripting. Only the CLI port which by default is 9090. As for the rest of the errors, they may clear up after you fix the login thing.

    Ynot
    Software - Logitech Media Server Version: 8.0 (Docker), Home Assistant 0.105.5, DialogFlow - V.2 API, LMS Controls App - Voice Control of LMS, OpenMediaVault 5.2
    Add-ons - Spotty, UPnP / DLNA Bridge, Cast Bridge,
    Players - Sonos, UPnP, PI3 - PI Core Player 3.5.0 with IQAudio TopHat, Android- SB Player with Viper4Android Convolution Engine, GoogleHome and Google Minis
    Hardware - HP Desktop - i7-3.4Ghz, 4GB Ram, 6TB storage, Debian

  5. #25
    Junior Member
    Join Date
    Dec 2017
    Posts
    8
    Quote Originally Posted by ynot1234567890 View Post
    Port 9000 is not used in the scripting. Only the CLI port which by default is 9090. As for the rest of the errors, they may clear up after you fix the login thing.

    Ynot
    I have not been able to get the query to work without authentication. Removing the password protection allows it to work. I think that the main issue with the password is that it only works in a telnet session. There does not seem to be a log in/log out. I am currently using HTML webhooks through IFTTT. The usage is http://USERNAMEassword@HA_Link.duckdns.org:9000/anyurl?p0=radiotime&p1=playlist&p2=play&p3=item_id :0.5<lf>&player=XX:XX:XX:XX:XX:XX. But you have to issue it each time. If I use this: | nc 192.168.1.X | \login USERNAME password ) I get a password prompt when I run the script. But it will not take the typed password.

  6. #26
    Senior Member
    Join Date
    Feb 2017
    Posts
    141
    Quote Originally Posted by bitterroots View Post
    I have not been able to get the query to work without authentication. Removing the password protection allows it to work. I think that the main issue with the password is that it only works in a telnet session. There does not seem to be a log in/log out. I am currently using HTML webhooks through IFTTT. The usage is http://USERNAMEassword@HA_Link.duckdns.org:9000/anyurl?p0=radiotime&p1=playlist&p2=play&p3=item_id :0.5<lf>&player=XX:XX:XX:XX:XX:XX. But you have to issue it each time. If I use this: | nc 192.168.1.X | \login USERNAME password ) I get a password prompt when I run the script. But it will not take the typed password.
    Well, glad to see it worked without authentication. I will take a look at it when I get a chance to see if I can make it work. Will have to play with my setup a bit to try it out.

    Ynot
    Software - Logitech Media Server Version: 8.0 (Docker), Home Assistant 0.105.5, DialogFlow - V.2 API, LMS Controls App - Voice Control of LMS, OpenMediaVault 5.2
    Add-ons - Spotty, UPnP / DLNA Bridge, Cast Bridge,
    Players - Sonos, UPnP, PI3 - PI Core Player 3.5.0 with IQAudio TopHat, Android- SB Player with Viper4Android Convolution Engine, GoogleHome and Google Minis
    Hardware - HP Desktop - i7-3.4Ghz, 4GB Ram, 6TB storage, Debian

  7. #27
    Senior Member
    Join Date
    Feb 2017
    Posts
    141
    Quote Originally Posted by bitterroots View Post
    I have not been able to get the query to work without authentication. Removing the password protection allows it to work. I think that the main issue with the password is that it only works in a telnet session. There does not seem to be a log in/log out. I am currently using HTML webhooks through IFTTT. The usage is http://USERNAMEassword@HA_Link.duckdns.org:9000/anyurl?p0=radiotime&p1=playlist&p2=play&p3=item_id :0.5<lf>&player=XX:XX:XX:XX:XX:XX. But you have to issue it each time. If I use this: | nc 192.168.1.X | \login USERNAME password ) I get a password prompt when I run the script. But it will not take the typed password.
    Looking at the way the shell scripts are written, it opens and closes the connection each time it asks for something from the LMS CLI interface. In order to make the login thing work, I believe you would need to issue two lines at each call, the first for login, the second being the request.

    As an example:

    query=$(printf "artists 0 20 search:$1 tags:a \nexit\n" | nc localhost 9090 )

    becomes

    query=$(printf "login username password\nartists 0 20 search:$1 tags:a \nexit\n" | nc localhost 9090 )

    Give something like that a shot and let me know. Ynot
    Software - Logitech Media Server Version: 8.0 (Docker), Home Assistant 0.105.5, DialogFlow - V.2 API, LMS Controls App - Voice Control of LMS, OpenMediaVault 5.2
    Add-ons - Spotty, UPnP / DLNA Bridge, Cast Bridge,
    Players - Sonos, UPnP, PI3 - PI Core Player 3.5.0 with IQAudio TopHat, Android- SB Player with Viper4Android Convolution Engine, GoogleHome and Google Minis
    Hardware - HP Desktop - i7-3.4Ghz, 4GB Ram, 6TB storage, Debian

  8. #28
    Senior Member
    Join Date
    Feb 2017
    Posts
    141
    Quote Originally Posted by bitterroots View Post
    I have not been able to get the query to work without authentication. Removing the password protection allows it to work. I think that the main issue with the password is that it only works in a telnet session. There does not seem to be a log in/log out. I am currently using HTML webhooks through IFTTT. The usage is http://USERNAMEassword@HA_Link.duckdns.org:9000/anyurl?p0=radiotime&p1=playlist&p2=play&p3=item_id :0.5<lf>&player=XX:XX:XX:XX:XX:XX. But you have to issue it each time. If I use this: | nc 192.168.1.X | \login USERNAME password ) I get a password prompt when I run the script. But it will not take the typed password.
    I have updated the shell LMS query scripts on the GITHUB https://github.com/ynot123/LMS_Contr...t/config/shell to allow for username and password on LMS installations.
    • The script qry_alb_sec.sh should be renamed to replace the existing script qry_alb.sh. Remember to update the username, password, ip address, HA_link and HA_API_Password.
    • The script qry_alb_song_sec.sh should be renamed to replace the existing script qry_alb_song.sh. Remember to update the username, password, ip address, HA_link and HA_API_Password.

    Give that a go, seems to work for me here. Ynot.

    The change log for those interested is:
    • Added an extra line "login username password" to the CLI query to authenticate before executing the query
    • Replaced nc command with socat for additional flexibility and to allow the connection to stay open to process multiple commands.

    Typical query statement would be:
    Code:
    query=$(printf "login username password\nartists 0 20 search:$1 tags:a \n" | socat stdio tcp:192.168.0.XX:9090,shut-none )
    Last edited by ynot1234567890; 2018-10-27 at 04:20. Reason: Added link to GitHub location
    Software - Logitech Media Server Version: 8.0 (Docker), Home Assistant 0.105.5, DialogFlow - V.2 API, LMS Controls App - Voice Control of LMS, OpenMediaVault 5.2
    Add-ons - Spotty, UPnP / DLNA Bridge, Cast Bridge,
    Players - Sonos, UPnP, PI3 - PI Core Player 3.5.0 with IQAudio TopHat, Android- SB Player with Viper4Android Convolution Engine, GoogleHome and Google Minis
    Hardware - HP Desktop - i7-3.4Ghz, 4GB Ram, 6TB storage, Debian

  9. #29
    Junior Member
    Join Date
    Dec 2017
    Posts
    8
    Quote Originally Posted by ynot1234567890 View Post
    I have updated the shell LMS query scripts on the GITHUB https://github.com/ynot123/LMS_Contr...t/config/shell to allow for username and password on LMS installations.
    • The script qry_alb_sec.sh should be renamed to replace the existing script qry_alb.sh. Remember to update the username, password, ip address, HA_link and HA_API_Password.
    • The script qry_alb_song_sec.sh should be renamed to replace the existing script qry_alb_song.sh. Remember to update the username, password, ip address, HA_link and HA_API_Password.

    Give that a go, seems to work for me here. Ynot.

    The change log for those interested is:
    • Added an extra line "login username password" to the CLI query to authenticate before executing the query
    • Replaced nc command with socat for additional flexibility and to allow the connection to stay open to process multiple commands.

    Typical query statement would be:
    Code:
    query=$(printf "login username password\nartists 0 20 search:$1 tags:a \n" | socat stdio tcp:192.168.0.XX:9090,shut-none )
    Success!! Thank you. On another note, any chance that you could add playing Favorites and Random Mixes (song, album, artist)?
    p0=radiotime& p1=playlist& p2=play& p3=item_id:0.0<lf>&
    p0=radiotime& p1=playlist& p2=play& p3=item_id:0.1<lf>&
    p0=radiotime& p1=playlist& p2=play& p3=item_id:0.2<lf>&
    p0=radiotime& p1=playlist& p2=play& p3=item_id:0.3<lf>&
    p0=radiotime& p1=playlist& p2=play& p3=item_id:0.4<lf>&
    p0=radiotime& p1=playlist& p2=play& p3=item_id:0.5<lf>&
    p0=radiotime& p1=playlist& p2=play& p3=item_id:0.6<lf>&
    p0=radiotime& p1=playlist& p2=play& p3=item_id:0.7<lf>&
    p0=radiotime& p1=playlist& p2=play& p3=item_id:0.8<lf>&
    p0=radiotime& p1=playlist& p2=play& p3=item_id:0.9<lf>&
    p0=radiotime& p1=playlist& p2=play& p3=item_id:0.10<lf>&
    p0=randomplay& p1=tracks&

  10. #30
    Senior Member
    Join Date
    Feb 2017
    Posts
    141
    Quote Originally Posted by bitterroots View Post
    Success!! Thank you. On another note, any chance that you could add playing Favorites and Random Mixes (song, album, artist)?
    Glad it worked out. As for the Favorite and Random mix, I've never really made use of those features in LMS, I use a similar feature with Spotify via LMS.

    I will consider the implementation of these LMS features in my Winter upgrade (should have some free time). There are a few other items on the to do list as well.

    Stay Tuned. Ynot
    Software - Logitech Media Server Version: 8.0 (Docker), Home Assistant 0.105.5, DialogFlow - V.2 API, LMS Controls App - Voice Control of LMS, OpenMediaVault 5.2
    Add-ons - Spotty, UPnP / DLNA Bridge, Cast Bridge,
    Players - Sonos, UPnP, PI3 - PI Core Player 3.5.0 with IQAudio TopHat, Android- SB Player with Viper4Android Convolution Engine, GoogleHome and Google Minis
    Hardware - HP Desktop - i7-3.4Ghz, 4GB Ram, 6TB storage, Debian

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •