That's how python is interfacing with the GPIO. The import alone should not do it. The phatbeat python code is resetting all of the board GPIO when you start it.
https://github.com/pimoroni/phat-bea...at/__init__.py
You will need to make you own version of the the phatbeat library, remove all of the references to the inputs.
Results 381 to 390 of 395
-
2021-02-01, 08:19 #381piCorePlayer a small player for the Raspberry Pi in RAM.
Homepage: https://www.picoreplayer.org
Please donate if you like the piCorePlayer
-
2021-02-16, 07:58 #382
I had success getting an encoder to work. Thanks to others in this thread for ideas! Hopefully, this will help anyone trying to get this working. This is on piCorePlayer 6.1.
My main goal was jivelite navigation (not volume). I used one of these generic encoders:
https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1
I wired it to the following GPIO pins, similar to what was noted in a previous thread:
Code:SW to GPIO26 (physical pin 37) DT to GPIO20 (physical pin 38) CLK to GPIO21 (physical pin 40) + to 3V3 (physical pin 1) GND to Ground (physical pin 6)
Code:#!/bin/sh # start pigpiod daemon pigpiod # 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 will cause encoder to move selection right or left; Press=Enter; long press=down sbpd e,20,21,KEY:KEY_LEFT-KEY_RIGHT,4 b,26,KEY:KEY_ENTER,4,0,KEY:KEY_DOWN,500
Code:/home/tc/sbpd-script.sh
Code:chmod 755 sbpd-script.sh
Also, paul's github repo readme entry is very helpful for understanding the sbpd paramteters: https://github.com/paul-1/SqueezeButtonPi-Daemon
Thanks to @pippin and @paul- for enabling this!Last edited by wtnh; 2021-03-07 at 09:34.
-
2021-02-18, 20:02 #383
- Join Date
- Jan 2021
- Posts
- 18
Disregard post. Cancelled portable use case project.
Last edited by LiFePO4; 2021-02-21 at 22:53.
-
2021-02-21, 07:04 #384
- Join Date
- Feb 2021
- Posts
- 5
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,
PaulLast edited by jedisha; 2021-02-21 at 14:34. Reason: development
-
2021-02-21, 22:58 #385
- Join Date
- Jan 2021
- Posts
- 18
^^
My experience with this tool has only been a few hours total, so noob.
But maybe try passing the -t 1 or -t 0 parameters to pigpiod. I believe there's a conflict with your HAT.
Just search in the thread for the posts...
Code:pigpiod -t 0 or pigpiod -t 1
So even if you follow the steps to a tee, everyone's audio requirements differ.
GLLast edited by LiFePO4; 2021-02-21 at 23:00.
-
2021-02-22, 15:36 #386
- Join Date
- Feb 2021
- Posts
- 5
pigpio daemon seems to kill audio output... please help!
Dear all,
I've been trying somewhat in vain over the last few days to try and get SqueezeButtonPi daemon working on my PiZeroW (and iQaudio PiDIGI AMP+).
The aim is nothing crazy - just a rotary encoder with one push-button to give volume dial + play/pause button controls to pcp.
I've installed pcp-sbpd.tcz on pcp 7.0.0 and have created sbpd-script.sh (as per a previous post from @chill).
I'm trying to get the following commands to function:
Code:sbpd -d -s e,23,24,VOLU,0 b,5,PLAY,1
Code:#!/bin/sh # start pigpiod daemon pigpiod # 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 s> sudo modprobe uinput sudo chmod g+w /dev/uinput # issue the sbpd command # This command will cause encoder to move selection right or left; Press=Enter; long press=> sbpd -d -s e,23,24,VOLU,0 b,5,PLAY,1
Also, please see screengrab below for my Squeezelite settings (I believe I've correctly switched volume control to '-V Digital' so as to control the Alsa volume settings with a rotary encoder... or could this be one issue?)
This evening I've noticed that it's when theCode:pigpiod
I'm clearly out of my depth, but would love to get this working, so any help HUGELY appreciated, and if there's any further info which may help solve this then do let me know and I'll supply!
thanks so much guys!
Paul
-
2021-02-22, 15:40 #387
- Join Date
- Feb 2021
- Posts
- 5
-
2021-02-22, 21:49 #388
- Join Date
- Apr 2005
- Location
- UK/London
- Posts
- 3,930
Which physical pins have you connected wires to?
I ask because there is always the chance of confusion with pin numbers.
See https://pinout.xyz/Paul Webster
http://dabdig.blogspot.com
Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland
-
2021-03-05, 10:09 #389
- Join Date
- Jan 2021
- Posts
- 7
Hi,
I'm using RPI 3B+, HiFiBerry AMP2 HA. I'v only installed pcp-sbpd.tct with no settings and not running any command. I get sound from AMP2. But if I run sudo pigpiod, no sound comes from AMP2.
Some help please...Last edited by armaster; 2021-03-05 at 10:12.
-
2021-03-05, 10:20 #390
- Join Date
- Jun 2009
- Posts
- 87
@armaster,
post #385 might be useful in your case.