[Deprecated] Amazon Alexa Text to Speech (TTS) v0.6.2 - Direct Integration (USA, Canada, UK, Italy, Australia, & Brazil)

Thanks. I ended up restarting my NodeJS container (I use docker on my NAS) and it fixed the issue. Curious do you automate this restart? If so how? I’d love to do it via RM or NodeRed if possible.

With NodeRed, it's easy. Use an Inject node, Exec node and 3 debug nodes. If you have the nodejs app running in a manager like Forever or PM2 (my personal choice is PM2), then just issue the command. If it's running on another server, then you'll want to ssh -e [user]@[host] '[command]' to do it.

You could also schedule the reboot in a cron script as well.

( Sorry to hijack you @aaiyar :frowning: )

3 Likes

I use PM2 as well, and just have a cron script that runs "pm2 restart AlexaCookie".

3 Likes

Looks like fixing this could solve the issue without reboots needed?
Unfortunately it hasn't been merged yet, I'll try to send a pull request

I think I tried that and it didn’t work and I still had to restart...

1 Like

Thanks SO much for the hard work on this, I've got it working great following those nice step by step directions.

1 Like

Needed: An Idiots Guide to Getting the AlexaCookieNodeJs Running on a Raspberry Pi Model 3+ with Raspbian Buster

I’ve been piddling with this for way too long. I’m pretty sure there’s something I’m doing wrong or missing and just can’t figure it out. I’ve gone through a bunch of permutations and OS reloads and never get the webpage to load. Here’s an example of one of the install tries:

#Install the most current version of nodejs

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

sudo apt install -y nodejs

#Install the Alexa Cookie NODEJS wrapper for Hubitat

#Download and extract

cd ~/Downloads

wget https://github.com/gabriele-v/hubitat/archive/master.zip

unzip master.zip

mv ./hubitat-master/AlexaCookieNodeJs/AlexaCookieNodeJs/ ../

rm -rd hubitat-master/

#Configure

cd ~/AlexaCookieNodeJs/

chmod +x ./AlexaCookie.js

#Install pm2

sudo npm install -g pm2

#upgrade to latest npm

sudo npm install npm@latest -g

#upgrade to latest pm2

sudo npm install pm2@latest -g

pm2 start AlexaCookie.js

pm2 startup

#result script from the pm2 startup

sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi

pm2 save

At this point I’ve been skipping setting up the cron job to restart daily. In some of the variations I’ve even put in :

sudo npm install -g body-parser

sudo npm install -g cookie

sudo npm install -g express

sudo npm install -g http

sudo npm install -g http-proxy-middleware

sudo npm install -g http-proxy-response-rewrite

sudo npm install -g linkifyjs

sudo npm install -g querystring

sudo npm install -g socket.io

sudo npm install -g uuid

OR

npm install body-parser

npm install cookie

npm install express

npm install http

npm install http-proxy-middleware

npm install http-proxy-response-rewrite

npm install linkifyjs

npm install querystring

npm install socket.io

npm install uuid

Since at times I see “Error: Cannot find module 'express'” in the ~/.pm2/logs/AlexaCookie-errors file.

Assuming a clean install of ‘Raspbian Buster with desktop and recommended software’ but updated with ‘sudo agt-get update’ and ‘sudo apt-get upgrade’, can anyone instruct this poor, tired fool what actually needs to be in the bash script above to get it working correctly?

Thanks,
Bill

I felt the same way. Never got it working correctly.

I then saw that Spotify had a deal to sign up and get a free google home mini. So I signed up for a $10 account and got my mini. Cancelled afterwards.

Then I ended up with 30 kohl’s cash that was expiring and got a 2nd one for 10 bucks cause it was on sale. I have Alexa all over the place in the house but I only need tts in 2 places and it’s ultra easy with google home mini.

1 Like

I recently went through this process using a RPi 3 B+ running the latest version of Raspian Buster. I was able to get things working again, however I did use NodeJS v8 (not sure if this is required or not, but that is the version of NodeJS I have always had the most luck with. Raspian Buster's repo default version is now NodeJS v10, which makes getting NodeJS v8 installed a little tricky.) I will try to find my notes and write something up specific to the Raspberry Pi platform, and then submit a pull request to @gabriele's GitHub repo's ReadMe. It might take a day or two before I can get to this, though.

2 Likes

@billmeek

@ogiewon's installation notes will be more useful to you. I use Ubuntu 18.04, so my installation notes are of no use to you.

Just wanted to mention that I am using NodeJS v8 (8.10.0) and PM2 v4.1.2. I was using PM2 v3.5.0 - there are huge improvements in memory usage between these two version (v4.1.2 is much better).

1 Like

tomm1313,

I'm pretty invested in the Amazon ecosystem. There’s an Echo or Echo Dot in every room of the house including the bathroom and storage room. I’ve even added an Echo Auto to my 2008 Smart Cabriolet (convertible). So rather than just setting up a ‘smart house’, I’ve got a smart Smart car too.

A gripe about that… Amazon’s lockout on their microwave means you can’t start it via Alexa if the door hasn’t been open in 10 minutes. That defeats one of the reasons I bought it. I planned to put a frozen meal in the microwave when I leave for a service call and start it heating on the way home. So when I walked in the house, lunch could be waiting. It irks me that you can’t turn off that nanny-like safety and the Amazon website for the microwave says it works with my Echo Auto. Yeah, but only for 10 minutes after I close the door on the microwave. Not very useful eh?

ogiewon,

Thank you very much. There’s no rush as I’m using the cookie from the web browser currently. It’d just be a lot easier to have the cookie auto-updated as I have several uses in mind for the speech capabilities. Until I pick out a siren, I’m having HSM turn on all lights in (and outside) the house to 100% and red, along with reading the intruders Vogon poetry (Douglas Adam’s “Hitchhiker’s Guide to the Galaxy” fans will get the reference).

Aaiyar,

I’ve got an old Ubuntu file server that hasn’t been on in a year. There’s also a Linux Mint laptop setting here by my desk that I startup when needed. I could try it on them, but wanted something with lower power usage to run 24x7 and it would be good to do something actually useful with another of the (several) Raspberry PIs I have laying around. Currently the only one in real use is a RPi Zero that acts as a time server for my POE cameras. I never could get the cameras to sync time from the Windows 10 PC that is running Blue Iris.

1 Like

I run Ubuntu on an Odroid XU4, which is an octacore ARM-based SBC. Four cores are big endian, the other four are little endian. It runs everything that I need - PiHole, OpenVPNd, a DLNA server, ntpd, several nodeJS servers, sendmail, samba, backup for both my Hubitats .....

I (sorta) wish you hadn't shown me that. Added to my overly long wish list... after sirens, smoke/CO alarm(s), Ikea blackout blinds, and Hampton bay ceiling fans. Of course I should get all of the other new smart devices currently in-hand setup before buying more.

I'm not trying to sell you on one. But, I'll tell you one thing they have that RPi's don't - they can use an eMMC, which is faster and more reliable than an sd-card. On the other hand, RPis have built-in WiFi/BT support .....

You may note that I added the ODROID-XU4 to my wish list. That means it'll probably be bought soonish. If I need to store data on a RPi, I have a couple of the WD PiDrive (250 gig models) that I can use. One of the PI Drives is setup along with a Unicorn hat on the RPi3 to use for the Alexa TTS as I plan on eventually do some logging of values from Hubitat. The goal there is to display some simple graphs of usage (i.e. power from the Zooz ZEN15) in the near term.

Right now I'm getting new smart devices in faster than I can deploy them.

2 Likes

@ogiewon FYI: In your readme.md (Hubitat/README.md at master · ogiewon/Hubitat · GitHub) under this section "Okay, so you've got your cookie string. Congratulations as I know that was a bit of manual work! Now for the easy part!", that link to the groovy files return a 404 error. Wasn't hard to file the files just wanted to let you know.

Oh, I almost forgot. Thanks you for your work on this!

2 Likes

Thanks for the feedback. I have corrected the broken links in the ReadMe!

You're welcome!

3 Likes

Probably because people store stuff in it and they don't want it going off by accident and causing a fire.

More likely because kids do all sorts of things on the Echos. That's simple enough to get around though. Put an optional code required (like the do with purchases) to enable it after 10 minutes.

The Hubitat app on my cell phone displayed the notification "Alexa TTS: Please check your cookie!"

I have the AlexaCookie running on a Raspberry Pi3. As far as I know, it's installed correctly and has been running for 20 days without issue.

'Systemctl' shows "nodered.service loaded active running".

'pm2 list' displays that 'AlexaCookie' is online.

There nothing in the ~/.pm2/logs/AlexaCookie-error.log
The only thing in ~/.pm2/logs/AlexaCookie-out.log is several "AlexaCookieNodeJs listening on port 8881!"

There's a crontab entry '0 0 * * * pm2 restart AlexaCookie' so it's restarted daily.

Any suggestions on what may have caused this or other things to check?

One thing that did happen a little while ago is I had a rule (contact switch firing off the event) that sent a barrage of messages to one of my Echos for a minute or so. Could that require a cookie to expire?

Bill