Home of the Squeezebox™ & Transporter® network music players.
Page 19 of 20 FirstFirst ... 917181920 LastLast
Results 181 to 190 of 191
  1. #181
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    1,912
    Yes, see if anything shows on the server when that is entered. You might try to issue the command via the cli as well. Remember, the format is slightly different on the cli.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  2. #182
    Junior Member
    Join Date
    Apr 2019
    Posts
    2
    Another simple method is to use presets.
    Add your favorites to the presets: LMS Server/Settings/Player/your player/Presets
    Edit your sbpd_commands.cfg file.

    For example:
    PRE1=["button","preset_1.single"]
    PRE2=["button","preset_2.single"]
    PRE3=["button","preset_3.single"]
    PRE4=["button","preset_4.single"]
    PRE5=["button","preset_5.single"]

    My sbpd command on the tweaks page:
    /usr/local/sbin/sbpd -z -d -f /home/tc/sbpd_commands.cfg e,9,10,TRAC,3 b,11,PRE1,2,0,PRE2,1000 e,27,17,VOLU b,22,PLAY,2,0,PRE3,1000 b,13,PRE4,2,0,PRE5,1000

    So in future you only have to change the preset occupancy.

    Greetings chschind

  3. #183
    Junior Member
    Join Date
    Apr 2019
    Posts
    29
    Quote Originally Posted by chschind View Post
    Another simple method is to use presets.
    Add your favorites to the presets: LMS Server/Settings/Player/your player/Presets
    Edit your sbpd_commands.cfg file.

    For example:
    PRE1=["button","preset_1.single"]
    PRE2=["button","preset_2.single"]
    PRE3=["button","preset_3.single"]
    PRE4=["button","preset_4.single"]
    PRE5=["button","preset_5.single"]

    My sbpd command on the tweaks page:
    /usr/local/sbin/sbpd -z -d -f /home/tc/sbpd_commands.cfg e,9,10,TRAC,3 b,11,PRE1,2,0,PRE2,1000 e,27,17,VOLU b,22,PLAY,2,0,PRE3,1000 b,13,PRE4,2,0,PRE5,1000

    So in future you only have to change the preset occupancy.

    Greetings chschind
    Hello,

    It seems that I am not able to use presets because I am only using raspberry pi's running picoreplayer and I don't have any original logitech squeezebox player.

  4. #184
    Junior Member
    Join Date
    Apr 2019
    Posts
    29
    Quote Originally Posted by paul- View Post
    Yes, see if anything shows on the server when that is entered. You might try to issue the command via the cli as well. Remember, the format is slightly different on the cli.
    I played with CLI and I got it working by leaving the item_id value empty. It is also working in sbpd now with this command:

    Code:
    FAV1=["favorites", "playlist", "play", "item_id:"]

    The code will add all the favorites to the playlist. My main goal was to play a one specific radio station so it is my only favorite now.

    I couldn't figure out the id's of the playlists. Maybe they are not real playlists since they are only stream urls which are added in the favorites.opml file?


    Thank you for your help!
    Last edited by Jursi; 2019-06-23 at 09:35.

  5. #185
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    1,912
    I had time to dig into this....the id numbers are a little different on the JSON interface....I'm sure there is another way to find them, but here is a way on pCP

    Code:
    tc@piTouch:~$ cd www
    tc@piTouch:~/www$ cd cgi-bin/
    tc@piTouch:~/www/cgi-bin$ sudo rm /tmp/json_list
    tc@piTouch:~/www/cgi-bin$ . pcp-functions
    tc@piTouch:~/www/cgi-bin$ . pcp-lms-functions
    tc@piTouch:~/www/cgi-bin$ pcp_lms_favorites_list nav
            <a class="nav7" onclick="return lms_controls_send('192.168.0.141', '9000', 'piTouch', 'favorites', 'playlist', 'play', 'item_id:13568784.0')">Today's Adult Hits Radio</a>
            <a class="nav7" onclick="return lms_controls_send('192.168.0.141', '9000', 'piTouch', 'favorites', 'playlist', 'play', 'item_id:13568784.1')">90s Pop Radio</a>
            <a class="nav7" onclick="return lms_controls_send('192.168.0.141', '9000', 'piTouch', 'favorites', 'playlist', 'play', 'item_id:13568784.2')">the FOX</a>
            <a class="nav7" onclick="return lms_controls_send('192.168.0.141', '9000', 'piTouch', 'favorites', 'playlist', 'play', 'item_id:13568784.4')">MIX 107.7 WMMX-FM</a>
    Ignore the html code you get, but you will find the id numbers you need to use.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  6. #186
    Junior Member
    Join Date
    Apr 2019
    Posts
    29
    Quote Originally Posted by paul- View Post
    I had time to dig into this....the id numbers are a little different on the JSON interface....I'm sure there is another way to find them, but here is a way on pCP

    Code:
    tc@piTouch:~$ cd www
    tc@piTouch:~/www$ cd cgi-bin/
    tc@piTouch:~/www/cgi-bin$ sudo rm /tmp/json_list
    tc@piTouch:~/www/cgi-bin$ . pcp-functions
    tc@piTouch:~/www/cgi-bin$ . pcp-lms-functions
    tc@piTouch:~/www/cgi-bin$ pcp_lms_favorites_list nav
            <a class="nav7" onclick="return lms_controls_send('192.168.0.141', '9000', 'piTouch', 'favorites', 'playlist', 'play', 'item_id:13568784.0')">Today's Adult Hits Radio</a>
            <a class="nav7" onclick="return lms_controls_send('192.168.0.141', '9000', 'piTouch', 'favorites', 'playlist', 'play', 'item_id:13568784.1')">90s Pop Radio</a>
            <a class="nav7" onclick="return lms_controls_send('192.168.0.141', '9000', 'piTouch', 'favorites', 'playlist', 'play', 'item_id:13568784.2')">the FOX</a>
            <a class="nav7" onclick="return lms_controls_send('192.168.0.141', '9000', 'piTouch', 'favorites', 'playlist', 'play', 'item_id:13568784.4')">MIX 107.7 WMMX-FM</a>
    Ignore the html code you get, but you will find the id numbers you need to use.
    Thanks you for your effort.

    I am getting the following error:


    Code:
    tc@piCorePlayer:~$ cd www
    tc@piCorePlayer:~/www$ cd cgi-bin/
    tc@piCorePlayer:~/www/cgi-bin$ sudo rm /tmp/json_list
    tc@piCorePlayer:~/www/cgi-bin$ . pcp-functions
    tc@piCorePlayer:~/www/cgi-bin$ . pcp-lms-functions
    tc@piCorePlayer:~/www/cgi-bin$ pcp_lms_favorites_list nav
    wget: server returned error: HTTP/1.0 501 Not Implemented
    sh: -lt: argument expected

  7. #187
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    1,912
    what version is your server? Might need to be running LMS 7.9.2
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  8. #188
    Junior Member
    Join Date
    Apr 2019
    Posts
    29
    Quote Originally Posted by paul- View Post
    what version is your server? Might need to be running LMS 7.9.2
    The server is running 7.9.2 so that shouldn't be the problem.

  9. #189
    Quote Originally Posted by Jursi View Post
    The server is running 7.9.2 so that shouldn't be the problem.
    Dear Jursi,

    I have had the same goal in adding physical favorite buttons to my piCorePlayer (I'm building a kitchen radio with a few preset buttons, no display). I'm glad I have found your post in this thread, your posts gave me some hints, and now it's working

    As there is no complete writeup (at least, I did not find one), I'll paste the stuff for future references. In order to keep it simple, the example has only two buttons and accordingly two presets. It can be easily extended.

    In the LMS Web-Interface, I have created a presets folder (in my case, it's called MY_BUTTON_PRESETS) which contains two (radio station) favorites. So my favorites file (in my case, its at /mnt/LMSfiles/slimserver/prefs/favorites.opml) looks like this:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <opml version="1.0">
      <head title="Favorites">
        <expansionState></expansionState>
      </head>
      <body>
        <outline icon="html/images/favorites.png" text="MY_BUTTON_PRESETS">
          <outline URL="http://opml.radiotime.com/Tune.ashx?id=s13606&amp;formats=aac,ogg,mp3&amp;partnerId=16&amp;serial=5c72f1e9719c3c4ca51c39b1288ced5b" icon="/imageproxy/http%3A%2F%2Fcdn-radiotime-logos.tunein.com%2Fs13606q.png/image.png" text="MY FIRST PRESET: Radio Paradise" type="audio" />
          <outline URL="http://opml.radiotime.com/Tune.ashx?id=s8235&amp;formats=aac,ogg,mp3&amp;partnerId=16&amp;serial=5c72f1e9719c3c4ca51c39b1288ced5b" icon="/imageproxy/http%3A%2F%2Fcdn-radiotime-logos.tunein.com%2Fs8235q.png/image.png" text="MY SECOND PRESET: Radio FM4" type="audio" />
        </outline>
      </body>
    </opml>
    The native LMS CLI commands for this folder favorite structure would be:

    Code:
    # indices start at zero, referencing the elements in the LMS favorites, a "dot" steps into the next folder
    #
    # so, in order to play the first preset, we need to reference the presets folder first (first element in the LMS favorites) using a "0", then (separated by the dot), the actual item play (again, using the "0").
    favorites playlist play item_id:0.0
    # play the second preset in the presets folder
    favorites playlist play item_id:0.1
    If there would be no surrounding folder for the presets (plain favorites in LMS favorites, no folder MY_BUTTON_PRESETS), the command would look like favorites playlist play item_id:0 (which would simply play the first favorite).



    In the SqueezeButtonPi-Config I set exactly theses commands in the given structure, so the content /home/tc/sbpd_commands.cfg of is:

    Code:
    FAV1=["favorites", "playlist", "play", "item_id:0.0"]
    FAV2=["favorites", "playlist", "play", "item_id:0.1"]

    At the player Web-Interface, Tweaks page, I have set:

    Auto start tweaks -> Auto start LMS:
    Code:
    favorites playlist play item_id:0.0
    This command will play the first element in the playlist as soon as the player has booted.


    User commands -> User command #1:
    Code:
    /usr/local/sbin/sbpd -v -d -f /home/tc/sbpd_commands.cfg b,13,FAV1 b,26,FAV2
    That's the trigger command for starting the SqueezeButtonPiDaemon, giving the wiring config.



    With that, I can happily switch between the two radio station presets using two buttons (wired to BCM pins 13 and 26), works like a charm


    I hope, it helps!

    Best wishes

    p.s. thanks a lot to the developers for this cool piece of software!

  10. #190
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    1,912
    Quote Originally Posted by chill View Post
    I've figured out what stops my sbpd command line from working, but not why. When I add the command line parameter to specify the address of the server, the command fails, and none of the buttons work. I've tried '-A 192.168.1.47' and '-A 192.168.1.47:9000'. Is that the correct syntax? Adding the MAC address with '-M dc:a6:32:03:82:22' works, and I've got the -A parameter immediately after the MAC address parameter.
    The you need to put -P 9000 for the port. Otherwise, it looks fine. If you have verbose output on, it should print what it is doing.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

Posting Permissions

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