Voice notifications with a Raspberry PI and Amazon IVONA


(Adamclark Dev) #1

Hey Guys,

Have a RaspberryPI linking my LightwaveRF to SmartThings so decided to connect it to my amplifier so that I could get voice notifications over my speakers when events happen in my house. The node server uses the amazon Ivona service, which is really good (probably the best TTS service at the moment) and free on beta!

Re-Coded the Sonos weather SmartApp to send to the node server, allowing you to set and play whatever custom messages you want based on system events.

Here is the GIT repo,

Here is a quick demo video (it’s 1 in the morning!)

And here is a video with how to set it up,

Cheers,
Adam


FOR FUN: Pictures & Videos - Your Setups & Hacks
(Csader) #2

Hi Adam, great work!

Trying to get this setup now, but I’m immediately running into issues.

When I try to install forever via npm, I get the following error:

System Linux 3.18.11+
npm ERR! command “/usr/bin/nodejs” “/usr/bin/npm” “install” “-g” "forever"
npm ERR! cwd /home/pi
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: forever

Any ideas why this would be? I’m reading around that the pi might have issues connecting to the npm registry via https? However, even if I try changing the npm registry to http (not recommended), it still tried to access the registry via https.


(Adamclark Dev) #3

Try updating to the latest version of npm and node with these commands and then try again,

curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -

sudo apt-get install nodejs

sudo npm install npm -g


(ben wakefield) #4

This was great, all seems to install, but no sound is coming out. Also watching the logs on smartthings nothing seems to be sending any requests to the PI. How do test it?


(Adamclark Dev) #5

@wakefib - to test if the server is running correctly try this url on your pc.

http://192.168.0.11:8082/speak?accessKey=xxx&secretKey=xxx&speak=test

replace 192.168.0.11 with the ip address or your RPI, the first xxx after access key with the access key and the second xxx after secretkey with the secretkey.

Give me a shout back with the result.


(ben wakefield) #6

thanks for replying.

It appears to be nearly working,

Ended up going tts and running node server.js
but it complained about missing module for ivona
I installed that from npm
Then it complained about missing lame
Installed that from npm
Now the node server is running, your like did return request received
The console is returning Speak request received
But no sound from audio jack, i have tried changing this via rasp-config to audio jack but it seems to always go back.

Any suggestions?


(Adamclark Dev) #7

Try testing the audio on your pi and see if that works,

wget http://www.freespecialeffects.co.uk/soundfx/sirens/police_s.wav

aplay police_s.wav

Cheers,
Adam


(ben wakefield) #8

It now looks like it’s not making a request to ivona as the Dev account is not showing any requests in their web page.

MP3 play if I set it to -local.

Have not tried yet with wavl


(Adamclark Dev) #9

Best first step is to regenerate api keys on IVONA site and put them into your config.

Did you manually edit the device type to add the keys and ip, if so check that this all looks right.

As you are getting a response from the RaspberryPi, the issue probably sits with your IVONA keys.

Cheers,
Adam


(Barry Gordon) #10

I have just finished developing a voice notification system using Ivona_node. It runs on an RPi 3 With Raspbian Jessie.

Occasionally I get a slight bit of truncation of the last part of the speech. I use the NodeJS file system to make a file for the speech from Ivona using a createStream command and then use a writeStream command in the call to the Ivona cloud. I use the on finish call back from the file system writeStream before I play the speech which is an MP3 file.

Has anybody got the same issue or something similar?

Any advice or help appreciated.