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

    #16
    Originally posted by paul- View Post
    What is the other side of the button connected to? I played with this over the weekend and couldn't get it to respond. Are you pulling up or pulling down?
    Up. Just connect the common pin of the encoder to ground (for the encoders I've seen it's the central pin of the three encoder pins)
    ---
    learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
    Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
    at penguinlovesmusic.com
    New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch

    Comment


      #17
      Originally posted by pippin View Post
      Up. Just connect the common pin of the encoder to ground (for the encoders I've seen it's the central pin of the three encoder pins)
      Same for buttons then.....all of my buttons are wired the other way.
      piCorePlayer a small player for the Raspberry Pi in RAM.
      Homepage: https://www.picoreplayer.org

      Please donate if you like the piCorePlayer

      Comment


        #18
        Which other way? Against 3.3V?
        Do I need to add another configuration option for that?
        Last edited by pippin; 2017-03-03, 04:28.
        ---
        learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
        Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
        at penguinlovesmusic.com
        New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch

        Comment


          #19
          Originally posted by mherger View Post
          The German distributor linked from the Pi website claims to have them.
          But then I've only seen bundles, like the 800EU bundle for schools...
          but not the computer alone.
          They have it, just their web site is a mess... It's on page 2 of the "Pi and stuff" category
          This is the direct link:
          Kaufen Sie Raspberry Pi 4, Raspberry Pi Zero und Zero W. Zubehör für Pi Zero und Raspberry Pi 4. Komplette Kits für Raspberry Pi Boards. Raspberry Pi 3B+ / 3B / 2 / 1B+. Pimoroni. Adafruit. Arduino. Und viel mehr


          You then explicitly have to select a different bundle to only get the Pi without all the other stuff. Because if you select "Pi only" you of course by default want to buy a case and a bag full of connectors...

          But it's possible, I just ordered just the pi0W, let's see whether I also get it...
          ---
          learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
          Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
          at penguinlovesmusic.com
          New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch

          Comment


            #20
            Originally posted by pippin View Post
            Which other way? Against 3.3V?
            Do I need to add another configuration option for that?
            Yes, its just the way alot of industrial controls are wired to PLC's. No big deal. I can change that.

            The odd thing is that interrupts don't seem to fire. I've compiled the interrupt example in wiringpi, and that works fine.

            sudo sbpd -d b,25,PLAY,1

            When I trigger GPIO 25, I can see the state change in the gpio, .....but no command is sent to the server.
            piCorePlayer a small player for the Raspberry Pi in RAM.
            Homepage: https://www.picoreplayer.org

            Please donate if you like the piCorePlayer

            Comment


              #21
              Have you tried b,25,PLAY,2
              ---
              learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
              Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
              at penguinlovesmusic.com
              New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch

              Comment


                #22
                Originally posted by pippin View Post
                Have you tried b,25,PLAY,2
                Same result. I change to verbose output, not sure if that will give you anything. All I see is the discover messages. I also have a listener setup on the server, and there is nothing coming into the server.

                Code:
                [email protected]:~$ sudo sbpd -v b,25,PLAY,2
                1488516296.7135 6 GPIO.c,219: Initializing GPIO
                1488516296.7214 6 control.c,135: Button defined: Pin 25, Edge: rising, Fragment:
                ["pause"]
                1488516296.7215 6 discovery.c,379: MAC address found: b8:27:eb:d9:dd:e
                1488516296.7215 6 servercomm.c,146: Initializing CURL
                1488516296.7283 6 sbpd.c,217: Starting main loop polling
                1488516296.7286 7 discovery.c,191: /proc/net/tcp line:    0: 00000000:0050 00000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 21122 1 b1798600 100 0 0 10 0
                
                1488516296.7287 7 discovery.c,196: target: 00000000:0000
                
                1488516296.7287 7 discovery.c,191: /proc/net/tcp line:    1: 00000000:0016 00000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 20499 1 b1798000 100 0 0 10 0
                
                1488516296.7287 7 discovery.c,196: target: 00000000:0000
                
                1488516296.7287 7 discovery.c,191: /proc/net/tcp line:    2: 1500A8C0:E782 8C00A8C0:01BD 01 00000000:00000000 00:00000000 00000000     0        0 44496 1 b179c800 21 4 30 10 -1
                
                1488516296.7288 7 discovery.c,196: target: 8C00A8C0:01BD
                
                1488516296.7288 7 discovery.c,191: /proc/net/tcp line:    3: 1500A8C0:B47E 8D00A8C0:2328 01 00000000:00000000 00:00000000 00000000     0        0 39091 1 af03aa00 21 4 28 10 7
                
                1488516296.7288 7 discovery.c,196: target: 8D00A8C0:2328
                
                1488516296.7288 7 discovery.c,191: /proc/net/tcp line:    4: 1500A8C0:0016 8D00A8C0:A269 01 00000070:00000000 02:00086DF7 00000000     0        0 40259 4 b179bc00 21 4 23 10 16
                
                1488516296.7288 7 discovery.c,196: target: 8D00A8C0:A269
                
                1488516296.7290 7 discovery.c,191: /proc/net/tcp line:    5: 1500A8C0:0016 8D00A8C0:D649 01 00000000:00000000 02:0008DDF7 00000000     0        0 48420 2 b179b000 21 4 29 10 -1
                
                1488516296.7290 7 discovery.c,196: target: 8D00A8C0:D649
                
                1488516296.7290 7 discovery.c,191: /proc/net/tcp line:    6: 1500A8C0:E00C 8D00A8C0:0D9B 01 00000000:00000000 00:00000000 00000000     0        0 38430 1 b1798c00 21 4 31 10 7
                
                1488516296.7290 7 discovery.c,196: target: 8D00A8C0:0D9B
                
                1488516296.7290 6 discovery.c,234: Found server 8D00A8C0. A new address
                1488516296.7291 6 discovery.c,242: Found server 8D00A8C0. Same as before
                1488516296.7292 7 discovery.c,104: New or changed server address found
                1488516296.7293 7 discovery.c,127: Looking for port
                1488516296.7293 7 discovery.c,314: Server discovery: no reply, yet
                1488516296.8294 7 discovery.c,127: Looking for port
                1488516296.8295 7 discovery.c,318: Server discovery: packet found
                1488516296.8295 6 discovery.c,343: discovery packet: port: 9000, name: NUC-Devel, uuid: d6d706ce-3908-479c-8158-5c9058697319
                1488516296.8296 6 discovery.c,130: Squeezebox control port found: 9000
                1488516296.8296 6 discovery.c,149: Server address found: 192.168.0.141
                1488516299.8319 7 discovery.c,191: /proc/net/tcp line:    0: 00000000:0050 00000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 21122 1 b1798600 100 0 0 10 0
                
                1488516299.8320 7 discovery.c,196: target: 00000000:0000
                
                1488516299.8320 7 discovery.c,191: /proc/net/tcp line:    1: 00000000:0016 00000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 20499 1 b1798000 100 0 0 10 0
                
                1488516299.8321 7 discovery.c,196: target: 00000000:0000
                
                1488516299.8321 7 discovery.c,191: /proc/net/tcp line:    2: 1500A8C0:E782 8C00A8C0:01BD 01 00000000:00000000 00:00000000 00000000     0        0 44496 1 b179c800 21 4 30 10 -1
                
                1488516299.8321 7 discovery.c,196: target: 8C00A8C0:01BD
                
                1488516299.8321 7 discovery.c,191: /proc/net/tcp line:    3: 1500A8C0:B47E 8D00A8C0:2328 01 00000000:00000000 00:00000000 00000000     0        0 39091 1 af03aa00 21 4 28 10 7
                
                1488516299.8321 7 discovery.c,196: target: 8D00A8C0:2328
                
                1488516299.8322 7 discovery.c,191: /proc/net/tcp line:    4: 1500A8C0:0016 8D00A8C0:A269 01 00000000:00000000 02:00086CC1 00000000     0        0 40259 2 b179bc00 21 4 1 10 16
                
                1488516299.8322 7 discovery.c,196: target: 8D00A8C0:A269
                
                1488516299.8323 7 discovery.c,191: /proc/net/tcp line:    5: 1500A8C0:0016 8D00A8C0:D649 01 00000000:00000000 02:0008DCC1 00000000     0        0 48420 2 b179b000 21 4 29 10 -1
                
                1488516299.8323 7 discovery.c,196: target: 8D00A8C0:D649
                
                1488516299.8323 7 discovery.c,191: /proc/net/tcp line:    6: 1500A8C0:E00C 8D00A8C0:0D9B 01 00000000:00000000 00:00000000 00000000     0        0 38430 1 b1798c00 21 4 31 10 7
                
                1488516299.8324 7 discovery.c,196: target: 8D00A8C0:0D9B
                
                1488516299.8324 6 discovery.c,242: Found server 8D00A8C0. Same as before
                1488516299.8325 7 discovery.c,104: New or changed server address not found
                piCorePlayer a small player for the Raspberry Pi in RAM.
                Homepage: https://www.picoreplayer.org

                Please donate if you like the piCorePlayer

                Comment


                  #23
                  I have to admit I didn't test too much beyond my own use case, I did have some experiments running early on with different edge configurations but only tested the final version with the one I actually used, which is the one above.
                  Using the rising edge gave me too much chatter, that's why i used the falling one, both worked, too, but I don't exactly remember the behavior for rising.

                  I'll set up another test device over the weekend and play around a bit with different configurations.

                  Regarding the 3.3V... my main issue with that was that I didn't want to recommend it because it's so easy to do wrong.
                  I've got bad memories from that "how-to" about connecting the 7"-display using power from the GPIO connector on the HiFiBerry board which you can find everywhere on the Internet and which tried to get ground from one of the GPIO pins...
                  ---
                  learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
                  Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
                  at penguinlovesmusic.com
                  New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch

                  Comment


                    #24
                    Originally posted by pippin View Post
                    I have to admit I didn't test too much beyond my own use case, I did have some experiments running early on with different edge configurations but only tested the final version with the one I actually used, which is the one above.
                    Using the rising edge gave me too much chatter, that's why i used the falling one, both worked, too, but I don't exactly remember the behavior for rising.

                    I'll set up another test device over the weekend and play around a bit with different configurations.
                    For what it's worth, I've tried rpi3, and rpi2 rev 1.2

                    Regarding the 3.3V... my main issue with that was that I didn't want to recommend it because it's so easy to do wrong.
                    I've got bad memories from that "how-to" about connecting the 7"-display using power from the GPIO connector on the HiFiBerry board which you can find everywhere on the Internet and which tried to get ground from one of the GPIO pins...
                    All in what you are used to.....but i guess it's easier to find ground..... lol.
                    piCorePlayer a small player for the Raspberry Pi in RAM.
                    Homepage: https://www.picoreplayer.org

                    Please donate if you like the piCorePlayer

                    Comment


                      #25
                      Originally posted by paul- View Post
                      Same result. I change to verbose output, not sure if that will give you anything. All I see is the discover messages. I also have a listener setup on the server, and there is nothing coming into the server.
                      Hm, doesn't seem to fire, indeed.
                      You are using BCM 25 (pin 22 on the connector), right?
                      ---
                      learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
                      Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
                      at penguinlovesmusic.com
                      New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch

                      Comment


                        #26
                        Originally posted by pippin View Post
                        Hm, doesn't seem to fire, indeed.
                        You are using BCM 25 (pin 22 on the connector), right?
                        Uhhm, no GPIO25, pin 35

                        I just looked at GPIO.c Your using the GPIO pin numbering
                        Code:
                        void init_GPIO() {
                            loginfo("Initializing GPIO");
                            wiringPiSetupGpio() ;
                        }
                        So I changed to pin 22, and it fires. That makes no sense.

                        Now for the next problem
                        Code:
                        1488517174.3631 6 control.c,148: Button pressed: Pin 25
                        1488517174.3632 7 servercomm.c,111: Server ::192.168.0.141:9000 command: {"id":1,"method":"slim.request","params":["b8:27:eb:d9:dd:e",["button","power"]]}
                        * Connecting to hostname: 192.168.0.141
                        * Connecting to port: 9000
                        * Connection 0 seems to be dead!
                        * Closing connection 0
                        *   Trying 192.168.0.141...
                        * TCP_NODELAY set
                        * Connected to 192.168.0.141 (192.168.0.141) port 9000 (#1)
                        > POST /jsonrpc.js HTTP/1.1
                        Host: localhost
                        Accept: */*
                        Content-Type: application/json
                        User-Agent: SqueezeButtonPi/1.0)
                        Content-Length: 81
                        
                        * upload completely sent off: 81 out of 81 bytes
                        * Empty reply from server
                        * Connection #1 to host 192.168.0.141 left intact
                        1488517174.3666 7 servercomm.c,121: Curl result: 52
                        piCorePlayer a small player for the Raspberry Pi in RAM.
                        Homepage: https://www.picoreplayer.org

                        Please donate if you like the piCorePlayer

                        Comment


                          #27
                          Originally posted by paul- View Post
                          Uhhm, no GPIO25, pin 35
                          pin 35 is BCM 19, wiringPi 24

                          These different numbering schemes make little sense but since the Broadcom scheme seems to be the only one consistent across connectors and most commonly used it's what I used.
                          Please forget about that wiringPi scheme, that's an obscure scheme and I don't want people who've never used wiringPi to have to learn about it.

                          I just looked at GPIO.c Your using the GPIO pin numbering
                          Code:
                          void init_GPIO() {
                              loginfo("Initializing GPIO");
                              wiringPiSetupGpio() ;
                          }
                          So I changed to pin 22, and it fires. That makes no sense.
                          Sure. Pin 22 is BCM 25.

                          Now for the next problem
                          What problem?

                          If you mean all that curl output: forget about that, it just reflects what libCurl is doing internally, all is fine, it will handle this, cache routes found etc. Nothing to see here...
                          It's the price of enabling "verbose" mode
                          ---
                          learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
                          Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
                          at penguinlovesmusic.com
                          New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch

                          Comment


                            #28
                            Originally posted by pippin View Post
                            Sure. Pin 22 is BCM 25.
                            I just read the setup command wrong. The sad thing is that we use the same numbering in squeezelite.......Oh well.

                            What problem?

                            If you mean all that curl output: forget about that, it just reflects what libCurl is doing internally, all is fine, it will handle this, cache routes found etc. Nothing to see here...
                            It's the price of enabling "verbose" mode
                            Nothing happened with my player. I tried both the PLAY and POWR command. But I'm getting tired, I may have done something else stupid. Let me take a fresh look at everything tomorrow.
                            piCorePlayer a small player for the Raspberry Pi in RAM.
                            Homepage: https://www.picoreplayer.org

                            Please donate if you like the piCorePlayer

                            Comment


                              #29
                              Originally posted by paul- View Post
                              Nothing happened with my player. I tried both the PLAY and POWR command. But I'm getting tired, I may have done something else stupid. Let me take a fresh look at everything tomorrow.
                              Hm, this is the power command, do you get similar results with "PLAY"?
                              ---
                              learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
                              Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
                              at penguinlovesmusic.com
                              New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch

                              Comment


                                #30
                                Originally posted by paul- View Post
                                Ordered mine this afternoon. Supposedly in stock.

                                Ralphy, we should talk about moving wiringpi to dynamic linked....I was going to submit 2.39 to the repo last weekend. Man it's hard to keep up sometimes, I'll repack the 2.42 this weekend.

                                I would keep libcurl and it's dependencies static for now.
                                Agreed. Then we can move sbpd.tcz into the repo with the next update.
                                Ralphy

                                1-Touch, 5-Classics, 3-Booms, 2-UE Radio
                                Squeezebox client builds donations always appreciated.

                                Comment

                                Working...
                                X