Home of the Squeezebox™ & Transporter® network music players.
Page 10 of 11 FirstFirst ... 891011 LastLast
Results 91 to 100 of 109
  1. #91
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    568
    Quote Originally Posted by paul- View Post
    Let me look at doing a configuration file for commands.
    That would be great, thank you. This tool has inspired me have a more serious go at integrating a pCP inside my amplifier.

    I've been tweaking my PCB design so that it will connect to the RPi either as a hat (should just about fit inside the official Pi3B case, or remotely via a ribbon cable. When attached directly as a hat, and mounted behind the amplifier front panel, it will also give me a convenient place to mount the RPi inside the enclosure.

    Here's my current draft of the PCB. The idea is that you'd connect each switch to a suitable GPIO pin using the 'GPIO Pins' and 'Switch Pins' pads, either by mounting rows of header pins and using jumper wires, or for a fixed installation they could be connected permanently by soldered flyleads. the prodtruding 'tongue' would carry a ribbon cable connector to allow other devices, such as a DAC, to be daisy-chained, or I might make it a snap-off section so that the whole board fits entirely withing the RPi case.


    And here are a couple of photos of a 3D printed mockup - the buttons will sit a bit higher, on top of the PCB, so should end up just above the top surface of the RPi case.


    Last edited by chill; 2018-04-14 at 05:36.

  2. #92

    multiple buttons being sensed

    I installed pcp-sbpd and it seemed to not be working right. To figure out what was happening I ran sbpd in debug mode -v.
    the output seems to me to be saying that there are multiple buttons being pressed. here is the output:
    Code:
    1524798970.1715 6 discovery.c,242: Found server 0201A8C0. Same as before
    1524798973.2751 6 discovery.c,242: Found server 0201A8C0. Same as before
    1524798976.1158 6 GPIO.c,99: Long PRESS: 85586035
    1524798976.1160 6 control.c,106: Button CB set for button 1
    
    1524798976.1160 6 GPIO.c,99: Long PRESS: 85586035
    1524798976.1161 6 control.c,106: Button CB set for button 2
    
    1524798976.1161 6 GPIO.c,99: Long PRESS: 85586035
    1524798976.1162 6 control.c,106: Button CB set for button 3
    
    1524798976.1781 6 control.c,217: Button pressed: Pin: 27, Press Type:Long
    1524798976.1782 6 control.c,217: Button pressed: Pin: 22, Press Type:Long
    1524798976.1783 6 control.c,217: Button pressed: Pin: 23, Press Type:Long
    1524798976.3368 6 GPIO.c,104: Short PRESS: 221
    1524798976.3369 6 control.c,106: Button CB set for button 0
    
    1524798976.3370 6 GPIO.c,99: Long PRESS: 85586256
    1524798976.3370 6 control.c,106: Button CB set for button 1
    
    1524798976.3371 6 GPIO.c,99: Long PRESS: 85586256
    1524798976.3371 6 control.c,106: Button CB set for button 2
    
    1524798976.3372 6 GPIO.c,99: Long PRESS: 85586256
    1524798976.3372 6 control.c,106: Button CB set for button 3
    
    1524798976.3790 6 discovery.c,242: Found server 0201A8C0. Same as before
    1524798976.3793 6 control.c,217: Button pressed: Pin: 17, Press Type:Short
    1524798976.3793 6 servercomm.c,74: Send Command:0, Fragment:["pause"]
    
    1524798976.3955 6 control.c,217: Button pressed: Pin: 27, Press Type:Long
    1524798976.3962 6 control.c,217: Button pressed: Pin: 22, Press Type:Long
    1524798976.3963 6 control.c,217: Button pressed: Pin: 23, Press Type:Long
    1524798979.4999 6 discovery.c,242: Found server 0201A8C0. Same as before
    1524798982.6040 6 discovery.c,242: Found server 0201A8C0. Same as before
    but when I test if there is anything wrong with the buttons using gpio -g read 17 etc... only one button is really detected.

    Is this a problem in the code?

  3. #93
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    568
    Quote Originally Posted by foxsam View Post
    I installed pcp-sbpd and it seemed to not be working right.
    How long ago did you do the installation? Paul provided a nice update on 23rd April, which now seems to cope with multiple buttons, short and long presses, the option to define any number of new commands in a config file, and the option to call a script file from a button press. It's working very nicely on my RPi. Perhaps you could do an update to make sure you have this latest version.

  4. #94
    Quote Originally Posted by chill View Post
    How long ago did you do the installation? Paul provided a nice update on 23rd April, which now seems to cope with multiple buttons, short and long presses, the option to define any number of new commands in a config file, and the option to call a script file from a button press. It's working very nicely on my RPi. Perhaps you could do an update to make sure you have this latest version.
    I installed it after that update. Just to be sure it was not a question of out of date code before i posted I removed the old binary and tcz file etc.. backed up and rebooted and reinstalled from extensions button on webpage.
    I also took the pizero w out of its case and examined all the solder connections under magnification to be sure its not a physical problem (that I can see at least...)

    <begin edit>
    Just to be clear. I am trying to use the long-press feature also but I end up getting confliting commands sent at the same time because it is getting long press and short presses all together.

    The original output did not really show how this was causing a problem because I ran sbpd without any long press options but I am posting output that contains a longer log with the actual conflicting commands being sent.

    http://termbin.com/4l46 is the output of the command:

    Code:
    sbpd b,17,PSE1,2,0,PLAY,600 b,27,MIX+,2,0,MXHI,1100 b,22,MIX-,2,0,MXLW,1100 b,23,PSE1 -f /home/tc/sbpd_commands.cfg  -v >
    and http://termbin.com/ivff is the sbpd_commands.cfg file.
    Last edited by foxsam; 2018-04-27 at 07:11. Reason: Added clarification.

  5. #95
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    568
    This is odd - I'm now seeing the same behaviour. I could have sworn it was all working perfectly before....very odd....

    Anyway, with a simple command line, setting up short presses on two buttons, I get multiple commands firing when I short-press button 23 once:

    My command line: sbpd -v -f /home/tc/sbpd_commands.cfg b,23,PREV,2,0 b,13,NEXT,2,0

    Sample verbose output:

    Code:
    1524912292.6042 6 sbpd.c,336: Options parsing: Setting command config file to /home/tc/sbpd_commands.cfg
    .
    .
    1524912292.6045 6 sbpd.c,490: name=PREV, value=["button","rew"]
    1524912292.6045 6 control.c,75: Adding Command PREV: Fragment ["button","rew"]
    1524912292.6045 6 sbpd.c,490: name=NEXT, value=["button","fwd"]
    1524912292.6046 6 control.c,75: Adding Command NEXT: Fragment ["button","fwd"]
    .
    .
    1524912292.6049 6 GPIO.c,255: Initializing GPIO
    1524912292.6145 6 control.c,203: Button defined: Pin 23, BCM Resistor: up, Short Type: LMS, Short Fragment: ["button","rew"] , Long Type: unused, Long Fragment: (null), Long Press Time: 3000
    1524912292.6248 6 control.c,203: Button defined: Pin 13, BCM Resistor: up, Short Type: LMS, Short Fragment: ["button","fwd"] , Long Type: unused, Long Fragment: (null), Long Press Time: 3000
    .
    .
    1524912295.7383 6 discovery.c,242: Found server 0B01A8C0. Same as before
    1524912297.1502 6 GPIO.c,99: Long PRESS: 198907070
    1524912297.1503 6 control.c,106: Button CB set for button 1
    
    1524912297.2396 6 control.c,217: Button pressed: Pin: 13, Press Type:Long
    1524912297.2668 6 GPIO.c,99: Long PRESS: 198907186
    1524912297.2669 6 control.c,106: Button CB set for button 1
    
    1524912297.2669 6 GPIO.c,104: Short PRESS: 116
    1524912297.2669 6 control.c,106: Button CB set for button 0
    
    1524912297.2670 6 GPIO.c,99: Long PRESS: 198907186
    1524912297.2670 6 control.c,106: Button CB set for button 1
    
    1524912297.2670 6 GPIO.c,99: Long PRESS: 198907187
    1524912297.2670 6 control.c,106: Button CB set for button 0
    
    1524912297.2671 6 GPIO.c,99: Long PRESS: 198907187
    1524912297.2671 6 control.c,106: Button CB set for button 1
    
    1524912297.3398 6 control.c,217: Button pressed: Pin: 23, Press Type:Long
    1524912297.3399 6 control.c,217: Button pressed: Pin: 13, Press Type:Long

  6. #96
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    1,248
    Let me take a look. The time pressed reported in the gpio.c line is very long....
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://sites.google.com/site/picoreplayer/home

    Please donate if you like the piCorePlayer

  7. #97
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    568
    Quote Originally Posted by paul- View Post
    Let me take a look. The time pressed reported in the gpio.c line is very long....
    Is it milliseconds? I make that 2.3 days.

  8. #98
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    1,248
    Update again guys, pretty sure I found the problem.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://sites.google.com/site/picoreplayer/home

    Please donate if you like the piCorePlayer

  9. #99
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    568
    That seems to have fixed it for me, thanks Paul.

    Code:
    1524941845.0229 6 GPIO.c,102: Short PRESS: 135
    1524941845.0229 6 control.c,106: Button CB set for button #:1, gpio pin 23
    1524941845.0595 6 control.c,217: Button pressed: Pin: 23, Press Type:Short
    1524941845.0595 6 servercomm.c,74: Send Command:0, Fragment:["button","rew"]
    1524941856.9362 6 GPIO.c,97: Long PRESS: 1087
    1524941856.9362 6 control.c,106: Button CB set for button #:1, gpio pin 23
    1524941856.9834 6 control.c,217: Button pressed: Pin: 23, Press Type:Long
    1524941856.9835 6 servercomm.c,74: Send Command:0, Fragment:["button","rew.single"]
    1524941863.0256 6 GPIO.c,102: Short PRESS: 141
    1524941863.0257 6 control.c,106: Button CB set for button #:4, gpio pin 12
    1524941863.0479 6 control.c,217: Button pressed: Pin: 12, Press Type:Short
    1524941863.0479 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+5"]
    1524941866.6147 6 GPIO.c,97: Long PRESS: 829
    1524941866.6148 6 control.c,106: Button CB set for button #:2, gpio pin 24
    1524941866.6564 6 control.c,217: Button pressed: Pin: 24, Press Type:Long
    1524941866.6565 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","0"]
    1524941870.7062 6 GPIO.c,97: Long PRESS: 1046
    1524941870.7063 6 control.c,106: Button CB set for button #:4, gpio pin 12
    1524941870.7708 6 control.c,217: Button pressed: Pin: 12, Press Type:Long
    1524941870.7709 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","100"]

  10. #100
    Thanks! That seems to have done it.

Posting Permissions

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