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

turn on logging and watch what happens:

app:262020-11-19 09:00:28.475 am infoAlexa TTS: new cookie parsed succesfully
app:262020-11-19 09:00:28.473 am infoAlexa TTS: cookie downloaded succesfully
app:262020-11-19 09:00:28.440 am infoAlexa TTS: starting cookie download procedure
app:262020-11-19 08:55:28.378 am infoAlexa TTS: Request for new cookie sent succesfully, guid: <removed>
app:262020-11-19 08:55:28.345 am infoAlexa TTS: starting cookie refresh procedure

It wont work until the successful message appears and this takes about 5 mins.

I'm not using nodejs to manage cookies, so do not see that

@ogiewon

I see this error in my log and only for 1 rule, have many others that don't give me any errors

Here is the rule

I put the delays in b/c I was getting the same error, they seem to go away for a few days but they are back

Any ideas on what I can do?

your delays are not corrrect we went over this a set volume is the same as a message.

you need delays between EVERY set volume and message including the one shown in the logs

you need a delay between the "your hot water has arrived" and the set volume after it.

@ogiewon @gabriele

Any suggestions for this error?

I am running on an rPi 4. Starting the app via PM2 seems to work, but the webpage is inaccessible. Starting with no-daemon shows the following:

14:37:48 PM2 | App [AlexaCookie:0] exited with code [1] via signal [SIGINT]
14:37:48 PM2 | App [AlexaCookie:0] starting in -fork mode-
14:37:48 PM2 | App [AlexaCookie:0] online
14:37:48 1|AlexaCookie | Error: listen EACCES: permission denied 0.0.0.0:101
14:37:48 1|AlexaCookie | at Server.setupListenHandle [as _listen2] (net.js:1301:21)
14:37:48 1|AlexaCookie | at listenInCluster (net.js:1366:12)
14:37:48 1|AlexaCookie | at Server.listen (net.js:1452:7)
14:37:48 1|AlexaCookie | at Object. (/home/pi/AlexaCookieNodeJs/AlexaCookie.js:260:8)
14:37:48 1|AlexaCookie | at Module._compile (internal/modules/cjs/loader.js:1063:30)
14:37:48 1|AlexaCookie | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
14:37:48 1|AlexaCookie | at Module.load (internal/modules/cjs/loader.js:928:32)
14:37:48 1|AlexaCookie | at Function.Module._load (internal/modules/cjs/loader.js:769:14)
14:37:48 1|AlexaCookie | at Object. (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
14:37:48 1|AlexaCookie | at Module._compile (internal/modules/cjs/loader.js:1063:30) {
14:37:48 1|AlexaCookie | code: 'EACCES',
14:37:48 1|AlexaCookie | errno: -13,
14:37:48 1|AlexaCookie | syscall: 'listen',
14:37:48 1|AlexaCookie | address: '0.0.0.0',
14:37:48 1|AlexaCookie | port: 8081
14:37:48 1|AlexaCookie | }

there is already a version running it seems like and it couldnt bind to listen on the port.. can you scan with ps and find it and kill it. or try rebooting.

2 Likes

Why are you running three copies of the NodeJS server concurrently?

2 Likes

Thanks. Not sure. Fixed that. Only one is running now. The process constantly changes pid and then errors out.

i would say uninstall it and reinstall it and check it again

1 Like

@dadarkgtprince
Thanks. Doesn't work.

I checked the listening ports. Nothing else is listening on 8081 & 8082. I redownloaded everything. Went through the motions. Same problem.

What version of NodeJS are you running?

v14.15.4

Running v8.17 here...

1 Like

I switched to 8.17.0 (only installed version). Same issue. Nothing else is listening on the ports.

This is from the pm2 logs:

/home/pi/.pm2/logs/AlexaCookie-out.log last 15 lines:
1|AlexaCoo | AlexaCookieNodeJs listening on port 8081!

/home/pi/.pm2/logs/server-out.log last 15 lines:
/home/pi/.pm2/logs/AlexaCookie-error.log last 15 lines:
1|AlexaCoo | /usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:30
1|AlexaCoo |     import(url.pathToFileURL(process.env.pm_exec_path));
1|AlexaCoo |     ^^^^^^
1|AlexaCoo |
1|AlexaCoo | SyntaxError: Unexpected token import
1|AlexaCoo |     at createScript (vm.js:80:10)
1|AlexaCoo |     at Object.runInThisContext (vm.js:139:10)
1|AlexaCoo |     at Module._compile (module.js:617:28)
1|AlexaCoo |     at Object.Module._extensions..js (module.js:664:10)
1|AlexaCoo |     at Module.load (module.js:566:32)
1|AlexaCoo |     at tryModuleLoad (module.js:506:12)
1|AlexaCoo |     at Function.Module._load (module.js:498:3)
1|AlexaCoo |     at Function.Module.runMain (module.js:694:10)
1|AlexaCoo |     at startup (bootstrap_node.js:204:16)
1|AlexaCoo |     at bootstrap_node.js:625:3

I am hoping @gabriele will chime in as he created the AlexaCookie NodeJS server. I am not much of NodeJS expert, whatsoever.

I am pretty much just using my IKEA Symfonisk (Sonos) speaker for TTS, as it 'just works' with the native Hubitat Sonos integration. For $99, it has saved me a lot of time and frustration over the past year. :wink:

1 Like

i am running mine on a qnap nas. so not much help for you there but running this version
and running the alexa cookie in docker

[~] # node -v
v14.1.0
[~] #

2 Likes

Make sure your .js file have executable permissions for the user running the pm2, under the user running pm2 (your user in your screenshot is pi) do a ls -lha and post back your permissions. That EACCES permission is common acl error that is easily fixed by chmod and giving proper permissions.

Another troubleshooting step is instead of putting it into a pm2 container, instead run it directly from bash by doing "node AlexaCookie.js" that will give a verbose output that can directly point you to the problem.

image

Yet another thing, change the bind port to something else, something like 8881 and 8882 instead of the default one, just in case there is another daemon binded to those ports.
You can check your hearing ports by:
lsof -i -P -n

3 Likes

Thank you for helping @manuelangelrivera

Running via node shows:
pi@raspberrypi:~/AlexaCookieNodeJs $ node AlexaCookie.js
module.js:550
throw err;
^

Error: Cannot find module 'alexa-cookie2'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/pi/AlexaCookieNodeJs/AlexaCookie.js:37:21)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)