Hello,
I'm new to node-red and the Raspberry Pi that I'm running it on.
I have a flow that is designed to play an audio file using VLC. It worked until I needed to reinstall RPi due to a faulty SD card. I've created a simple flow to isolate the issue.
The inject payload is this string bash -c "exec -a testPID cvlc /home/pi/Music/ting.mp3"
The exec node (bash) command is empty but appends msg.payload
There are no deployment errors.
When I inject, no sound is played and the debug pane shows the following errors.
[017a7758] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[017e14f8] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11[017e14f8] main interface error: no suitable interface module
[0172cb58] main libvlc error: interface "dbus,none" initialization failed
[017cc2e0] main interface error: no suitable interface module[0172cb58] main libvlc error: interface "globalhotkeys,none" initialization failed
[017cc2e0] dummy interface: using the dummy interface module...
But, if I copy and paste the same line into a terminal, it works correctly;
This looks as if it may be some sort of configuration problem. But I'm struggling to find the problem with my limited experience of node-red, Linux and all things Pi . Despite a lot of Googling.
I've pasted the simple flow below.
I would appreciate any pointers.
John
EDIT: I've just realised a very similar question was posted a couple of hours previously. I'll keep an eye on those eplies also. Pulseaudio and musicplayer
[{"id":"7ddb98ac.770a78","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"fea64c4d.e4b95","type":"debug","z":"7ddb98ac.770a78","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":530,"y":60,"wires":},{"id":"d2b0ee6e.c9cee","type":"inject","z":"7ddb98ac.770a78","name":"","topic":"","payload":"bash -c "exec -a testPID cvlc /home/pi/Music/ting.mp3"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":60,"wires":[["481efec8.c876a"]]},{"id":"481efec8.c876a","type":"exec","z":"7ddb98ac.770a78","command":"","addpay":true,"append":"","useSpawn":"true","timer":"","oldrc":false,"name":"bash","x":290,"y":60,"wires":[["fea64c4d.e4b95"],["fea64c4d.e4b95"],["fea64c4d.e4b95"]]}]