[RELEASE] Echo Speaks V4

I was having the unauthorizedOperationException too, even though the server was showing my correct IP address. When I clicked through to the login setup, it would go to my Synology's IP address, but then clicking the Open Login Page button it would try to take me to the Synology's hostname instead.

Adding the IPADDRESS = {my Synology's IP address} to the environment variables in the Docker container settings, like others have done to resolve the "wrong IP showing" issue, seems to have fixed that!

My local server went offline, so I had to redo it. I reset the Amazon cookie service (using the Reset Options shown in the image), but now the local server is set to 0.0.0.0, and I don’t see a place to change it. When I click on that section, I just get an error because it tries to open my server at 0.0.0.0 instead of the actual address. How do I update this? Thanks!

image

3 Likes

Thanks for your help. I did all that resetting and stuff, and my server is up and running, logged into Amazon, but it's still showing the 0.0.0.0 address on that page, and when I click on the Amazon Login Page button, it tries to take me to 0.0.0.0, which is obviously not the correct address.

image

I can see the server in the config, but can't edit it:

You have the callback URL filled in properly on the ES server?
I just tested mine, I did the reset on the ES app. Then went through the steps, got the callback URL. Went to the ES Server, put in callback url, hit save settings and the ES App picked it up and is working again. After restting did you leave the app and go back in so it could clear everything out and let you set it up again?

The only other thing I can think of is that the ES Server is not able to detect your IP. Not sure what environment you have it running on? If you can set the environment variable ipAddress to your ES server host IP then restart the server it should override the automatic detection.

Yep.

Linux locally on my iMac. Installed using the instructions from @vmsman: Echo Speaks Local Network Logon/Cookie Authorization Server to replace Heroku
I reset Echo Speaks and recreated my local server... and the initial setup and cookie grab works as you can see below, but it still sets the wrong IP address. I feel like I could solve this, if I simply had the ability to update the server address from 0.0.0.0 to the correct address.

You do, set the environment variable of ipAddress to your server IP before launching the server.

If using docker his instructions show it (fixed variable to proper case in case it matters on your system)
ipAddress=192.168.4.3 ./start.sh

EDIT4: Sorry I finally found the way to just launch pm2 and set the variable. PM2 - Environment Variables | Best Practices | PM2 Documentation

So looks like if you already have pm2 setup you could restart it like this to set the variable.
Replace 'app' with the name of the app shown when you run pm2 list

ipAddress=192.168.4.3 pm2 restart app --update-env

May need to run a pm2 save again after this as well, not sure but it wont hurt anything.


Other Old Info:

Other Info

If you are not using docker, stop the pm2 process and try launching it manually like this (from the echo-speaks-server folder)
ipAddress=192.168.4.3 node index.js

I think that should set it according to what I found online. I am not sure exactly where that works into the pm2 command. Its a way to test it it will work though.

EDIT2: The pm2 ecosystem file thing looks slightly complicated and I would have to test it. I did however stumble into something. There should be an es_config.json that was generated, not sure where exactly since I set mine up in an odd way. It might be in the folder just above the node_modules folder or possibly in the echo-speaks-server folder. It may also be in the home folder of the users launching the process. Anyway.... if you find that file you should be able to edit the ipAddress in there. Stop server, edit file, restart server. Hopefully it will just use that value, could be wrong though, it may just reset it again.

image

EDIT3: Here is the info I found on setting env variable for PM2. You would need to create the ecosystem file and then launch that with pm2 instead of the index.js

How to create it: PM2 - Ecosystem File
More about variables: PM2 - Environment Variables

You would need something like this in the ecosystem file:

        env: {
          "ipAddress": "192.168.4.3",
        }
1 Like

It looks like my cookie refresh interval is one year but the cookie has a green check. Am I interpreting this correctly?

@Hal3 Mine looks similar and has been that way for some time. I setup my local server months ago. My setup works without issue.

I'm not certain, but at this point, it seems that the initial login is all that is needed to pull the cookie. A refresh doesn't even seem to be needed. This would be something for @tonesto7 to conform/verify.

1 Like

Your Cookie Refresh is showing red, which tells me it missed the last refresh point.

2 Likes

@thebearmay Mine has been red for months without issue. I have my local server running as a docker container with the original code. I didn't see a need to update since it has been working fine. I don't know if anything needs to be done to force a cookie refresh, but I'm hesitant to do anything since my setup is working.

1 Like

My server looks OK.

5 Likes

Not sure what Amazon has their cookie expiration set at, but the refresh logic has a 5 day refresh default.

That's what mine is set to.

Point here being that at one point 5 days was selected for a reason, and server sets a job out for that date/time. If the job fails and does not reset the cookie (which yours has), at some unknown point the cookie will expire and your ES functionality will stop.

1 Like

@brad In your installation on your iMac, did you use the Docker Method or the Node.js code? Also, can you you tell me is the address of the local cookie server an address on your main LAN or is it an address that you don't recognize? For more help, catch up with me on my chat server https://chat.scottibyte.com.

Since multiple people are seeing the red X and continue to have a working setup, I'm leaning toward it being something on the Amazon side of things. We all know how Amazon loves to change things as they go.

I'll deal with it at the point in time if something breaks. It seems that a manual refresh is all that would be needed. But, as I mentioned, if it ain't broke...

All I can say is tick, tick, tick.... :sunglasses:

image

1 Like

This worked! Thanks so much for your research and detailed explanation. I stalled for a second on "app" but found it as you said using pm2 list. Mine was simply "Index"

Node.js v19.1.0 as I already had it installed for Homebridge. My server was at http://192.168.4.3:8091 which I expected as the address of my iMac. Not sure how it went off track.

@vmsman Do you want to amend your directions to include setting the IP like that? Or maybe just add a tip that if it is not working and showing 0.0.0.0 to run that command to fix it?

@brad I will be curious if that keeps after a reboot? Did you run the pm save afterwards?