I am trying to get access to use the state of the pisound button from a c++ code program using the gpiod library. Here are the steps I have taken:
*I modified the pisound-btn.service with ExecStart=/usr/bin/pisound-btn --gpio21
*I added gpio=27=pu and gpio=17=pu to the /boot/firmware/config.txt file
*Using gpiod I set up pin 17 as an input (as I have many times for other gpio pins)
But when I try and read the pin 17 state using gpio_line_get_value it continuously reads as -1.
So thank you again, this does allow me to enable and disable the pisound-btn service. Systemctl status shows that it is working to disable/enable the service.
What I am confused by, however, is that with the pisound-btn service ENABLED, shouldn’t I read 3.3v on one of the pins of the pisound button physical pin that connect to the PCB? I am reading 0v on all four of the pushbutton pins on start up with the pisound-btn.service enabled.
A service being Enabled does not necessarily mean that it is Running. When a service is Enabled, it means that it will start automatically on system boot up.
You are right about the GPIO pull-up - there should be a ~3.3V reading on one pair of the pins of the button, and the pisound-btn does request the GPIO pull-up to be enabled. If it’s not, either pisound-btn is not running (check if the process exists by running ps -e | grep pisound-btn), or you have modified the default configuration somewhere.
Otherwise, if everything is in the default state and running, and the GPIO pin is still not pulling up, it might be a damaged GPIO pin on the Raspberry Pi itself.