question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slow login. Using ewelink-api is much slower than using ewelink app on mobile.

See original GitHub issue

Not so much of an issue but an observation and a request to update the documentation.

What I have found is that when I use ewelink-api to access the devices via the cloud it takes a long time to open and fetch information about the devices, eg: connection = new ewelink({ email: config.ewelink.email, password: config.ewelink.password }); . . . devices = await connection.getDevices(); console.log(devices);

Running this takes nearly 6 seconds (and longer sometimes): $ time bin/fetchDevices.js real 0m5.816s user 0m1.349s sys 0m0.084s

Occasionally it failed to connect and I noticed that the host it was trying to connect to was the US server, ie: https://us-api.coolkit.cc:8080

This made me think, what if this is the default login is the us server so I changed the Class Instantiation to include my region: connection = new ewelink({ email: config.ewelink.email, password: config.ewelink.password, region: "eu" });

sure enough: $ time bin/fetchDevices.js real 0m1.930s user 0m1.331s sys 0m0.088s

Could you update the documentation to require the region be included in the Class Instantiation API as it affects performance.

This is also why I think the alternative connection is failing as they are sometimes connecting to the wrong server for where a user is registered. ie add the region as a required parameter when using the ‘access token’ or ‘api key’.

Only had a switch and socket a few days but so far I’ve had more success with your library than all the others I’ve tried, I just want a simple library not a whole automation system.

I noticed you’ve commented on LAN mode which is what I’m really after, I’ll start moving that way soon as I’d rather not be using the cloud to store what’s happening in my house and I want it to work when the internet is down.

pinging US server: $ ping -c 10 us-api.coolkit.cc PING us-api.coolkit.cc (13.57.86.90) 56(84) bytes of data. 64 bytes from ec2-13-57-86-90.us-west-1.compute.amazonaws.com (13.57.86.90): icmp_seq=1 ttl=35 time=163 ms . . . --- us-api.coolkit.cc ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 9009ms rtt min/avg/max/mdev = 162.212/165.930/177.053/4.508 ms

pinging EU server: $ ping -c 10 eu-api.coolkit.cc PING eu-api.coolkit.cc (52.57.118.192) 56(84) bytes of data. 64 bytes from ec2-52-57-118-192.eu-central-1.compute.amazonaws.com (52.57.118.192): icmp_seq=1 ttl=41 time=41.5 ms . . . --- eu-api.coolkit.cc ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 9013ms rtt min/avg/max/mdev = 39.034/42.012/43.908/1.710 ms

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
ttz642commented, Jun 9, 2020

I’ve split my application into services that run constantly and thus only connect once, or reconnect on error.

www - operator interface to control panel to show/change state of devices & edit switching table events - captures events from the devices (via the cloud at the moment, looking to implement over LAN) lanSwitcher - process to change device state scheduler - changes device state according to the switching table which has state of devices over complete day in 5 min slots

I use REST (ie web services) to send messages between services.

Might package up one day and upload to github when I get the time.

interface to control panel to show/change state of devices Screenshot at 2020-06-09 14-57-14

edit switching table Screenshot at 2020-06-09 14-56-22

service logs Screenshot at 2020-06-09 14-57-51

1reaction
ttz642commented, Jun 9, 2020

I’m in south america, the app works instantaneously, but the API takes up to 15-20 secs to toggle on/off any device. Im using the correct region. Also, i tried with other regions, and no better results… any advice to get lower delay?

Do you log in each time or have you got an application running which only logs in once?

Read more comments on GitHub >

github_iconTop Results From Across the Web

eWeLink Smart Home Integrations - IFTTT
Integrate eWeLink Smart Home with your favorite apps & devices to unlock powerful automations. See how you can connect eWeLink Smart Home with...
Read more >
Is it possible to use the same eWeLink account on multiple ...
Yes, more devices is theoretically less secure but I'd leave it to the discretion of the user because single device access limits eWeLink's...
Read more >
Sonoff /eWeLink component for original firmware
For more infos: a Sonoff POW with 2.6.1 firmware version works fine, ... Sonoff (eWeLink app), refresh rate of POW R2 sensors are...
Read more >
eWeLink & Sonoff User Group | - Facebook
Hi all, I know this question has come up before but I can't seem to solve it. I use the Google Mesh Wifi...
Read more >
Top Reasons Why Your Mobile App is Slow and How to Fix it
In order to fix the problem, you have to check the network speed all the time and see when the app slows down....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found