Trying to get TTS to speak to work on a Google Home mini

I would install node v8. Other version aren't guaranteed to work. The version listed there is the desktop version. So, if you are going to run on a raspberry pi headless, run the commands to install the cli (command line interface) version rather than running the desktop version.

If you are trying to install node on a raspberry pi, I would recommend using this script.

This allows you to install whatever version of node you want from the command line very simply.

1 Like

As @ryan is saying, install the CLI version via NPM is a you need. You donā€™t need the full installer you manually downloaded.

You can install specific versions of node by specifying it. Example...

pi@raspberrypi:~ $ sudo npm install -g node@8.10

Just FYI, the version I am using on my RPi is 8.16.0. Other version probably work too but if you want one that is definitely going to work, I would use that.

Ok so before installing that version should I unistall the version I currently have or it will be over written? If need to unistall can you tell me the steps(sorry I have never used linux this is my first time and just found is very different than windows)

And regarding my other question that what should I do with the github files that I downloaded, can you advise? Just leave them in the downloads folder?

No, you don't have to uninstall anything.

It doesn't matter what you do with them. They won't be used. Delete them or leave them it doesn't matter.

Oh so those files from the github I originally downloaded are only to install the node js but as you said for the desktop version and that is why I do not have to use them anymore because instead I will install the version 8.16.0 installed from the other link you provided right?

And so the web-cast-api itself will be installed in node js at a later step right?

I don't know what else to tell you. When you execute the commands on your RPi, it gets all the files it needs. You don't have to pre-download anything to get this done. Was there any mention of downloading anything in the instructions?

I had it running in my android phone and just migrating to raspberry because in android it will stop running every 3-4 days and had to click again the start button which was annoying. When I did the config for android I installed first the node js and then copy the code from github and pasted it into the node js script portion so this is what I was looking on how to do in raspberry but based on your comments I guess this is now not needed and somehow when entering the codes in the terminal that you have advised then it will get the web-cast-api from internet. Will give a try later once back home. Thanks for the advises

Trust me...I just did this the other day when my pi totally hosed itself. It will work!!!

Applications can be posted on NPM by developers. When they are, you can type...

sudo npm install -g followed by the application name

or for an insecure installation where required, you type...

sudo npm install -i followed by the application name

This automatically downloads and installs the app. If you download the installer manually, you can save it to a directory, navigate there and then sudo npm install -g or sudo npm install -ifrom that directory, but cloning the repository is unneeded for this.

You can also find out what versions you have by using the -v switch. So for example...

node -v on my system returns 8.11.3

it's not an "insecure" installation, it's "--unsafe-perm" for unsafe permissions. Not the same as an insecure installation.

1 Like

I wasnā€™t aware. What is the difference?

To be honest, I've not been able to find any documentation around -i and I've never seen that command used. All I know is the developer specifically called out running -g --unsafe-perm. Why not use EXACTLY what is known to work rather than trying something new. You said you didn't even need the --unsafe-perm, right?

Iā€™m not trying anything new. I have installed a few things in the past where the dev said to use -i instead of -g, so I thought it was the same. Apparently it isnā€™t.

Iā€™m good. All my stuff is installed and working fine.

That's my point. You have to use -g AND --unsafe-perm. Not just one or the other.

@ryan780 Now that I came back home first of all I formatted my SD card that just for in case whatever thing I had done before would not affect now so no garbage in my card.
First of all I tried to install the node as per you suggested following the GitHub steps from the link you provided. So the instructions in that link are:

So I copied that and past it in the terminal but at the end it says "Cannot write to '-' (broken pipe)." As per below screen shot

just to verify I put in the terminal the command "node -v" and it returned that I have v8.11.1 so was it installed from the instruction I given or was this pre-installed in my raspberry ??

Then I tried some other commands from the same link that you shared and looks like they are not working:

any idea?

Take off the second line. node - v is used to check your current version of node.

Do you know how to use Linux at all? You don't copy 2 lines and put them together like that.

But if you have 8.11 then you are fine. What operating system are you running? Raspbian? That's what it would have been installed with. It's on your SD card. Not on your pi.

Sorry about my mistakes but yes this is the very first time I use Linux, not familiar at all.

I bought a blank SD and yes I installed raspian on it.

So the 8.11 came pre-installed with the raspian? The only stuff I had done is what you see in my screen shots, nothing else

Will give more trys tomorrow. Thanks

Are below 2 links for the same purpose of getting google TTS but just different methods??

Cast web allows you to send TTS via broadcast (all your Google Home and Chromecast devices at once), or to individual Google Home devices. It also allows you to play music files.

Google Assistant Relay only allows TTS via broadcast, but has the advantage of being able to send TTS text to Google Assistant, and have it execute that text by prefixing it with [CC]. So for example, if I have a WiFi enabled dimmer switch that Google Assistant supports, but Hubitat does not. I can turn the device On/Off or set the dim level from a Rule Machine rule, by adding the action Speak with the message "[CC] set the dimmer to 50%" and it will do it as if the device was directly connected to Hubitat Elevation. There will be no outgoing sound, and there will be no return response. There's a second option that allows you to do the same thing, but get a response back. So if I had Speak "[CCC] set the dimmer to 50%" the same action would happen, but Google Assistant or a Google Home device would respond verbally, "OK, setting the dimmer to 50%"

2 Likes