Home of the Squeezebox™ & Transporter® network music players.
Page 25 of 28 FirstFirst ... 152324252627 ... LastLast
Results 241 to 250 of 275
  1. #241
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,352
    Quote Originally Posted by paul- View Post
    Chill,

    Would you mind testing this out for me.
    I'll be happy to. My RPi with an encoder doesn't have a screen or Jivelite, and my RPi with Jivelite and a screen doesn't have an attached encoder. The latter is easier to fix, so I'll go that route.

  2. #242
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,352
    This works perfectly with my encoder:
    Code:
    ./sbpd -v e,20,21,KEY:KEY_UP-KEY_DOWN,2  b,26,KEY:KEY_RIGHT,2,0,KEY:KEY_LEFT,500
    I had to adjust the 'Detente Mode' setting to 2, so that each click moves the cursor one position up or down, but after that it's perfect. Push the encoder to select the current row, long push it to back out - completely intuitive.

    With the above command I have the following connections on my encoder:
    SW to GPIO26 (physical pin 37)
    DT to GPIO20 (physical pin 38)
    CLK to GPIO21 (physical pin 40)
    + to 3V3 (physical pin 1)
    GND to Ground (physical pin 6)
    Last edited by chill; 2019-09-29 at 04:44.

  3. #243
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,352
    Can I just say what a great addition this is to sbpd. Controlling Jivelite with a rotary encoder, so that it behaves like an original Squeezebox Radio or Boom*, is something that quite a few people have wanted an easy way to achieve I think.

    *EDIT: I know the Boom doesn't use Jivelite, but it does use rotary encoder to control the display.
    Last edited by chill; 2019-09-25 at 12:03.

  4. #244
    Quote Originally Posted by paul- View Post
    Chill,

    Would you mind testing this out for me. My current jivelite setup is a bit difficult to add encoders and buttons to......but I did verify that I'm getting keyboard events.

    https://dl.dropboxusercontent.com/s/...pkskgzj4c/sbpd

    This is the latest source using pigpio, so make sure you have that library setup.
    We are using the kernel uinput module, so you need to load it, then set the permission to group writable, so you don't need to run sbpd with root permissions.
    Code:
    sudo modprobe uinput
    sudo chmod g+w /dev/uinput
    Here is the help info......linux key names are found https://github.com/raspberrypi/linux...-event-codes.h
    Code:
        For rotary encoders (one, volume only):
            e,pin1,pin2,CMD[,edge]
                "e" for "Encoder"
                p1, p2: GPIO PIN numbers in BCM-notation
                CMD: Command. one of. \n\
                    VOLU for Volume\n\
                    TRAC for Prev/Next track\n\
                    KEY:<Positive key_name>-<Negative key_name>
                mode: Optional. one of\n\
                    1   - Step mode (default)\n\
                    2-9 - Detent mode - Assumes 1 dial click is x steps.
    
        For buttons: 
            b,pin,CMD[,resist,pressed,CMD_LONG,long_time]
                "b" for "Button"
                pin: GPIO PIN numbers in BCM-notation
                CMD: Command. One of:
                       PLAY:   Play/pause
                       PREV:   Jump to previous track
                       NEXT:   Jump to next track
                       VOL+:   Increase volume
                       VOL-:   Decrease volume
                       POWR:   Toggle power state
                     Commands can be defined in config file
                         use -f option, ref:sbpd_commands.cfg 
                     Command type SCRIPT.
                       SCRIPT:/path/to/shell/script.sh
                     Command type KEY.
                          KEY:<linux key_name>.
                resist: Optional. one of
                    0 - Internal resistor off
                    1 - pull down         - input puts 3v on GPIO pin
                    2 - pull up (default) - input pulls GPIO pin to ground
                pressed: Optional GPIO pinstate for button to read pressed
                    0 - state is 0 (default)
                    1 - state is 1
                CMD_LONG: Command to be used for a long button push, see above command list
                long_time: Number of milliseconds to define a long press
    For example
    Code:
    ./sbpd -v e,20,21,KEY:KEY_UP-KEY_DOWN,4  b,20,KEY:KEY_RIGHT,2,0,KEY:KEY_LEFT,500

    Amazing news,

    Could you explain me how to install sbpd from your link and how to setup pigpio library.

    Thank you!

  5. #245
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,352
    Quote Originally Posted by Jursi View Post
    Amazing news,

    Could you explain me how to install sbpd from your link and how to setup pigpio library.

    Thank you!
    Install pigpio.tcz from the piCorePlayer repository, then make sure the daemon is running: just type pigpiod from the command line of an SSH terminal.

    Then issue the two commands that Paul specified:
    Code:
    sudo modprobe uinput
    sudo chmod g+w /dev/uinput
    Then download the sbpd binary from Paul's dropbox link, and put it in the home directory of user tc: /home/tc
    Make sure it's executable: I changed the permissions to 755 from within Filezilla

    Finally, issue the ./sbpd command, with gpio pin assignments to match your encoder's connections to the RPi pins.

    For testing purposes I did all this from an SSH command line, but for normal use I would put it in a script file which I'd call at startup using pCP's 'User commands' tweak. If you go that route, note that pigpiod seems to need a moment to start up before you can issue the sbpd command - I inserted a 'sleep 1' into my script immediately after the pigpiod command.

  6. #246
    Quote Originally Posted by chill View Post
    Install pigpio.tcz from the piCorePlayer repository, then make sure the daemon is running: just type pigpiod from the command line of an SSH terminal.

    Then issue the two commands that Paul specified:
    Code:
    sudo modprobe uinput
    sudo chmod g+w /dev/uinput
    Then download the sbpd binary from Paul's dropbox link, and put it in the home directory of user tc: /home/tc
    Make sure it's executable: I changed the permissions to 755 from within Filezilla

    Finally, issue the ./sbpd command, with gpio pin assignments to match your encoder's connections to the RPi pins.

    For testing purposes I did all this from an SSH command line, but for normal use I would put it in a script file which I'd call at startup using pCP's 'User commands' tweak. If you go that route, note that pigpiod seems to need a moment to start up before you can issue the sbpd command - I inserted a 'sleep 1' into my script immediately after the pigpiod command.
    Thank you!

    I can't find pigpio.tcz from the repository, any idea why?

    I am running 4.1.0

  7. #247
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,352
    Quote Originally Posted by Jursi View Post
    I can't find pigpio.tcz from the repository, any idea why?

    I am running 4.1.0
    Are you looking in the 'piCorePlayer repository', or the 'Official piCore repository'? It will be in the former, and I suspect the latter is the default in pCP4. I did this from pCP5. I don't know for sure whether pigpio.tcz is available in pCP4 - perhaps Paul can comment.

  8. #248
    Quote Originally Posted by chill View Post
    Are you looking in the 'piCorePlayer repository', or the 'Official piCore repository'? It will be in the former, and I suspect the latter is the default in pCP4. I did this from pCP5. I don't know for sure whether pigpio.tcz is available in pCP4 - perhaps Paul can comment.
    I am looking from the piCorePlayer repository. Name:  Pigpio.png
Views: 77
Size:  37.3 KB

  9. #249
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,352
    Quote Originally Posted by Jursi View Post
    I am looking from the piCorePlayer repository. Name:  Pigpio.png
Views: 77
Size:  37.3 KB
    Quote Originally Posted by chill View Post
    I don't know for sure whether pigpio.tcz is available in pCP4 - perhaps Paul can comment.
    I guess that's the answer then. I'm sorry, I don't know if pCP5 extensions are necessarily compatible with pCP4, or how to use them if they are.

  10. #250
    Quote Originally Posted by chill View Post
    I guess that's the answer then. I'm sorry, I don't know if pCP5 extensions are necessarily compatible with pCP4, or how to use them if they are.
    Maybe I try to install pcp5 tomorrow. Hopefully my chinese display will also work in pcp5.

    Thanks a lot for your help!

Posting Permissions

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