Hello everyone and thank you for all your answers avaliable on this forum which allowed me to discover node-red and a little programming.
I am a total newbie and my question may seem silly to you: What can prevent an exec node from executing a command that works in the terminal?
Let me explain :
I would like to "mute" and "unmute" the raspberry 3b sound output with an exec node (i use pulseaudio). I tried many command found on various sources but: no succes.
For example, the following two commands work in the terminal but give the following errors when executed in an exec node :
-
pi @ raspberrypi: ~ $ amixer -q -D pulse sset Master toggle
=> ALSA lib pulse.c: 243: (pulse_connect) PulseAudio: Unable to connect: Connection refusedamixer: Mixer attach pulse error: Connection refused -
pi @ raspberrypi: ~ $ pactl set-sink-mute @ DEFAULT_SINK @ toggle
=> Failed during connection: Connection refused Connection pa_context_connect () failed: Connection refused
I checked my configuration (cat /proc/asound/cards, amixer controls and contents, aplay --list-devices and pcms) but analyse their results is difficult for me.
I checked raspberry and debian forums to found various command to test and i found 3.
I cheked the groups and added the user pi to the pulse and pulse-access groups, but that doesn't change anything.
I checked this forum, with no succes.
Anyone have an idea?