Home of the Squeezebox™ & Transporter® network music players.
Page 39 of 40 FirstFirst ... 2937383940 LastLast
Results 381 to 390 of 398
  1. #381
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    4,000
    That's how python is interfacing with the GPIO. The import alone should not do it. The phatbeat python code is resetting all of the board GPIO when you start it.

    https://github.com/pimoroni/phat-bea...at/__init__.py

    You will need to make you own version of the the phatbeat library, remove all of the references to the inputs.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  2. #382
    Senior Member wtnh's Avatar
    Join Date
    Mar 2010
    Location
    US - East Coast
    Posts
    104
    I had success getting an encoder to work. Thanks to others in this thread for ideas! Hopefully, this will help anyone trying to get this working. This is on piCorePlayer 6.1.
    My main goal was jivelite navigation (not volume). I used one of these generic encoders:
    https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1

    I wired it to the following GPIO pins, similar to what was noted in a previous thread:

    Code:
    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)
    I then downloaded pcp-sbpd.tcz and pigpio.tcz from the repo. I used this script (thank you @chill) and placed it in the tc user home directory:
    Code:
    #!/bin/sh
    
    # start pigpiod daemon
    
    pigpiod
    
    # give the daemon a moment to start up before issuing the sbpd command
    
    sleep 1
    
    # load uinput module, then set the permission to group writable, so you don't need to run sbpd with root permissions
    
    sudo modprobe uinput
    
    sudo chmod g+w /dev/uinput
    
    # issue the sbpd command
    
    # This command will cause encoder to move selection right or left; Press=Enter; long press=down
    
    sbpd e,20,21,KEY:KEY_LEFT-KEY_RIGHT,4  b,26,KEY:KEY_ENTER,4,0,KEY:KEY_DOWN,500
    and this for the User Commands in Tweaks:
    Code:
    /home/tc/sbpd-script.sh
    EDIT - Forgot to add that you need to set permissions on the script in the tc home directory to allow it to run:
    Code:
    chmod 755 sbpd-script.sh
    Note that I am using KEY_LEFT and KEY_RIGHT for the rotation, and KEY_ENTER for the button press. I also bumped the detent count to 4 because it seemed too sensitive. This allows me to scroll through, e.g. album covers, then select one by pressing the encoder button. I am using a long press to simulate KEY_DOWN, allowing me to scroll down a list (as in tracks as they are displayed in jivelite). This is a little awkward but does the job with a single encoder and no extra buttons.

    Also, paul's github repo readme entry is very helpful for understanding the sbpd paramteters: https://github.com/paul-1/SqueezeButtonPi-Daemon

    Thanks to @pippin and @paul- for enabling this!
    Last edited by wtnh; 2021-03-07 at 09:34.

  3. #383
    Junior Member
    Join Date
    Jan 2021
    Posts
    18
    Disregard post. Cancelled portable use case project.
    Last edited by LiFePO4; 2021-02-21 at 22:53.

  4. #384
    Junior Member
    Join Date
    Feb 2021
    Posts
    5
    Quote Originally Posted by wtnh View Post
    I had success getting an encoder to work. Thanks to others in this thread for ideas! Hopefully, this will help anyone trying to get this working. This is on piCorePlayer 6.1.
    My main goal was jivelite navigation (not volume). I used one of these generic encoders:
    https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1

    I wired it to the following GPIO pins, similar to what was noted in a previous thread:

    Code:
    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)
    I then downloaded pcp-sbpd.tcz and pigpio.tcz from the repo. I used this script (thank you @chill) and placed it in the tc user home directory:
    Code:
    #!/bin/sh
    
    # start pigpiod daemon
    
    pigpiod
    
    # give the daemon a moment to start up before issuing the sbpd command
    
    sleep 1
    
    # load uinput module, then set the permission to group writable, so you don't need to run sbpd with root permissions
    
    sudo modprobe uinput
    
    sudo chmod g+w /dev/uinput
    
    # issue the sbpd command
    
    # This command will cause encoder to move selection right or left; Press=Enter; long press=down
    
    sbpd e,20,21,KEY:KEY_LEFT-KEY_RIGHT,4  b,26,KEY:KEY_ENTER,4,0,KEY:KEY_DOWN,500
    and this for the User Commands in Tweaks:
    Code:
    /home/tc/sbpd-script.sh
    Note that I am using KEY_LEFT and KEY_RIGHT for the rotation, and KEY_ENTER for the button press. I also bumped the detent count to 4 because it seemed too sensitive. This allows me to scroll through, e.g. album covers, then select one by pressing the encoder button. I am using a long press to simulate KEY_DOWN, allowing me to scroll down a list (as in tracks as they are displayed in jivelite). This is a little awkward but does the job with a single encoder and no extra buttons.

    Also, paul's github repo readme entry is very helpful for understanding the sbpd paramteters: https://github.com/paul-1/SqueezeButtonPi-Daemon

    Thanks to @pippin and @paul- for enabling this!
    Hey @wtnh - did you have to change the permissions on the shell script which you created? I can't get this to work and am thinking it may be beacuse of file permissions?

    -----EDIT - I have indeed now changed the ownership & permissions of the script (to 755 as per the other shell scripts which are in the /home/tc/ location)

    below is the sbpd command that I'm trying to run (copied from Page 1 of this thread: GPIO pins 23 and 24 running rotary encoder and 25 for a play/pause button) HOWEVER, when I execute it I lose sound!

    sbpd -d -s e,23,24,VOLM,0 b,25,PLAY,1

    any ideas where I'm going wrong? (apoloigies in advance: I'm a bit of a noob!)


    thanks,
    Paul
    Last edited by jedisha; 2021-02-21 at 14:34. Reason: development

  5. #385
    Junior Member
    Join Date
    Jan 2021
    Posts
    18
    ^^

    My experience with this tool has only been a few hours total, so noob.

    But maybe try passing the -t 1 or -t 0 parameters to pigpiod. I believe there's a conflict with your HAT.

    Just search in the thread for the posts...

    Code:
    pigpiod -t 0 or pigpiod -t 1
    I forget which one applies to HATs. I believe one applies to onboard audio, one to HAT.

    So even if you follow the steps to a tee, everyone's audio requirements differ.

    GL
    Last edited by LiFePO4; 2021-02-21 at 23:00.

  6. #386
    Junior Member
    Join Date
    Feb 2021
    Posts
    5

    pigpio daemon seems to kill audio output... please help!

    Dear all,

    I've been trying somewhat in vain over the last few days to try and get SqueezeButtonPi daemon working on my PiZeroW (and iQaudio PiDIGI AMP+).

    The aim is nothing crazy - just a rotary encoder with one push-button to give volume dial + play/pause button controls to pcp.

    I've installed pcp-sbpd.tcz on pcp 7.0.0 and have created sbpd-script.sh (as per a previous post from @chill).

    I'm trying to get the following commands to function:

    Code:
    sbpd -d -s e,23,24,VOLU,0 b,5,PLAY,1
    However when sbpd-script.sh is executed the audio cuts out entirely and I can't seem to get anything out of it unless I reboot (the Pi doesn't crash or anything) Please see below for the script:

    Code:
    #!/bin/sh
    
    # start pigpiod daemon
    
    pigpiod
    
    # give the daemon a moment to start up before issuing the sbpd command
    
    sleep 1
    
    # load uinput module, then set the permission to group writable, so you don't need to run s>
    
    sudo modprobe uinput
    
    sudo chmod g+w /dev/uinput
    
    # issue the sbpd command
    
    # This command will cause encoder to move selection right or left; Press=Enter; long press=>
    
    sbpd -d -s e,23,24,VOLU,0 b,5,PLAY,1
    When I created sbpd-script.sh I changed ownership to user 'tc' and changed it's permissions to 755 (to mirror the other shell scripts within the /home/tc/ location)

    Name:  sbpd-cli.png
Views: 233
Size:  11.6 KB

    Also, please see screengrab below for my Squeezelite settings (I believe I've correctly switched volume control to '-V Digital' so as to control the Alsa volume settings with a rotary encoder... or could this be one issue?)

    Name:  squeexelite-settings.png
Views: 232
Size:  68.2 KB

    This evening I've noticed that it's when the
    Code:
    pigpiod
    command is called that the audio cuts out. Do I need to configure pigpio ?

    I'm clearly out of my depth, but would love to get this working, so any help HUGELY appreciated, and if there's any further info which may help solve this then do let me know and I'll supply!


    thanks so much guys!
    Paul

  7. #387
    Junior Member
    Join Date
    Feb 2021
    Posts
    5
    Quote Originally Posted by LiFePO4 View Post
    ^^

    My experience with this tool has only been a few hours total, so noob.

    But maybe try passing the -t 1 or -t 0 parameters to pigpiod. I believe there's a conflict with your HAT.

    Just search in the thread for the posts...

    Code:
    pigpiod -t 0 or pigpiod -t 1
    I forget which one applies to HATs. I believe one applies to onboard audio, one to HAT.

    So even if you follow the steps to a tee, everyone's audio requirements differ.

    GL

    @LiFePO4 - so sorry, I just added a post and completely missed your reply to my earlier post - I'll look into this right now! Thanks so much for the reply!

    Paul

  8. #388
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    3,977
    Which physical pins have you connected wires to?
    I ask because there is always the chance of confusion with pin numbers.
    See https://pinout.xyz/
    Paul Webster
    http://dabdig.blogspot.com
    Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland

  9. #389
    Junior Member
    Join Date
    Jan 2021
    Posts
    7
    Hi,

    I'm using RPI 3B+, HiFiBerry AMP2 HA. I'v only installed pcp-sbpd.tct with no settings and not running any command. I get sound from AMP2. But if I run sudo pigpiod, no sound comes from AMP2.

    Some help please...
    Last edited by armaster; 2021-03-05 at 10:12.

  10. #390
    @armaster,

    post #385 might be useful in your case.

Posting Permissions

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