Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not get token #16

Open
vahov opened this issue Jun 29, 2020 · 15 comments
Open

Can not get token #16

vahov opened this issue Jun 29, 2020 · 15 comments

Comments

@vahov
Copy link

vahov commented Jun 29, 2020

Sorry for being dum but I can not get the token. I installed Wideq with "sudo npm install wideq" and this plugin. The command "sudo wideq auth -c EE -l ee-EE" returns "command not found" and that's it. Does not matter wether I ssh into the Pi or use the Homebridge UI Terminal. Please help.

@vahov
Copy link
Author

vahov commented Jun 29, 2020

Update, uninstalled all and installed wideq with -g which gave me the url to log in but the answer is this. What am I doing wrong?

pi@homebridge:~ $ wideq auth -c EE -l ee-EE
Log in here: https://ee.m.lgaccount.com/login/sign_in?country=EE&language=ee-EE&svcCode=SVC202&authSvr=oauth2&client_id=LGAO221A02&division=ha&grant_type=password
Then paste the URL where the browser is redirected: https://ee.m.lgaccount.com/login/iabClose?access_token=xxxxxxxxxxxxxxxxxxxxx1a446a80f467e5570aee757b3cba80cf3720044ba94da545f2ba2c55dcc063bf14926166835539&refresh_token=xxxxxxxxxxxxxxa23c9448d4469ba87213d53ff6d5960da7a8cb5567f8d603d196f8264660b19ffe198c6dbc06ade559&oauth2_backend_url=https://gb.lgeapi.com/
(node:3237) UnhandledPromiseRejectionWarning: Error: write EPROTO 1995536848:error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small:../deps/openssl/openssl/ssl/statem/statem_clnt.c:2150:

at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:92:16)

(node:3237) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:3237) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code

@vahov
Copy link
Author

vahov commented Jun 29, 2020

Sorry guys, searched deeper, changed some files and finally got it registered in Homebridge. Unfortunately nothing is seen in Homekit. I have a washing machine/dryer, does it even show in Homekit and if so what is the tile, is it just a switch?

@town3r
Copy link

town3r commented Jun 29, 2020

What did you change to get rid of that SSL Error?

I tried updating the tls min to 1.0 and that didn't seem to solve the issue

@vahov
Copy link
Author

vahov commented Jun 29, 2020

I did exactly that, sudo nano /etc/ssl/openssl.cnf and changed MinProtocol to TLSv1.0. It was 1.2.
After that the error was gone.

@town3r
Copy link

town3r commented Jun 29, 2020

Does yours look like this?

Screen Shot 2020-06-29 at 3 14 10 PM

I'm not sure if i saved it correctly.

@vahov
Copy link
Author

vahov commented Jun 29, 2020

Yes, it does. Or at least it seems so:

Screenshot 2020-06-29 at 23 17 49

@town3r
Copy link

town3r commented Jun 29, 2020

Did you restart your server after making the change?

pi@ToWn3r-Homebridge:~ $ sudo wideq ls
Log in here: https://us.m.lgaccount.com/login/sign_in?country=US&language=en-US&svcCode=SVC202&authSvr=oauth2&client_id=LGAO221A02&division=ha&grant_type=password
Then paste the URL where the browser is redirected: https://us.m.lgaccount.com/login/iabClose?access_token=xxxxxxxxxxxxxxx&refresh_token=xxxxxxxxxxxxxxxxx&oauth2_backend_url=https://us.lgeapi.com/

(node:3563) UnhandledPromiseRejectionWarning: Error: write EPROTO 3070162128:error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol:../deps/openssl/openssl/ssl/statem/statem_lib.c:1942:

at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:92:16)

(node:3563) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:3563) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@vahov
Copy link
Author

vahov commented Jun 29, 2020

I did frequently yes after changes but I can not remember if I restarted after this one specifically. I did lot of changes, uninstalls, installs etc. For now I definitely have restarted the server

@town3r
Copy link

town3r commented Jun 29, 2020

Thanks for sharing.
Still no dice. :(

@u20p17
Copy link

u20p17 commented Jul 4, 2020

Hi, any news how to solve the problem? I also get the following error:

(node:32408) UnhandledPromiseRejectionWarning: Error: write EPROTO 3069446608:error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small:../deps/openssl/openssl/ssl/statem/statem_clnt.c:2150:
at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:92:16)
(node:32408) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:32408) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@u20p17
Copy link

u20p17 commented Jul 4, 2020

Now it is working for me. I did exactly what you where writing before --> sudo nano /etc/ssl/openssl.cnf and changed MinProtocol to TLSv1.0. It was 1.2.

THANKS!

@nocturne1
Copy link

nocturne1 commented Jul 31, 2020

Trying to set to TLSv1.0 doesn't work for me. Still getting the same error as listed above. I suspect that it might be because I'm using node v12, which might not allow that downgrade? This is running the official homebridge pi image.

@town3r
Copy link

town3r commented Jul 31, 2020

Let me know if you figure it out w/ out downgrading Node.

I'm also on the latest version which I'd be sad if it's the reason why we can't authenticate.

@town3r
Copy link

town3r commented Aug 1, 2020

v10.22.0 doesn't throw up the error! :D

But I hate not being totally up to date.

@nocturne1
Copy link

nocturne1 commented Aug 1, 2020

So interestingly enough, I found enough of a workaround to get the wideq command itself working.
node --tls-min-v1.0 /usr/local/lib/node_modules/wideq/dist/cli.js auth -c US -l en-US
So that then allows it to get a little bit further, but then there are cipher errors.

Commenting out the "CipherString = DEFAULT@SECLEVEL=2" line (or changing to SECLEVEL=1) and rebooting then allows the node command above to properly execute that command. However, I still can't get the wideq command to take up the TLS setting override. Nor will the Homebridge plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants