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

Technically it shouldn't matter. Mine is part of a family as well.

I'm going to throw this over to @ogiewon as I can't replicate the 400 error. I've tried speaking weird strings (with non-alpha characters) and also changing my cookie and still can't reproduce it. :frowning:

Cool. Thanks for the help. For what it's worth, the string I was putting in was "test". Nothing fancy going on here... :slight_smile:

I figured as much. Can you try with another device as well (if you haven't already)? Maybe it's something to do with just that Dot? I don't currently have any Dots on my account.

Is your account the Primary user account for the Amazon Echo/Dot/Spot/Show/etc... devices? I'm not saying that it needs to be, but that might be it...

It definitely seems strange that you can retrieve the list of Alexa devices, but then cannot get them to 'Speak'...

I got it to work finally, but the resolution is less than satisfying.

To rule out anything odd on the Amazon account side, I deregistered/reregistered the Dot I've been using for testing. Now everything is working properly. To answer your question, yes the Dot was registered to the Primary user account (mine). That didn't change when I de/re registered. shrug

I guess turning it off and back on again cleared the problem. lol

2 Likes

ok i been trying ot get the auto refresh working again. I am having no luck.

Using latest version. When i do the cookie via the browser it works great. Anyone have any ideas?

Here is the info i have:
refresh options in browser window:
{"loginCookie":"io=LG5mXDK0-rJXL3dMAAAA; frc=VeZ3bwjixDwBo4OljvkZBmCet5GU3EsNfIKGEUychzjDcFanxmSKn9i2drsosCYImZ8fkuakUO46TpeqeV83P/R+VNZb6uFjm++IfTyL4OnUp/CKB4EC4qNZg6SByubWJRD9ZFgaTNfVB7970a9fL3JVZO0XcUGpF48RLhUEOoIitKVrVkFxXkMRmRhobsLk5azxYHOCCfJWVyWT517Q/gFx8KMyaIlGkukoWmMuJz1M76uGdT8s+XI7g3l0auw+ZT7lTx2X+CID7ASo/DxcX1lKRQh/mF1Eo72p8C7NOPPU7zKJxN6qMo+PFzoawLsT26+fTzjkDHJGykiuP7vb3jiMYEaAA0EKQavqtBIYWwVPbfo9iS1XN+LsIEKKoUc8TJrU96eu2z5VU74DDGwMg2S8Cj9qpY7JhQ==; map-md=eyJkZXZpY2VfdXNlcl9kaWN0aW9uYXJ5IjpbXSwiZGV2aWNlX3JlZ2lzdHJhdGlvbl9kYXRhIjp7InNvZnR3YXJlX3ZlcnNpb24iOiIxIn0sImFwcF9pZGVudGlmaWVyIjp7ImFwcF92ZXJzaW9uIjoiMi4yLjIyMzgzMCIsImJ1bmRsZV9pZCI6ImNvbS5hbWF6b24uZWNobyJ9fQ==; session-id=137-4493612-8570936; session-id-time=2187125215l; csm-hit=tb:D1K9218E9RRE5QPR2QYZ+s-D1K9218E9RRE5QPR2QYZ|1556405217389&t:1556405217389&adb:adblk_yes; ubid-main=133-2095874-9288643; session-token="sh24B6x1xIeD32DkGeCZ886Sgznklkhhq9jgK825Al+B2lk3M+RO2loNTXXRDH/9nLbXsZPirjVsVwPFOpIEyL7HSh31uK/hJbYOpU66z+N+CU+9xBeiw0wJyxlyNNxHRt9zFwMi9d7PF+DguipYv6G1hCNVdI0NOW2Ec9uz2Ajpnm6HiQXaLNN4TonG4f71wFzKQYiwt+FrJ+40Q92AKFjNjRmG1V2Hr/j6MVLBsME="; x-main="ENEqjkrMYXY8Q1@y@FoLXUp9rfQLgY1x"; at-main=Atza|IwEBILirUuKP3dyv-KNQr309OxUSWrgO4MiWFNvmD3W5N2grSz44y_uM2AlGfG_B1nmUXheoXMDTKG7fOnpJZLI9C2cWbU1S_n4ZG3OuZPz4bzBVRhcqtBrMfjposUep2Fc7_LJRhUyrUsysL9j3Ot0dw0ALFSZ9i2IQYZO-fTkcujfOeHeXe-LiBBvnmA8qziHCt1_HCu5XXhXao-U8-ONIewI6ELT7Vv4rhLBBP6DtmRaVOX7c1VTp7g3TeE6rKKwtaizNpjrKT8pNGzVVrLJWOrFxHirIrNGdkwnZMWQCpzLGyVGxUIyBQGcjVTH76P6wLMAn2ikHHDL8ByUrcKfhl_d4fpVwZOC1fL7VDtiuUkdlTbuDZePQffHyglrQwQpimGcpRX_Mm2HqxQAXSjqttEz_U1rc9Wvd2tlsB1t42limiVezOpk-O1k91ktUiq0XIYJHsLRgFCEQnlb2SKg54-w-yC0YjjJiDcKImRV3hKR3Xg; sess-at-main="57ixeKoLwbo0M6x0Yu8pDVu1MNDDo0s5pDC7UW/XwS0="","frc":"VeZ3bwjixDwBo4OljvkZBmCet5GU3EsNfIKGEUychzjDcFanxmSKn9i2drsosCYImZ8fkuakUO46TpeqeV83P/R+VNZb6uFjm++IfTyL4OnUp/CKB4EC4qNZg6SByubWJRD9ZFgaTNfVB7970a9fL3JVZO0XcUGpF48RLhUEOoIitKVrVkFxXkMRmRhobsLk5azxYHOCCfJWVyWT517Q/gFx8KMyaIlGkukoWmMuJz1M76uGdT8s+XI7g3l0auw+ZT7lTx2X+CID7ASo/DxcX1lKRQh/mF1Eo72p8C7NOPPU7zKJxN6qMo+PFzoawLsT26+fTzjkDHJGykiuP7vb3jiMYEaAA0EKQavqtBIYWwVPbfo9iS1XN+LsIEKKoUc8TJrU96eu2z5VU74DDGwMg2S8Cj9qpY7JhQ==","map-md":"eyJkZXZpY2VfdXNlcl9kaWN0aW9uYXJ5IjpbXSwiZGV2aWNlX3JlZ2lzdHJhdGlvbl9kYXRhIjp7InNvZnR3YXJlX3ZlcnNpb24iOiIxIn0sImFwcF9pZGVudGlmaWVyIjp7ImFwcF92ZXJzaW9uIjoiMi4yLjIyMzgzMCIsImJ1bmRsZV9pZCI6ImNvbS5hbWF6b24uZWNobyJ9fQ==","deviceId":"850768238548124736465503871617830872013175411314106517720886323523413249564c5635564d32573831","deviceSerial":"40f2ade2547bb0f7b5196cb9d731f0c0","refreshToken":"Atnr|EwICIPGNsdfGp2tUGjDfbuhq4FrJrKfJz3kzLHIUR4d_HKOPDDRnqj63ICY111KJD2o92oPi41wVOb3cGUcuBcYvMa20Gb0AFUSpiqIAl7XZnCV0StYXA-38TsnnlCtlLMw0_jSdoM_vIu3QW9yPrwrcUE7r1_HdNB549dMmXY3OrWAXMwe9UbL_4HXVwmMKRVIdCWoovXKwYbSnEgQ9kNnXGoGXDaeN5yzvi1s_6lTKO-FvRgNahiPkGnCd9ZlKLu_Sl7DZCQIdN-3VAt-JvahMwukxvuQlkswekcGuew2hzzFUvq5CU9ev-9DpoElx3O-jIiJ-NSCvj29fG-06xdsak1Yrb0QcxPET_dBDBsWhqHBdbGJolBRAfXCjwVbS06aaoPGIrU7M9F9e8WS47sYuYI_jMhS3WgiZNTsHUWDZrFwHfYvkan0WstMq54FbwUNTig0","tokenDate":1556405237882,"amazonPage":"amazon.com","localCookie":"session-id=145-5061037-2849804; session-id-time=2187125238l; ubid-main=132-4421658-7914967; x-main=kTBpwFQ309nurKesR3c9Znr2SmiISbrP; at-main=Atza|IwEBIHiui-RYGwQECKIo_lSGdP9NwbOtKNiM3DDeBHh-e0wf29ZEYkMjSHiuNdOR2Dt5duK7nf70M07r-HZ5DG2_fk6_LtDa2Z4xv7W-Sd4cd5uHE7fRGamB_LalR4Me8QL_gzW9boBTSYtShIxz47bhhpKYNbiHaTlUwrNqXDUNZ8xLR3rsYqW0ilkziG1pfXT48lfID8pvR3yskD_zXZg7bwCMlefIDandKwf4mLLuXOwvKGWPOhehdZMxlyPpKZQa4bySCl8oqyyUJsqTrsEjQO5i0RO1bqIl6qzFU_3b3cqNIzr8wQ6oLN4np7QpbtQQhNuUutkSP_Pq8FznS0fzpB5iO9ten8x5VGQ5sn9Va4FdPBDoClxhGf4b6zrqhKLseeRl1tGg2euNddmkiy_dmgk8VrqOyMDRyLBxWDKR7b7RdDg3j9FFzcacb0AVttCRDu6bW_Xjs0wMYUEI3yMqOKNo99seT39FDE31PbUIYh1j2w4M9kdBwDB8LljijFmXapIl2syjVCBJz46fhA2HUzMp; sess-at-main=TOkUlBpzsMylrrXZwrpLD/dlzskBQXfyXuv5EsIITsY=; csrf=-858471949","csrf":"-858471949"}

error i get:
app:4912019-04-27 05:47:49.323 pm error'refreshCookie()': Error making Call (getMessage): Bad Request
app:4912019-04-27 05:47:49.320 pm error'refreshCookie()': Error making Call (Status): 400
app:4912019-04-27 05:47:49.314 pm error'refreshCookie()': Error making Call (Data): ErrorSyntaxError: Unexpected token 5 in JSON at position 0 at JSON.parse () at createStrictSyntaxError (C:\inetpub\wwwroot\AlexaCookieNodeJs\node_modules\body-parser\lib\types\json.js:158:10) at parse (C:\inetpub\wwwroot\AlexaCookieNodeJs\node_modules\body-parser\lib\types\json.js:83:15) at C:\inetpub\wwwroot\AlexaCookieNodeJs\node_modules\body-parser\lib\read.js:121:18 at invokeCallback (C:\inetpub\wwwroot\AlexaCookieNodeJs\node_modules\raw-body\index.js:224:16) at done (C:\inetpub\wwwroot\AlexaCookieNodeJs\node_modules\raw-body\index.js:213:7) at IncomingMessage.onEnd (C:\inetpub\wwwroot\AlexaCookieNodeJs\node_modules\raw-body\index.js:273:7) at IncomingMessage.emit (events.js:194:15) at endReadableNT (_stream_readable.js:1125:12) at process._tickCallback (internal/process/next_tick.js:63:19)
app:4912019-04-27 05:47:48.811 pm infoAlexa TTS: starting cookie refresh procedure

I just found out that my Zolo Halo will now work with this app! Not sure if it is already on this thread but I know that in the past only Alexa-made echos have worked!

1 Like

anyone have multiple dots and some dont speak sometimes? i have alexa annouce washer/dryer done and sometimes 1 out of 4 will and sometimes all will. its so random

Amazon only allows 2-3 devices to talk at a time. If you add more than that, you’ll get unpredictable results. If you add a delay between speak commands to each device, you should be able to avoid the problem.

1 Like

I'm having a lot of difficulty in getting my cookie entered in correctly. Can someone please direct me to the right location? I have the Refresh URL and Refresh Options, and in the App I've just copy and pasted the entire Refresh Options string, but it doesn't appear to be working. One thing I noticed is in the app it says it ends with a semi colon but mine is really long and ends with }. I know I'm missing something here. I'm getting push notifications that the string is incorrect as well.

Logs show

Let's start with the most simple method first, and then you can try using the automatic cookie refresh method.

I'd recommend removing the Alexa TTS App (not the source code, just remove any instance of the app you currently have.) Then, add the Alexa TTS app again. When prompted for the Cookie information, use the following method and ONLY populate the first field for the cookie (i.e. ignore the automatic refresh options for now)

## Method 1A - Get the cookie directly from Chrome. (Thanks @krlaframboise and @ritchierich !)

1. Open Chrome and Login to alexa.amazon.com
2. Open the Chrome menu at the top-right of your browser window, then select Tools (More Tools) > Developer Tools (or click F12)
3. On top row of developer tools you will see several tabs: Elements, Console, Sources, Network, etc. Click Network.
4. Just below the tabs you will see a red circle, below that you will see a filter box, and below that you will see sub tabs: All, XHR, JS, etc. Click XHR
5. Click Smart Home in the left navigation
6. The developer tools XHR list should populate with several items, one called "featureaccess-v3", right-click on it and choose Copy, Copy Request Headers. This will place it into your clipboard.
7. Paste the cookie into the app

I would also still add your Notifications device at the bottom, as that helps to know if there is a problem.

See if you can then click to the next page and select your Alexa devices. After they are created, see if you can go into their details pages and send a test Speak command with some text.

If that works, then you have the basics correct. You can then attempt to follow @gabriele's ReadMe for the automatic cookie updater NodeJS app.

3 Likes

Thanks @ogiewon I did what you suggested and it's speaking to my Echo just fine. I have node.js setup successfully on my RPI3 and that's generating a cookie just fine per Gabriels instruction. My issue is I think I'm copying too much of what shows up for the cookie and I'm not sure what I should be copying as part of the RefreshOptions field. I'll take a look at this Cookie that is working and compare it against the cookie that's being generated.

like should I be copying as I have highlighted in this screenshot?

@inetjnky

That's what I copied & pasted. The only difference between your NodeJS setup and mine is that I have it bound to TCP 81, while your setup listens at TCP 1025. I don't see why that should matter.

I have the same issue as above poster. That cookie that gets generated from
Nodejs looks like that but does not work for me

When I enter in the cookie and the NodeJS Service URL, leave the nodejs service username / password blank, and then enter in the country code (in my case United States), and choose the pushover for alerting and click next... it just hangs there acting like it's trying to do something, but never does. just spins. The very first time I did this it took me to the next screen but the list of devices to speak was blank.

I may back out of everything and re-install my RPI3 and re-install NodeJS and try again from scratch. Not sure where i went wrong. NodeJS, npm and pm2 were all run as sudo (root) is running as root as show in Top.

Do you have 2-factor authentication on your Amazon account? Are pop-ups blocked on your browser?

2fa is not enabled. I’m not home at the moment to check Chrome for popup blocking.

Then I'm at a loss. I have 2FA authentication enabled and had an issue until I unblocked Safari pop-ups.