Home of the Squeezebox™ & Transporter® network music players.
Page 40 of 40 FirstFirst ... 30383940
Results 391 to 397 of 397
  1. #391
    Junior Member
    Join Date
    Jan 2021
    Posts
    7
    @jd68,

    Thanks for the hint. I replaced sudo pigpiod with sudo pigpiod -t 0 -f -l -s 10 and it works now with HifiBerry AMP2 HAT. Many thanks!

  2. #392
    Senior Member wtnh's Avatar
    Join Date
    Mar 2010
    Location
    US - East Coast
    Posts
    104
    Quote Originally Posted by jedisha View Post
    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
    Sorry I did not see this sooner - yes, you need to:
    Code:
    chmod 755 sbpd-script.sh
    but it looks like you figured it out anyway. Posting this so others can see it.

  3. #393
    Junior Member
    Join Date
    Mar 2007
    Posts
    29
    Hi,

    i have this rotary encoder AZDelivery KY-040(https://www.amazon.de/gp/product/B07...?ie=UTF8&psc=1) and i conneted
    GND to PIN 25
    + to PIN 1
    SW to PIN 29 (GPIO 5)
    DT to PIN 37 (GPIO 26)

    I startet the Raspberry and then on the command line

    sudo pigpiod ;sleep 0.1; sbpd -v e,5,6,VOLU

    I did not understand the output.

    This is from 360 degrees clockwise
    Code:
    1618346983.1665 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618346983.1666 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618346983.2913 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618346983.2914 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    1618346986.5124 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618346986.5125 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618346986.6295 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618346986.6296 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    1618346988.9477 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618346988.9478 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618346989.0702 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618346989.0703 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    1618346989.7868 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618346989.7869 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618346989.9057 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618346989.9058 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    1618346992.5239 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618346992.5240 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618346992.6579 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618346992.6580 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    This is from 360 degrees counterclockwise
    Code:
    1618347228.6224 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618347228.6225 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618347228.8504 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618347228.8505 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    1618347230.7757 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618347230.7758 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618347231.0925 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618347231.0926 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    1618347231.6107 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618347231.6107 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618347231.7284 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618347231.7285 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    1618347232.2450 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618347232.2451 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618347232.3634 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618347232.3635 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    1618347232.7802 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618347232.7803 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618347232.8961 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618347232.8961 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    1618347234.6137 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618347234.6138 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618347234.7321 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618347234.7322 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    1618347235.0551 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618347235.0552 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618347235.1712 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618347235.1713 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    1618347236.3872 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618347236.3873 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618347236.5050 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618347236.5051 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    1618347236.9231 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618347236.9232 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618347237.0396 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618347237.0397 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    1618347237.4572 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618347237.4573 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618347237.5723 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618347237.5724 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    1618347237.9889 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618347237.9890 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618347238.1056 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618347238.1057 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    1618347239.0229 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618347239.0230 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618347239.1391 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618347239.1392 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    1618347239.4549 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618347239.4550 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618347239.5706 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618347239.5707 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    1618347239.8868 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618347239.8869 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618347239.9989 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618347239.9990 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    1618347240.9172 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618347240.9173 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618347241.0346 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618347241.0346 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    1618347241.5519 6 control.c,466: Encoder on GPIO 26, 5 - value: -2, detents: -2, change: -1
    1618347241.5520 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1618347241.6681 6 control.c,466: Encoder on GPIO 26, 5 - value: -1, detents: -1, change: 1
    1618347241.6682 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    First: clockwise are 20 lines, counterclockwise are 64 lines
    Second: The command changes by every Signal one time +1 and one time -1 what results in no change of Volume

    It is equal if i use pigpiod -t 0 or -t 1

    Does anyone have an idea whats wrong
    Thanks,
    sky

  4. #394
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    3,993
    Unhook the + terminal and try it. I've only ever used 3 pin encoders. Gnd, and 2 gpio's.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  5. #395
    Junior Member
    Join Date
    Mar 2007
    Posts
    29
    Hi,

    that changes something, but it doesn't really work. Most of the time the value is just increased. The counterclockwise values are only reduced after a few attempts. When I connect a third GPIO and start sbpd with e and b, I often get play or pause commands when turning. Normally I would say that the rotary encoder is possibly defective, but I have 3 of them here and the behavior is the same for all three.

    best regards,
    sky

  6. #396
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    3,993
    I would suspect the design of the encoder, but Iĺm not sure. Several users are using 3pin encoders just fine.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  7. #397
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Location
    Nottingham, UK
    Posts
    2,095
    Quote Originally Posted by skywalker View Post
    Hi,

    i have this rotary encoder AZDelivery KY-040(https://www.amazon.de/gp/product/B07...?ie=UTF8&psc=1) and i conneted
    GND to PIN 25
    + to PIN 1
    SW to PIN 29 (GPIO 5)
    DT to PIN 37 (GPIO 26)
    I have the same encoder. It works properly for volume control, and I have the central push button configured for play/pause.

    I have it connected as follows:
    GND to pin 6 (GND, so your pin 25 should also be fine)
    + to pin 1 (3V3)
    SW to pin 37 (GPIO26: SW is the pin for the central push button)
    DT to pin 38 (GPIO20: DT is one of the pins for the rotary function)
    CLK to pin 40 (GPIO21: CLK is the other pin for the rotary function)

    With these connections I use the following sbpd commands:
    e,21,20,VOLU,2
    b,26,PAUS,2,0,STOP,500

    I use pigpiod -t 0 -f -l -s 10

Posting Permissions

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