Echo Speaks / Heroku end anxiety support group. See one solution below. 🙂

Jesus wept.

I don't use heroku, echo speaks, haven't got a clue what dockers are all about... And I was fine.

Fairly anxious now though. Reading this thread is like staring at the matrix

=p

2 Likes

Github doesn't know me. Do I need to create an account and log in from the Pi or something like that?

This really isn't a Hubitat issue. Echo Speaks is a user-created app for Hubitat to use Amazon Echo devices as a speaker. The app requires another computer server service in the middle for reasons I don't understand very well. Heroku was the name of that service and it was free. Heroku will cease being free on November 28.

It is possible to run your own server on a separate computer, in my case a $50 Raspberry Pi I had sitting unused from a previous abandoned project.

Normal people do not have a spare Raspberry Pi in a box somewhere in their house. You are safe. I'm just a compulsive tinkerer. I also fancy myself a software expert because I could program in FORTRAN 50 years ago. This is a serious delusion - apparently.

Hopefully l will learn something new with the kind assistance of much more knowledgeable folks in this group. So, I am having fun doing this!

Or, I will continue to have a spare Raspberry Pi in a box.

As I said - you are safe. Fear not.

:slightly_smiling_face:

1 Like

Try:
docker container ls -a

That will list all containers that have been created both running and not running :slight_smile:

Docker container ls
Only displays running containers

me@raspberrypi:~ $ sudo docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c968b72ed90d hello-world "/hello" 11 hours ago Exited (0) 11 hours ago nostalgic_easley
fed6757b893e hello-world "/hello" 11 hours ago Exited (0) 11 hours ago gracious_gould
me@raspberrypi:~ $

I have no idea where those names came from.

I think these are from when I was testing the docker installation.

they can be removed if not needed:

docker container rm "container ID#"

the container ID is listed at the beginning of those containers listed

in your case:
docker container rm c968b72ed90d
docker container rm fed6757b893e

if you ever have a container you need to stop running:
docker container stop "container ID#"

hope that helps :slight_smile:

or use portainer that I posted above. it is a web based app that runs on your rpi that allows you to manage docker containers

Use this command:

git clone -b docker-enablement GitHub - TonyFleisher/echo-speaks-server

1 Like

Haha... Thanks for the kind reply.

But my post was British Sarcasm, probably. Doesn't carry well via text sometimes.

My point was essentially, this is complicated, and I don't really understand the focus / need for it. But that's just me.

Curiosity - going the docker route etc, does this guarantee that once set, it'll work forever? Or is this one of those things that potentially requires a manual 'fix' every now and then?

If the latter... Definitely not for me.

You can also use alexa tts with nodejs on a intermediate Machine which is used just to refresh your alexa cookie.

To answer @hal3’s question the reason Heroku or now a “computer server service” is required is that Amazon doesn’t have an official API to speak on an Echo. To get around this solutions like Echo Speaks have to generate an authentication cookie so it can invoke the TTS speak command via unofficial APIs as if you are doing this via computer web browser. The authentication cookie expires periodically so this service will reauthenticate to keep Echo Speaks working.

Given this is using unofficial APIs this could stop working at any time, addressing @djh_wolf’s question. Echo Speaks has been around for several years using these APIs so hopefully this won’t happen.

2 Likes

Thanks!

I have portainer running and logged in from my PC!

I will have to play with it a bit to see what I can do.

I've been playing with alternatives and for the time being I have Echo Speaks disabled. The handful of announcements that I want have been well served with Alexa routines. Not local is OK for me, None of the announcements are mission critical and our internet service is very rarely interrupted.
The Alexa skill, My Audio, enables playing an uploaded mp3 from Alexa based on a trigger from Hubitat. Audio files are uploaded to https://personalaudio.in/ I wanted to try an mp3 of the old AOL "You've got mail."

From the author of the skiii,
" Hi Bill,

Thanks for using my skill.

It is possible to use the skill in routine, lot of my users are using it, I have attached the snapshots of a sample routine and steps below:-

The steps are :-

  1. Let's create a new routine with the name "morning"

  2. Under the step "When this happens ", select "Voice" and enter phrase "Good morning".

  3. Under the step "Add Action" add "Customised" Action and enter the "Open my audio and play game", here "game" is my invocation name.

After 1-2 minutes, you can test this routine on your device."

Screenshot of my Alexa routine.

2 Likes

Progress!

I had to generate a public SSH key and link it to my Github account.

Moving forward

remote: Enumerating objects: 1615, done.
remote: Counting objects: 100% (468/468), done.
remote: Compressing objects: 100% (49/49), done.
remote: Total 1615 (delta 427), reused 419 (delta 419), pack-reused 1147
Receiving objects: 100% (1615/1615), 764.00 KiB | 4.47 MiB/s, done.
Resolving deltas: 100% (1081/1081), done.

I believe they are a brand of trousers

2 Likes

Ok, I have gotten my local Echo Speaks server working. In my case, I created it inside of a LXD container. You can use a Pi or a VM also. I tried the Docker container solution and it worked fine, but was more complicated than needed.

In my case, I used a LXD container that was Ubuntu 22.04.

So, on my LXD container, I simply installed the app with these steps.

sudo apt install nodejs
sudo apt install npm
npm i https://github.com/tonesto7/echo-speaks-server
sudo npm install -g pm2
cd node_modules/echo-speaks-server
sudo pm2 start index.js
sudo pm2 list
sudo pm2 save
sudo pm2 startup
sudo pm2 save

You will want to set a static address on the instance where the Echo-Speaks server is running.

Next you will want to go to your Echo-Speaks app page on the Hubitat skill and choose the reset options loggle.


Once you toggle the reset data option, click the next and the done to exit the app page.

When you go back into the app, turn off the toggle to deploy to Heroku and you will get this screen.

Next, click on the "Deploy Server"
image

You will get a popup screen with a callback URL.

Copy the entire section in gray and then visit your Echo Speaks URL on the local server you built which will have your address with port 8091. In my case http://172.16.3.3:8091.

Paste the callback URL into the last field labelled callback URL and then click save settings.
You can exit this screen.

When you exit the screen with the gray block for the call back URL that you copied, the app should change to a screen like this.

When you click the amazon login page option, you will get a screen like this:

Click the go to login page option.

Once you type in your credentials, your screen should look like this.

At this point, you can exit that login screen and your Echo-Speaks app page on your echo speaks skill should refresh and look like this:

This means that Echo Speaks is working and using your local network (non-Heroku Cloud) for its login/cookie server.

VERY IMPORTANT: So, mine failed to tell me that I had logged in when I exited the login screen saying I was logged in. If this happens to you, simply reboot your LXD instance, your VM instance or your Pi and try the login again. That's what ultimately fixed it for me.

Hope this helps!

12 Likes

Went through this process and am stuck at

sudo pm2 startup

I get an error message “Init system not found”. Anyone knows what this means? TIA!

Ralph, normally the pm2 startup error would only happen if you are trying to run node.js under windows which is not supported.

@vmsman - great write up, I was able to follow it and get the server running on my Linux box. I didn't use LXD container (not familiar with containers), but was able to install the nodejs, npm and started the index.js.

Everything went pretty smoothly until I got stuck on the Amazon login (as you indicated), I ended up just stopping then restarting the index.js and then re-tried the Amazon login... and it worked.

sudo pm2 stop index.js
sudo pm2 start index.js

I mainly use Echo Speaks for controlling devices that only integrate with Alexa and not Hubitat. I use the "Voice CMD As Text" option and create routines in HE to control these Alexa only devices... and have become dependent on it.

Anyway... So happy to have my own local server and be free from Heroku, thanks again!

2 Likes

Thank you for the detailed instructions!

Are you saying that I can run this on my Pi in Pi OS without a container - like Docker in my case? That would simplify things for me.

I was not thinking about a static IP but that makes sense. I'm guessing a static local IP address for the Pi on my network, like 192.168.1.11, is not what we are talking about.

I am on Google Fiber. I know that there are various ways to set up a (free) static IP using outside services. If anyone knows a link to a good static IP service and a recipe I would certainly appreciate the information.

I may have asked this before. Is there a way to setup Alexa speaks on a windows 10 computer? I have one on 24/7.
If there is please include directions.
Thanks in advance.