Announcement

Collapse
No announcement yet.

[ANNOUNCE] SqueezeButtonPi - Tool to use buttons and rotary encoders on a RPi

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • mfraser
    replied
    I now have 6 capacitive touch buttons that work with this command:

    sbpd -v b,20,POWR,0,1 b,5,PLAY,0,1 b,6,PREV,0,1 b,12,NEXT,0,1 b,13,VOL+,0,1 b,16,VOL-,0,1

    Except that the VOL+ and VOL- buttons don't control the volume:
    1665655871.6666 6 control.c,134: Button CB set for button #:5, gpio pin 16
    1665655871.7481 6 control.c,276: Button pressed: Pin: 16, Press Type:Short
    1665655871.7481 6 servercomm.c,74: Send Command:0, Fragment:["button","voldown"]
    1665655876.2441 6 GPIO.c,107: Short PRESS: 84
    1665655876.2442 6 control.c,134: Button CB set for button #:4, gpio pin 13
    1665655876.2596 6 control.c,276: Button pressed: Pin: 13, Press Type:Short
    1665655876.2597 6 servercomm.c,74: Send Command:0, Fragment:["button","volup"]
    1665655876.8027 6 GPIO.c,107: Short PRESS: 2477
    1665655876.8028 6 control.c,134: Button CB set for button #:5, gpio pin 16
    1665655876.8686 6 control.c,276: Button pressed: Pin: 16, Press Type:Short
    1665655876.8687 6 servercomm.c,74: Send Command:0, Fragment:["button","voldown"]
    1665655878.1881 6 GPIO.c,107: Short PRESS: 936
    1665655878.1882 6 control.c,134: Button CB set for button #:5, gpio pin 16
    1665655878.2767 6 control.c,276: Button pressed: Pin: 16, Press Type:Short
    1665655878.2768 6 servercomm.c,74: Send Command:0, Fragment:["button","voldown"]

    Leave a comment:


  • paul-
    replied
    Its not required anymore. Just download the extension pcp-sbpd.tcz that will install everything you need.

    Leave a comment:


  • fjk
    replied
    Hello,

    how to install wiringPi, required to use SqueezeButtonPi?
    I cannot find it in picoreplayer extensions

    Leave a comment:


  • amanker
    replied
    I have problem using rotary encoder for volume control.
    Using sbpd -s e,16,20,VOLU,2
    And commands for bittons. Buttons works. But envoder dont, i can see events in console. But volume is not chamging, in console i see -1 count then +1 count.
    I tried changing VOLU to key event, but then also if turn left volume down occurs and after immediately volume up occurs so net reault volume always 100%

    Leave a comment:


  • paul-
    replied
    That is for sure not possible. You will need to write your own software.

    Leave a comment:


  • luigi2000
    replied
    Originally posted by paul- View Post
    You can do short press / long press.
    Yes I thought about that but this is not what I want. It should be working with just one single press so that this playlist is always startet in shuffle mode.
    But I actually found a way how to do it. I dont know if it is intended to work like that but it works.

    I just double assigned the button like this

    Code:
    sbpd -f /home/tc/sbpd_commands.cfg b,4,SHUF,2,0 b,4,PRE1,2,0
    and in the sbpd_commands.cfg i defined the SHUF command:
    Code:
    SHUF=["playlist","shuffle","1"]
    I also thought it might be possible to do it with the SCRIPT Attribute but I don't know how to use it.

    Another thing I want to do is to control a GPIO depending on the play state. Is there a easy way to do it?

    Leave a comment:


  • paul-
    replied
    You can do short press / long press.

    Leave a comment:


  • luigi2000
    replied
    start multiple commands with one button

    Hey,

    Is there a way to start more than one command when I press a button?

    I have a playlist that is started when I press a button and it should always start in shuffle mode.
    So im looking for something like this:

    PRE1=["playlist","shuffle","1"]["button","preset_1.single"]

    but it is not working

    These single commands work just fine
    PRE1=["playlist","shuffle","1"]
    PRE1=["button","preset_1.single"]

    Any idea how to solve the problem?

    Thanks

    Leave a comment:


  • Corpze
    replied
    Originally posted by hsmeets View Post
    Just read the posts before yours, it was just discussed.
    is it this sulotion?

    #!/bin/sh

    Before the script?

    I appologize but I am a total noob...

    I just can log in to SSH.

    Someone wrote something about creating a startup.sh file?
    How, where? what do i write?

    I have read all the pages for three days now, nothing about what to write or where...

    I just run the script posted and changed the pin-numbers and got that working - now i just need to make it permanent

    Edit, this is how my terminal looks like:
    Click image for larger version

Name:	terminal.PNG
Views:	1
Size:	41.9 KB
ID:	1574383

    Edit 2: Solved - I added this text under the GUI tweaks User command: sudo pigpiod -t 0 -f -l -s 10; sleep 1.0; sbpd -f /home/tc/sbpd_commands.cfg e,27,24,VOLU,2 b,22,PLAY,2,0

    And that worked...
    Last edited by Corpze; 2022-01-31, 09:55. Reason: Add prtscr

    Leave a comment:


  • hsmeets
    replied
    Originally posted by Corpze View Post

    But how do imake it permanent?
    Just read the posts before yours, it was just discussed.

    Leave a comment:


  • Corpze
    replied
    It works! - How do i make it permanent?

    Hi all - first post and i love this thing!
    Complete noob but is learning

    Pi 3B+
    5" LCD HDMI waveshare
    rotary encoder
    480GB SSD

    Picoreplayer - latest version
    LMS, jivelite etc..

    So, everything is working amazing!
    I have installed pcp_sbpd.tcz via the web GUI.

    The encoder is hooked up and i SSH in to terminal and run this:

    Code:
    #start pigpiod daemon
    sudo pigpiod -t 0 -f -l -s 10
    
    # wait for pigpiod to initialize - indicated by 'pigs t' exit code of zero
    count=10 # approx time limit in seconds
    while ! pigs t >/dev/null 2>&1 ; do
            if [ $((count--)) -le 0 ]; then
                    printf "\npigpiod failed to initialize within time limit\n"
                    exit 1 # or however you want to deal with failure
            fi
    #       printf "\nWaiting for pigpiod to initialize\n"
            sleep 1
    done
    printf "\npigpiod is running\n"
    
    # load uinput module - required to be able to send keystrokes
    # then set the permission to group writable, so you don't need to run sbpd with
    sudo modprobe uinput
    sudo chmod g+w /dev/uinput
    
    # issue the sbpd command
    sbpd -f /home/tc/sbpd_commands.cfg e,27,24,VOLU,2 b,22,PLAY,2,0
    The encoder is working just awesome...

    But how do imake it permanent?

    Leave a comment:


  • PaulH
    replied
    it works !!! Thanks chill !

    Leave a comment:


  • chill
    replied
    Originally posted by PaulH View Post
    For "autorun":
    Code:
    ./sbpd-script.sh
    It didn't start.
    You just need to put your original command back into the User Commands section.
    Code:
    /home/tc/sbpd-script.sh
    I suspect the reason it didn't work before was because you hadn't made it executable at that stage.

    Leave a comment:


  • PaulH
    replied
    Originally posted by chill View Post
    Ah, that's an evil Linux trap for the unwary Windows user! It won't assume that you are referring to a file in the current directory. You have to be explicit:

    Code:
    [email protected]:~$ [email protected]:~$ ./sbpd-script.sh
    Thanks a lot !! With your command I can run "manually" the script ! And Play/pause is working.

    For "autorun":
    Code:
    ./sbpd-script.sh
    It didn't start.
    Last edited by PaulH; 2022-01-23, 19:41.

    Leave a comment:


  • chill
    replied
    Originally posted by PaulH View Post
    I can't run it:
    Code:
    [email protected]:~$ [email protected]:~$ sbpd-script.sh
    -sh: sbpd-script.sh: not found
    Ah, that's an evil Linux trap for the unwary Windows user! It won't assume that you are referring to a file in the current directory. You have to be explicit:

    Code:
    [email protected]:~$ [email protected]:~$ ./sbpd-script.sh

    Leave a comment:

Working...
X