[RELEASE] Echo Speaks V4

Hi all,
Here's a thread of the rabbit hole I went down to get the local server running on an RPi. It's not a 'for dummies' set of instructions but it does list the steps and I noted anything I came across to get it running. Been working fine (knock on wood) for months now. Hopefully this can help.

6 Likes

PS - I did propose some time ago a project (Raspberry companion for Hubitat) where a Raspberry Pi wold be configured with Docker and the community would provide containers for various functions, e.g. local mail server, local backup server, WebCore local and so on - and, of course, local Echo Speaks to replace Heroku!

The problem with at least some of that request is a few of those things (mail server, backup server) could be filled by several different solutions and not everyone would be happy with an all-in-one solution. There's a ton of different containers on Docker Hub (and a few other places like AC, GHCR, GCR, etc) you can use to fill in your needs. Getting Docker running on a Pi is the least of the problems, that's pretty easy (I'm using it locally under Ubuntu on my Pi).

It looks, at least, like there is effort to replace the Heroic dependency with the option for a local instance, so that will be a good option once it's properly supported.

If you have any questions about running Docker and other tools on the Pi, feel free to message me directly so we don't derail this topic more.

Would be nice to get a for dummies set of instructions for dummies like me

2 Likes

Hopefully a full blown docker version is in the works. If not then believe me, I'm no expert but the steps shown did work and I noted the tweaks I needed to make. It's been over half a year since I did it so don't remember any more gotchas although I'm pretty sure I wrote down everything needed at the time in the other thread.

2 Likes

Got my RPI out installed the latest OS and I am updating now.

So next I am going to try and figure out the GITHUB clone deal, wish me luck.

2 Likes

Assuming npm is already installed, for a raspberry pi: (adapted from a post by VilifiedFerret.

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

Once that is running you need to configure insert the callback url from the habitat echo-speaks config page into http://RPI_IP_ADDRESS:8091 in your browser, then go back to the habitat echo speaks page and login to the local server.

Logging into the Amazon account via the local server took multiple attempts, but worked eventually.

11 Likes

Thanks, npm was not installed, so installing node.js and npm now.

Could you elaborate a bit on this part.

By go back to the habitat speaks page and login you mean in HE correct?

I assume I need to remove the heroku setup?

[edit]
Ok I think I figured this out.

When you say logging took several attempts. When I log in it says the cookie is retrieved but when I return to echo speaks it says I still need to login. Just keep trying?

Edit again

Looks like it is working

Yes, you need to reset the server setup as described in: echo-speaks-docs/support/server_removal

Once that is done, follow the server config guide but deselect the "Deploy server to Heroku" switch to use the local server instead: echo-speaks-docs/configuration/config_server

It will give you a callback url to enter in http://RPI_IP_ADDRESS:8091 . Then go back to the habitat page and close the popup. It will prompt you to login to your Amazon account.

Recommend you suspend the Heroku instance rather than removing it incase Heroku is no longer allowing new free instances to be created. This allows you to go back to Heroku if you have problems with the local server. Heroku offer a maintenance mode option in the dashboard for your deployed echo-speaks server you can use.

2 Likes

I didn't remove anything I just set the switch to use a local deployment. I checked and my Heroku instance is still there.

Recommend you login to Heroku and put the instance into Maintenance mode anyway. I found in my case the app in Hubitat had switched back to Heroku instead of local and I hadn't noticed as the Heroku server was still running. I had to reset and go through local setup again.

2 Likes

For those that want to do this it was pretty easy.(It did take me about 5 hours though.)

What I did.

  1. installed raspberry OS on a memeory card using the Rasperry OS imager

  2. enabled VNC so I could use the VNC viewer. Had to temporarily connect a monitor, keyboard and mouse to my RPI.

  3. installed NodeJS and npm I used the instructions on this page

  4. then pasted the lines listed above by User2305.

  5. redeployed the server locally.

Seems to be working. Good luck

7 Likes

For reference on #2 you can setup RPI completely headless without needing monitor/keyboard if you enable ssh on the sd card after burning the rpi image.

2 Likes

I don't know if it was coincidence or the actual solution, but after I did:
sudo pm2 restart index.js
it managed to authenticate on the first try.

2 Likes

That’d be trivial to dockerize. Wasn’t there another component, like a web socket server or is that in that node,js app?

I realize that this may belong in another thread (if the moderators feel so, please do not hesitate to move this) but it is related to questions I have regarding getting Echo Speaks V4 to be hosted locally. I have absolutely no experience nor knowledge utilizing a RPi, docker containers etc, but am confident that I can just follow the guides to figure it out. I understand that running a RPi sucks up considerably less energy than even a mini pc. However, I also read (don’t know how valid this is in this use case though) that the limited read/write cycles of a microSD card typically used with an RPi may limit its lifetime.

Couple of questions:

  1. what is a relatively “robust” RPi model that can easily serve as a local host for Echo Speaks (e.g., Model 3 or 4, Ram needed, cooling needs, etc) with some overhead room so it is not overly “stressed”?
  2. am I better off using an external larger drive to the RPi for longevity when hosting rather than using an microSD card?
  3. how long for MTBF can I expect if the RPi selected in question 1 above if it is used principally to just get Echo Speaks to continue working without Heroku?
  4. am I better off just using a cheap PC running say Windows10 (assuming it can serve as a container) as a NAS? Will this be more reliable?

Sorry for all the noob questions but I’d like to learn how to best approach this. Given the situation with Echo Speaks and Heroku, I have decided to consider the Heroku policy change as just an “opportunity” to learn something new while getting into a new project, LOL. Thanks for any guidance.

1 Like

echo speaks server takes almost no cpu time. The docker file however is 1GB. No doubt it takes memory but probably not a matching 1GB. I would not run it on a pi zero w although there would be plenty of cycles just not enough memory, IMO. Pi3 or more would be fine - If you can find one and you probably can't. Since echo speaks server barely does anything with disk I/O after startup, an SD card should last for a few years and probably many more. I put a SSD on my pi4's but that ups the price since you'll eventually want a case to hold both of them. It is not a really a set and forget thing. Pay the money to heroku if you want set and forget. Damn near any pc or mac that boots and runs 24X7 can run docker containers.

I picked up a 2 core celeron/4G/128GB mini PC for $160 and installed Mint on it. Cheaper than a pi4 these days. Plenty of space.

1 Like

Ain't that the sad truth. I look forward to when they can get the supply chain back in shape and those are back sub-$80.

Thanks for all the info @ccoupe! I really appreciate it! I guess we were fortunate and should be grateful that we got a number of years out of heroku at N/C. Like I said, looking at this as part of a “hobby”, I am trying to keep a positive mindset on this as an opportunity to learn something new. Thanks again for your insight and contributions to this thread.