Hi,
I loaded extension pcp-sbpd.tct and set rotary encoder to works. This is my command:
sbpd -v e,27,17,KEY:KEY_VOLUMEUP-KEY_VOLUMEDOWN,1 b,22,KEY:KEY_POWER,2
But it seems that rotary encoder mode (Detent mode) does not work. I can change values from 1 to 9 but the same result.
I found two different repositories from git:
1. github.com/coolio107/SqueezeButtonPi-Daemon
2. github.com/paul-1/SqueezeButtonPi-Daemon
What I'm doing wrong here? Do I have right extension which supports detent mode or is repository #2 as different extension?
Results 371 to 380 of 388
-
2021-01-15, 03:08 #371
- Join Date
- Jan 2021
- Posts
- 3
-
2021-01-15, 06:52 #372
Where did you get the extension from? If you downloaded from our repo (With either pCP 6 or pCP 7) then it's the correct version. My repo is the version that I use for pCP.
piCorePlayer a small player for the Raspberry Pi in RAM.
Homepage: https://www.picoreplayer.org
Please donate if you like the piCorePlayer
-
2021-01-15, 14:13 #373
- Join Date
- Jan 2021
- Posts
- 3
I loaded pcp-sbpd.tcz from piCorePlayer main repository via web interface of pCP 7. This is the extension info:
Title: pcp-sbpd.tcz
Description: SqueezeButtonPi
Version: 3.0.1
Authors: Joerg Schwieder
Original-site: https://github.com/coolio107/SqueezeButtonPi-Daemon
Copying-policy: GPLv3
Size: 20k
Extension_by: piCorePlayer team: https://sites.google.com/site/picoreplayer
Compiled for piCore 10.x
This seems to be wrong one?
I checked also piCorePlayer mirror repository and Official piCore repository but didn't find github.com/paul-1/SqueezeButtonPi-Daemon.
How can I load github.com/paul-1/SqueezeButtonPi-Daemon extension from pCP web interface?
-
2021-01-15, 16:33 #374
The extension is right, I used to push all of my changes to The main branch.....I should update the info file.
3.0.1 is the latest version.
Start with debUg output and then turn your encoder. Post the output.piCorePlayer a small player for the Raspberry Pi in RAM.
Homepage: https://www.picoreplayer.org
Please donate if you like the piCorePlayer
-
2021-01-17, 03:46 #375
- Join Date
- Jul 2020
- Posts
- 243
Struggling with SqueezebuttonPi now..
Added this to the startup commands:
Code:pigpiod -t 0; sbpd b,25,PLAY
But this doesn't work. When I manually start it in a shell, it does work though..:
Code:tc@piCorePlayer:~$ sbpd b,25,PLAY
-
2021-01-17, 09:08 #376
- Join Date
- Jul 2020
- Posts
- 243
Solved it. Simply adding a pause between starting pigpiod and spbd made it work.
Added these lines to my startup.sh:
Code:#start squeezebuttonpideamon /usr/local/bin/pigpiod -t 0 sleep 1 /usr/local/sbin/sbpd -d b,25,PLAY
-
2021-01-17, 11:05 #377
- Join Date
- Jun 2009
- Posts
- 80
Sometime ago the following script was posted to start sbpd and pigpiod which is a bit more elaborated compared to Aki7's code:
Code:#!/bin/sh # start pigpiod daemon pigpiod -t 0 -f -l -s 10 # wait for pigpiod to initialize - indicated by 'pigs t' exit code of zero count=10 # approx time limit in seconds while ! pigs t >/dev/null 2>&1 ; do if [ $((count--)) -le 0 ]; then printf "\npigpiod failed to initialize within time limit\n" exit 1 # or however you want to deal with failure fi # printf "\nWaiting for pigpiod to initialize\n" sleep 1 done printf "\npigpiod is running\n" # load uinput module - required to be able to send keystrokes # 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 sbpd -z -d -f /home/tc/sbpd/sbpd_commands.cfg b,17,FAV1 b,27,FAV2 b,22,FAV3 b,18,FAV4 b,23,FAV5 b,24,FAV6
-
2021-01-17, 14:28 #378
- Join Date
- Jul 2020
- Posts
- 243
-
2021-01-19, 04:09 #379
- Join Date
- Jan 2021
- Posts
- 3
Here is my output:
Code:sbpd -v e,27,17,KEY:KEY_VOLUMEUP-KEY_VOLUMEDOWN,5 b,22,KEY:KEY_ POWER,2 1611054355.5329 6 sbpd.c,316: Options parsing: Set verbose mode 1611054355.5331 6 sbpd.c,505: Using builtin button configuration 1611054355.5332 6 control.c,108: Adding Command PLAY: Fragment ["pause"] 1611054355.5332 6 control.c,108: Adding Command VOL+: Fragment ["button","volup"] 1611054355.5333 6 control.c,108: Adding Command VOL-: Fragment ["button","voldown"] 1611054355.5333 6 control.c,108: Adding Command PREV: Fragment ["button","rew"] 1611054355.5334 6 control.c,108: Adding Command NEXT: Fragment ["button","fwd"] 1611054355.5334 6 control.c,108: Adding Command POWR: Fragment ["button","power"] 1611054355.5335 6 GPIO.c,312: Initializing GPIO 1611054355.5390 6 control.c,411: Rotary encoder defined: Pin 27, 17, Mode: Detent, Type: Keyboard, Pos: KEY_VOLUMEUP, Neg: KEY_VOLUMEDOWN 1611054355.5391 6 control.c,195: Key KEY_POWER:116 1611054355.5401 6 control.c,262: Button defined: Pin 22, BCM Resistor: up, Short Type: Keyboard, Short Fragment: KEY_POWER , Long Type: unused, Long Fragment: (null), Long Press Time: 3000 1611054355.5404 6 discovery.c,385: MAC address found: b8:27:eb:d0:91:8b 1611054355.5404 6 sbpd.c,249: Starting Keyboard Device 1611054355.5446 6 servercomm.c,176: Initializing CURL 1611054355.5543 6 sbpd.c,264: Starting main loop polling 1611054355.5550 6 discovery.c,238: Found server 6601A8C0. A new address 1611054355.6560 6 discovery.c,349: discovery packet: port: 9000, name: pCRoom, uuid: 1f9a2dd5-5036-4348-a159-0e696a099f13 1611054355.6561 6 discovery.c,130: Squeezebox control port found: 9000 1611054355.6562 6 discovery.c,149: Server address found: 192.168.1.102 1611054368.9730 6 control.c,466: Encoder on GPIO 27, 17 - value: -5, detents: -1, change: -1 1611054368.9731 6 control.c,76: Sending key: 114, 1 times
I'm using detent value 5 but does not work. Shouldn't detent value change volume for 5 steps?Last edited by armaster; 2021-01-19 at 04:11.
-
2021-02-01, 07:57 #380
- Join Date
- Sep 2020
- Posts
- 30
Problems Using pHAT BEAT with SqueezeButtonPi
Hi
So I am trying to get my pHAT BEAT working with SqueezeButtonPi. I can get the buttons working by using the script here, https://forums.slimdevices.com/showt...=1#post1004820.
However my problem is trying to use the onboard LEDs at the same time.
I am using this code:
import phatbeat
phatbeat.set_clear_on_exit(False)
for channel in (0,1):
phatbeat.set_pixel(0, 255, 0, 0, 0.1, channel=channel)
phatbeat.show()
After running it the buttons seem to no longer working. Re-running the sbpd script (i.e. calling pigpid and then sbpd and assigning functions to gpios) fixes the problem.
Is the issue that phatbeat.py has the line Import Rpi.GPIO as GPIO?
Thanks in advance.