Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • paul-
    replied
    Post the output of the command. I hope you are using a button and not just touching wire and pins. There is debounce in the software. But you would see that if you look at the output.

    Leave a comment:


  • PaulH
    replied
    Originally posted by paul-
    Yes, see what that shows, the should be a lot of rest output..there is also a debug level with -z, but don’t start with that.
    It doesn't work. I measure 3,3V on PIN 24 (it's seems to be set as input). Connected to GND the player stay in PLAY mode

    Leave a comment:


  • paul-
    replied
    Yes, see what that shows, the should be a lot of rest output..there is also a debug level with -z, but don’t start with that.

    Leave a comment:


  • PaulH
    replied
    Originally posted by paul-
    Almost certainly user error.
    For sure !

    Originally posted by paul-
    Almost certainly user error.

    Run the command from an ssh session with verbose (-v) output.
    Like that ?
    tc@pCP:~$ sbpd -d -s b,24,PLAY,2,0 -v

    Leave a comment:


  • paul-
    replied
    Almost certainly user error.

    Run the command from an ssh session with verbose (-v) output.

    Leave a comment:


  • PaulH
    replied
    Tried to add the pause command by pulling down the GPIO08 (pin24):

    /usr/local/sbin/sbpd -d -s b,24,PLAY,2,0

    Nothing happend. What could be wrong ? Thanks

    Leave a comment:


  • KillerJoe34
    replied
    Yes, it's sbpd-script.sh

    I just added sudo pigpiod in the script and it works now strange

    Thank you Paul for your time and work !

    But... I'll be back

    Leave a comment:


  • paul-
    replied
    The user commands section of pCP will run with root permission, so no need for sudo in the script.

    Is the script named sbpd-script or sbpd-script.sh Make sure you are using the correct name in user commands.

    Leave a comment:


  • KillerJoe34
    replied
    It's ok if I run the script manually
    Do you mean I have to move the cfg in the tc directory ?

    Edit: just moved it in the tc directory but still the same

    Edit2: it seems it's a permission problem, I need to sudo pigpiod again after a reboot to make the script work, I probably did something wrong in the process..
    I'll try again tomorrow
    Last edited by KillerJoe34; 2022-01-04, 20:39.

    Leave a comment:


  • paul-
    replied
    /home/tc/sbpd-script.sh is correct for put in user commands.

    What happens when you run the script manually. I can see you have a path issue for the cfg file. You need to fix that first.

    Leave a comment:


  • KillerJoe34
    replied
    Hi everyone, noob here... and french btw, excuse my english

    I approximately managed to get it working, read several times the entire thread for that,
    but there's something probably very simple I don't get :

    It works perfectly if I run this command line in my monitor:

    sbpd e,23,24,VOLU,2 b,25,NEXT,2,0 (But I need to sudo pigpiod before to make it work)

    I then put this in /home/tc/sbpd-script :

    Code:
    #start pigpiod daemon
    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 -v -f /home/tc/sbpd_commands.cfg e,23,24,VOLU,2 b,25,NEXT,2,0
    And made it executable.

    Ant now I'm lost, what command line do I need to put in User Command to make it work ?

    I tried
    Code:
    /home/tc/sbpd-script.sh
    but nothing happens even after rebooting (do I need to ?)
    I also tried to put 2 commands (#1 sudo pigpiod and #2 sbpd e,23,24,VOLU,2 b,25,NEXT,2,0) without any luck

    Also, sbpd_commands.cfg is located in /home/tc/SqueezeButtonPi-Daemon, don't know if it's ok ?

    Thanks in advance for any help

    Leave a comment:


  • hsmeets
    replied
    In this same thread someone also had issues with that encoder.



    But I see you have it working now

    Leave a comment:


  • pdo59
    replied
    I found the problem, in the command I swapped CLK and DT.
    Indeed pin1 stands for CLK and pin2 stands for DT, in my case 5 is CLK and 6 DT, so the correct final command is:
    Code:
    sbpd -s -d e,5,6,TRAC b,7,PLAY
    Thank you hsmeets, paul for the support!

    Leave a comment:


  • pdo59
    replied
    Originally posted by hsmeets
    Do you pull the GPIO low or high with the encoder?IOW How do you have it wired?
    The encoder is an KY-040 module, CLK and DT in HIGH state are connected via pull-up resistors.
    Originally posted by hsmeets
    It could be that volumio expects the GPIO to be pulled high where squeeze button pi expect the other way around, to be pulled low by the encoder. Then you either have to rewire or change the software options if available.
    I looked for a software option to indicate pull-up but there isn't, it can only be indicated for buttons.
    I'll try to understand the debug output better.

    Leave a comment:


  • hsmeets
    replied
    Originally posted by pdo59
    In the command line I wrote the GPIO numbers, is this correct?
    Yes

    Originally posted by pdo59
    The PLAY button works because is connected to pin 26 that is GPIO7; the encoder is connected to pin 29 / GPIO5 and pin 31 / GPIO6.
    With this configuration the encoder work perfectly in a Volumio environment.
    Do you pull the GPIO low or high with the encoder? IOW How do you have it wired? It could be that volumio expects the GPIO to be pulled high where squeeze button pi expect the other way around, to be pulled low by the encoder. Then you either have to rewire or change the software options if available.

    Leave a comment:

Working...
X
😀
🥰
🤢
😎
😡
👍
👎