Speaker pi Node contrib not working

Hello,

I've installed this speaker pi plugin: https://flows.nodered.org/node/node-red-contrib-speakerpi

on my pi to play audio file from it but when making the node and putting the correct file path in and injecting true to it doesn't work but aplay to the same path from the PI's terminal doe's

Does anyone know what is wrong/missing with it? maybe there are other packages needed to be installed?

Hello,
First of do you see any errors in the debug tab? Secondly did you install the prerequisites as stated in the nodes description? sudo apt-get install libasound2-dev
There is also some other nodes you could use like https://flows.nodered.org/node/node-red-contrib-play-sound or my own https://github.com/johanneskropf/node-red-contrib-sox-utils
Johannes

Well I did install all the packages it needs and now I see that it types me this error:


Error: Package subpath './v4' is not defined by "exports" in /home/pi/.node-red/node_modules/uuid/package.json

will probably take a look at your thing if this won't work.

Also where could I learn about creating nodes that could run a python script or terminal commands in node red?

the built in exec node can call out to other commands.
(Or the node-red-node-daemon for long running processes)

3 Likes

Ah ok the exec thing is very quite useful abd actually working, thank you.

For now it can replace that node making it quite unnecessary also where do you learn those tricks and things about node red?
do you take a course? video tuts? reading somewhere?
let your self rot over the thing until you understand something?

All of the above and playing with flows, reading the forum, searching the forum, searching google and youtube, reading the documentation, trying flows in the flows tab to add a few ideas. :grin:

Yeah but that seem quite a wild trip through some unknown sources...
Doesn't Node-Red have an official doc and guides about how to use it?
Just trying to figure it out in a major way, how do you learn any software/package feature that gets popular in the world like GCC compiler and say just for example mosquitto broker package on the pi more deeply and being able to learn to control those features in a more organized standardized and controlled way?

Have a look at this play list on youtube containing 18 videos:

It’s by one of the main developers of node-red on the official youtube channel.
Than there is the official user guide:
https://nodered.org/docs/user-guide/
which covers all the basics and than is the cookbook which covers some basic concepts and common usage scenarios:
https://cookbook.nodered.org/
All very official documentation.

2 Likes

Great exactly what I was looking for very useful stuff thanks!

Simply create an exect node and enter aplay [filePath] (only plays wav files use omxplayer[filePath] for mp3 files) in the command to play audio no need for special node installs.

You can also use mpg123 or sox with a handler installed to play mp3s from the commandline or with the exec node. I ve used both before and can recommend them.
Of course some of the nodes made especially for playing audio still have their own advantages as they will give you niceties like easy choosing of the output devices or gain control without having to dig into the man pages of some of the commandline tools which can be quite a mess.
But the exec and daemon are two very nice quick and dirty nodes for interacting with external processes and in many cases a great solution.

Johannes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.