Using button without pisound

Hello, I am using patchbox os which is great. What I am trying to do is to somehow use the button finctionality.
I found out it is hooked to gpio17 so I did the same with my custom button, but now the thing is pisound-btn seems not starting.
When run I get: “Reading Pisound serial failed, did the kernel module load successfully?” any ideas?

Thanks in advance.

1 Like

Hey, we’ll add a --no-pisound switch to pisound-btn, so it runs anyway, some time next week. :slight_smile:

You have to hook up the button to GPIO17 and the other end of the button switch to GND.

Thanks for your reply. I’ll also try to get to understand how those processes work so I can create my own.
Currently I run a small python program to handle encoder and matrix keyboard via pigpio. Thanks for your support, what you do is really great and stable environment for experiments. Attached the pic of my Jukiffizer I did so my wife can sing through the vocoder.

Regards from sunny Poland.

2 Likes

is it possible to change the gpio to fit with a button on my tft screen. if so where should i look.

thanks

Just in case I found it there:

line 39.

I have just made pisound-btn to run even if Pisound is not detected (no config changes necessary), and added a --gpio N command line argument to specify which GPIO pin to use. It will also take care of ‘exporting’ the GPIO pin, if necessary. (Changing BUTTON_PIN would not have been enough, as Pisound’s kernel driver was taking care of exporting the pin)

This is available since pisound-btn version 1.10, you should be able to get it using:

sudo apt update
sudo apt install pisound-btn

Thank you! I’ll test it up and report back.

Hi, I’m using Pisound and the button works just as expeced, also when I soldered an “external” button to gpio 17 and gnd.

Anyway, when using Patchbox OS on RPi without Pisound, it doesn’t seem to work. I made all recomended updates, the command “–gpio N” does chande the pin and I get info that it’s listening to a certain gpio, but still it doesn’t react to any button pushes / holds.

I gave it up as it also does not work for me. Forgot to report it up.

The Pisound’s device tree overlay configures the button pin as an input pin with pull up enabled, active low mode. If Pisound is removed, the pin is not properly configured.

There’s multiple ways to get this configuration done, you may write and load your own device tree overlay, use commands like raspi-gpio, gpio, or pigs (example)

Also, hooking the other end of the button to +3V3 instead of GND can also work, if the GPIO pin you use is by default pulled to ground.

Thanks, I’ll have a look

Thx, the trick with hooking the other end of the button to +3V3 doesn’t work with GPIO 17 but it does with GPIO 21. However, I have no frickin’ idea how to permanently change gpio to 21. What I do is typing:

pisound-btn --gpio 21

and it says “Listening to events on GPIO #21” and it is listening, indeed. So how do I now save the gpio choice? Because after shutting down and turning on again, it seems that it forgot the change to GPIO 21 and after typing

pisound-btn

it says “Listening to events on GPIO #17” again.

I know nuthin’ about linux, I just want to have Pd patch running headless and be able to switch the rpi safely. So no idea about linux terminal commands, shortcuts etc.

The +3V3 trick worked for me on GPIO 17 and RPi4, but anyway, to change the pin and save it between reboots, you have to override the pisound-btn.service file. See this topic where I explain how to do it for modep-mod-ui.service, and do the same for pisound-btn.service, edit the command line appropriately in your copy of the pisound-btn.service.

You can find out the current path of pisound-btn.service using this command:

sudo systemctl status pisound-btn

Giedrius, thanks for immediate reply!
Unfortunately, I’m stuck again - after few steps, when I’m already editing the copy of “pisound-btn.service” , there’s no gpio number anywhere in the file, so I guess I need to add some new line - where should it be and what should it look like? (told you - no linux skills here, unfortunately…)

Edit the ExecStart line as:

ExecStart=/usr/bin/pisound-btn --gpio 21
1 Like

Yup it works finally! Thank you!

1 Like

Im currently messing about with trying to get patches switching with an ESP8266 connecting to the hotspot. My current plan is to use OSC or MIDI but I was wondering if its possible to hook into ‘The Button’ scripts? eg, another python script to emulate GPIO input? (Is that even possible)

All of the Pisound’s scripts are simple bash scripts, they’re located in /usr/local/pisound/scripts - you may just execute them directly. :slight_smile:

A post was split to a new topic: Switching to next pedalboard does not go through all pedalboards