Skip to content
New issue

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

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

Already on GitHub? # to your account

Failed to login error #21

Closed
tbelcher opened this issue Jan 27, 2022 · 9 comments · Fixed by #23
Closed

Failed to login error #21

tbelcher opened this issue Jan 27, 2022 · 9 comments · Fixed by #23
Assignees
Labels
Bug Something isn't working

Comments

@tbelcher
Copy link

Describe The Bug

I just installed the plugin and am hoping to use it with my 300Sm, however I get the following error in the logs:

Jan 27 11:58:40 raspberrypi homebridge[8920]: [1/27/2022, 11:58:40 AM] [Levoit Air Purifiers] Failed to login Error: timeout of 15000ms exceeded

Has anyone else experienced this issue?

Thanks,

Tim

Expected behavior

To be able to add the 300S within the Home app.

Logs

Jan 27 11:58:40 raspberrypi homebridge[8920]: [1/27/2022, 11:58:40 AM] [Levoit Air Purifiers] Failed to login Error: timeout of 15000ms exceeded

Plugin Config

    {
        "name": "Levoit Air Purifiers",
        "email": "####@#####",
        "password": "########",
        "platform": "LevoitAirPurifiers",
        "enableDebugMode": true
    }

Plugin Version

1.1.8

Homebridge Version

1.4.0

Node.js Version

16.13.0

NPM Version

8.1.3

Operating System

raspberry Pi Buster

@tbelcher tbelcher added the Bug Something isn't working label Jan 27, 2022
@RaresAil
Copy link
Owner

Hey @tbelcher, can you provide and the logs before that error? From the error name i can see that the server is not responding to you, can i ask you what is your internet speed and/or country?

You can try to ping their servers to see if you have any packet loss: ping smartapi.vesync.com

@RaresAil
Copy link
Owner

The ping should output something like this, for me the response time is around 130ms

PING vesyncappapi-1834200178.us-east-1.elb.amazonaws.com (3.92.125.41): 56 data bytes
64 bytes from 3.92.125.41: icmp_seq=0 ttl=237 time=131.497 ms
64 bytes from 3.92.125.41: icmp_seq=1 ttl=237 time=132.722 ms
64 bytes from 3.92.125.41: icmp_seq=2 ttl=237 time=127.519 ms
64 bytes from 3.92.125.41: icmp_seq=3 ttl=237 time=132.185 ms
64 bytes from 3.92.125.41: icmp_seq=4 ttl=237 time=127.970 ms
64 bytes from 3.92.125.41: icmp_seq=5 ttl=237 time=127.687 ms
64 bytes from 3.92.125.41: icmp_seq=6 ttl=237 time=127.427 ms
64 bytes from 3.92.125.41: icmp_seq=7 ttl=237 time=132.587 ms
64 bytes from 3.92.125.41: icmp_seq=8 ttl=237 time=127.452 ms

@tbelcher
Copy link
Author

Thank you for the reply.

I'm in the US and have a 400Mb/20Mb connection.

When I ping I am able to hit the server:
PING vesyncappapi-1834200178.us-east-1.elb.amazonaws.com (54.165.108.196) 56(84) bytes of data.
64 bytes from ec2-54-165-108-196.compute-1.amazonaws.com (54.165.108.196): icmp_seq=1 ttl=234 time=75.3 ms
64 bytes from ec2-54-165-108-196.compute-1.amazonaws.com (54.165.108.196): icmp_seq=2 ttl=234 time=76.6 ms
64 bytes from ec2-54-165-108-196.compute-1.amazonaws.com (54.165.108.196): icmp_seq=3 ttl=234 time=83.6 ms
64 bytes from ec2-54-165-108-196.compute-1.amazonaws.com (54.165.108.196): icmp_seq=4 ttl=234 time=75.6 ms
64 bytes from ec2-54-165-108-196.compute-1.amazonaws.com (54.165.108.196): icmp_seq=5 ttl=234 time=75.6 ms
64 bytes from ec2-54-165-108-196.compute-1.amazonaws.com (54.165.108.196): icmp_seq=6 ttl=234 time=76.0 ms
64 bytes from ec2-54-165-108-196.compute-1.amazonaws.com (54.165.108.196): icmp_seq=7 ttl=234 time=75.5 ms

There is nothing in the log from the plug-in after what I posted and immediately before are:
[1/27/2022, 2:13:57 PM] [Levoit Air Purifiers] Connecting to the servers...
Jan 27 14:13:57 raspberrypi homebridge[24430]: [1/27/2022, 2:13:57 PM] [Levoit Air Purifiers] [DEBUG]: [START SESSION] Starting auth session...
Jan 27 14:13:57 raspberrypi homebridge[24430]: [1/27/2022, 2:13:57 PM] [Levoit Air Purifiers] [DEBUG]: [LOGIN] Logging in...

@RaresAil
Copy link
Owner

Hey, i will change add a setting to can add your own timeout limit (over 15s) and you should set that setting higher like 30s - 60s, if the login still fails, is nothing that i can do 😞, because the error is from their server which is not responding to the login command

@tbelcher
Copy link
Author

Thank you.

Is it possible to get the syntax of the command it uses to login so that I can experiment on my end?

Tim

@RaresAil
Copy link
Owner

RaresAil commented Jan 31, 2022

Sure, go in api/VeSync.ts line 187 in the login function, and you have a axios.post … v1/user/#. Let me know if you have any luck 😃

@tbelcher
Copy link
Author

tbelcher commented Feb 4, 2022

It's working now after I changed two values in VeSync.js inside usr/local/lib/node_modules/homebridge-levoit-air-purifier/dist/api

In getDevices I changed await delay(500) to (1500)

and

in class VeSync
this.AXIOS_OPTIONS = {
baseURL: 'https://smartapi.vesync.com',
timeout: 15000 <-------changed to 30000

Working without issue.

Tim

@RaresAil
Copy link
Owner

RaresAil commented Feb 5, 2022

Alright, i will implement this in the next update which will be this weekend

@RaresAil
Copy link
Owner

RaresAil commented Feb 6, 2022

@tbelcher The update is released.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants