Home of the Squeezebox™ & Transporter® network music players.
Page 43 of 45 FirstFirst ... 334142434445 LastLast
Results 421 to 430 of 444
  1. #421
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    4,588
    All kinds of things you can do with software. This tool was just not written that way.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  2. #422
    Junior Member
    Join Date
    Apr 2019
    Posts
    12
    Quote Originally Posted by Turner1200 View Post
    For this project, I really want to preserve the outside and interface of the old radio. While this means in principle keeping the non-momentary original switches (buttons), you make we wonder if there is an indirect way to have the non-momentary switches activate a second set of momentary switches on their way to the GPIO pins, maybe through a time delay circuit or relay? I’ll have to do some reading.

    On the software side, I wonder if I could modify the code that monitors the pins to register a button push if a connection is made via my non-momentary button. It could fire after a fixed time delay if the signal is maintained on specified pin. After a longer delay, if there was no further activity, the pin could be reset so it’s not left floating. Any thoughts on which portion of the source code I would need to look at?

    Alternatively, maybe I could take the idea of a delay / second button and execute it in software. Maybe a script that reacts to a change on pin 1, triggered by my mechanical non-momentary switch, and then momentarily flips a second pin on and off on the Pi, which sbpd could interpret as a button push?

    I’ll try and work through a few possibilities and share any results.


    Hello Turner1200,

    i faced the same problem when i wanted to rebuild an old cassette recorder with pcp.
    Last but not least, I used gpiozero and LMSTools to control toggle style switches and rotary encoders.
    This combination works very well with pcp and is relatively easy to implement.
    If you need some advice i can help.

    Greetings

  3. #423

    Capacitive touch

    I now have a https://www.adafruit.com/product/1374 capacitive touch connected to pin 20 and have set both resist and pressed to 1 as the output goes high when activated. Is this correct?

  4. #424
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    4,588
    Depends on how you have the software configured. But those button output voltage when pressed.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  5. #425
    Quote Originally Posted by paul- View Post
    Depends on how you have the software configured. But those button output voltage when pressed.
    This works:
    sbpd -v b,20,POWR,0,1

    Now I can turn it on/off just by touching the body of the player.
    Name:  squeeze.jpg
Views: 240
Size:  219.5 KB
    Last edited by mfraser; 2021-10-26 at 23:52.

  6. #426
    Junior Member
    Join Date
    Apr 2017
    Posts
    6
    Hello,

    i have this rotary encoder KY040 or KY-040:
    Name:  s-l500.jpg
Views: 170
Size:  23.0 KB
    there are 5 connectors: CLK, DT, SW, + and GND

    GND to GND
    SW (Switch) like an button to a GPIO, so i can use the rotary encoder as button, when pressed in the middle.

    now i have 3 left: CLK, DT and +
    can someone give me a hint how to connect this one to the raspberry to use with sbpd?

    [edit]
    ok i tried and it works:
    + is 3V3
    CLK is PIN1
    DT is PIN2

    so my command is now:
    sbpd b,22,PLAY e,24,25,VOLU
    Last edited by Besth; 2021-11-22 at 08:03.

  7. #427
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    4,588
    The other pins are for the push button on the stem of the encoder. You can connect that to GPIO and do something else.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  8. #428
    Hi all,

    so I tried to do this wonderful thing to add a rotary encoder connected to the gpio to control the volume. And... all my attempts failed. I read the thread like millions times.
    First of all mega noobs about command lines etc... but i did my best.

    The material;
    Raspberry pi A+
    PiFi DAC+ v2.0 (set as Hifiberry DAC+ and works like a charm) > gpio 18 to 21 are used by the DAC.
    A micro embedded electronic HAT which allowed to use 3 sets of all the GPIO pins.
    Everything is working and I have sound and all.
    Rotary encoder KY040 : gnd to gnd , + to 3.3V, sw to 26, dt to 23 and clk to 24

    I created a script.sh in home/tc
    Code:
    #!/bin/sh
    
    # start pigpiod daemon
    
    pigpiod -t 0 -f -l -s 10
    
    # 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 for volume and play pause
    
    sbpd e,23,24,VOLU,2
    b,26,PAUS,2,0,STOP,500
    did the
    Code:
    chmod 755 script.sh
    when I started my script no more sound.
    So I rebbot and digged a little bit. When I started pigpiod > no sound any more.
    and I can't figure why

    I started sbpd just to check and I have that
    Name:  Capture d’écran 2021-12-12 182605.png
Views: 76
Size:  49.1 KB

    Any help will be appreciated.

    Thank you for your time and making/maintaining picoreplayer

    Edit: removed the DAC hat, removed the gpio multiplier, removed the script and use the CLI instead. Works fine now.
    Code:
    pigpiod -t 1 -f -l -s 10;sleep 1;modprobe uinput;chmod g+w /dev/uinput;sbpd e,24,25,VOLU,2 b,22,PLAY
    I will try later (and have time) to try again with the DAC.
    Last edited by Themightybob; 2021-12-16 at 13:45.

  9. #429
    Junior Member
    Join Date
    Dec 2021
    Posts
    6

    TRAC command works only forward

    Hi all,
    I have successfully installed this great plugin in my piCoreplayer and the encoder works. However works only "next track".
    I use this command:
    Code:
    sbpd e,6,5,TRAC,1 b,7,PLAY
    My config is:
    Raspberry Pi 4B
    Encoder module KY-040: CLK GPIO5 - DT GPIO6 - SW GPIO7
    piCorePlayer version: 8.1.0
    piCore version: 13.1
    Squeezelite v1.9.9-1391-pCP
    Jivelite
    Thank you for your help

  10. #430
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    4,588
    Well then tell it to use VOLU instead of TRAC


    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.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

Posting Permissions

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