Error: Web Socket close 1005. Reason: null

Hi,

first of all a happy new year and thanks to everyone for continuously supporting to brinh Alexa control to openhab.

I am currently on OH3.2 in the docker version. I also had the websocket error for quite some time. Now I tried the sihui-option to go with the new addon. Currently the version being downlaoded is 3.2.9.
Unfortunately I do face an issue.
Installing the binding works. Then adding an amazon account thing also works.
When trying to configure via “http(s)://:/amazonechocontrol/fddeaeac89” I am not able to log in.

First, entering email and password takes me to OTP-entry. I receive a code via SMS, so my Aamazon credentials seemed to be ok. After entering the OTP code, I get forwarded to URL “http:///amazonechocontrol/account-thing/ap/signin” showing the following error message:
“Login to ‘amazon.com’ failed: Request failed”

I tried multiple times, no success. The same procedure works with the OH3.2 binding (leading to websocket error, though).

Any help would be appreciated as this binding proved to be valuable and is badly missed :slight_smile:

Please try installing the distribution version (and only that, uninstall the other one) and try to login. If that does work, uninstall the distribution version again and install 3.2.9 again, it‘ll pick up the configuration. Could be a bug.

All Kudos goes to Jan @J-N-K, I only copied that text from his readme file.

I can confirm it’s a bug. Login with the distribution version and switch later. I’ll investigate that.

Understand. Nevertheless you helped someone, so at least Kudos for that!

2 Likes

Ok, done that. It worked for the installation part, now I am back to the websocket issue.

Thank you for investigating this, I appreciate you putting so much time into it. I will try then with a future version. Keep up the good work!

After the login you can switch back to the other version. It‘s an issue with generating the serial number before login, so after the initial login everything works (restoring the login is fine).

It seems that did the trick!

Although I was trying and guessing around a bit on the sequence of steps and when to remove the old binding. After a few logins I think it worked. I now do have only your binding active, the things are online and I receive no websocket errors.

Thanks for the good job! And thanks for investing your time on a Sunday :slight_smile:

Already found the bug. Silly me. Used a different ordering of parameters in the constructor definition and when calling that constructor. That resulted in an invalid device serial number.

:smiley: i tried to activate the “new” 3.2.9 and stuck at the same point in the login. I remember back than the 2-point-authentication was needed to activate the Account. After binding activation i deactivated the 2-point-authentication in amazon again. So i switch it back on, however, still no success. So i will de-install 3.2.9 again and install 3.2 to activate the account and than switch to 3.2.9?

Yes. This only happens on new installs. This is not an issue when upgrading.

Dont know.
I de-installed 3.2.9 now and just installed 3.2. Did no change to the things or the account-thing. After installing 3.2 its working again. The http(s)://:/amazonechocontrol/account1 shows all my devices.
However, after de-installing 3.2 again and installing 3.2.9 again all things are again offline and log-in doesnt work. Still did no change to all the things.

One side information: After login didnt work with 3.2.9 i deleted the old account-thing (text based thing) and created a new one in 3.2.9 in the UI. Maybe this is the issue.

Think i will stay now at 3.2 and wait for an update. Can you just post a short notification here so that i can recognize it? :slight_smile:

If it works on 3.2, switching to 3.2.9 should work. If that doesn’t work, there is another issue. It could be related to the text-based thing definition. I recommend to never use that and can‘t provide any support for that.

The process i did:

  1. De-install 3.2
  2. Install 3.2.9
  3. All things offline, Removed text-based account-thing because log in didnt work
  4. Created a UI-based account-thing with the same name
  5. Log-in still didnt work
  6. De-installed 3.2.9, installed 3.2
  7. No log-in to amazon required, all things directly online
  8. De-installed 3.2, installed 3.2.9
  9. All things offline, Log-in didnt work
  10. De-installed 3.2.9, installed 3.2
  11. All things offline, log-in to amazon, all things online

I am on OH 3.2 stable.
I did 1. and 2. and after less than 1 minute all went online again and the web socket error disappeared :slightly_smiling_face:
Kudos to @J-N-K for his great work!

Similar issues as some here.

v3.2.0 I can set up, login etc. but get the Web Socket Error and the Amazon Echo app cannot see any of the openhab items.

On 3.2.9, I cannot log in. Error is Login to ‘amazon.com’ failed: Request failed. Maybe a localisation issue? I need to log in to amazon.co.uk although I’m not sure if, for the purposes of this binding, it matters.

Please send TRACE logs of the login attempt either by PM or via mail to github@klug.nrw. Do not post them here.

Please note: the „login“ (i.e. via /amazonechocontrol/account) is not working for 3.2.9. if you have an account that is logged in, it should work.

If you tried to install 3.2.9 and then tried to login via /amazonechocontrol/account, the storage is probably corrupted. I‘m currently trying to figure out what is the easiest way to resolve that.

Edit: For the Amazon App to see your items you don’t need the amazonechocontrol binding. You have to add proper metadata and install the Alexa openHAB skill.

Where do you try to login (amazon.com or another domain?) And please go to you user data folder (e.g. /var/lib/openhab on Debian based system). There should be a amazonechocontrol%3Aaccount%3A<thing-id>.json-file. In that file, do you see a session AND a sessionStorage entry or only one of them?

Hello J-N-K,
i am using german amazon, so amazon.de
In the login page it say Connected to: https://alexa.amazon.de [Change]

In the mentioned file on my RPI there is only a sessionStorage entry.

And if you just uninstall 3.2 and install 3.2.9 (while being logged in!) this is not working? Not even after a restart? Do not log out on the account page and don’t disable or change things. If that still does not work, please

  • disable the account thing
  • enable TRACE logging
  • enable the account thing
  • wait until you see an error message in the log
  • disable TRACE logging
  • send the log as described above