tplink-smarthome-api icon indicating copy to clipboard operation
tplink-smarthome-api copied to clipboard

ECONNREFUSED errors

Open probins opened this issue 3 years ago • 12 comments

I'm new to this stuff, so may well be missing something obvious.

I bought a HS110 a month ago, set it up with the Kasa app, and then used this api with it. This worked well, so I bought 2 more, and they also work well. A couple of days ago, my original one stopped working with this api, generating ECONNREFUSED errors, for example when running client.getDevice() for that host. The Kasa app however continues to work fine with all 3 plugs. I ran nmap -F for the IP address, and it tells me that the only port open is port 80. The others have 9999 open but not 80.

AIUI, both the Kasa app and this api use 9999, so I'm puzzled as to how the Kasa app continues to work without it. I tried deleting the plug in the Kasa app, and then recreating, but the same happens.

Can anyone tell me what is causing this, and/or whether I can manually configure the plug so the expected port is available for the api to use.

probins avatar Nov 18 '20 11:11 probins

Are you in the UK?

plasticrake avatar Nov 19 '20 00:11 plasticrake

yes

probins avatar Nov 19 '20 08:11 probins

https://github.com/plasticrake/homebridge-tplink-smarthome/issues/154

plasticrake avatar Nov 19 '20 15:11 plasticrake

yeah, thanks, that seems to be the problem. The one that no longer works is on 1.1.0; the other 2 are on 1.0.4. Very irritating. Suppose I have to wait for some clever person to work out a fix.

Don't know if it's relevant, but the one that no longer works was shipped from Switzerland; the other 2 I bought from Amazon UK

probins avatar Nov 19 '20 17:11 probins

It appears that tplink is downgrading firmware for users who ask. I hope to have support for the new firmware soon, as it appears some people have been able to figure it out already. Hard to do since I'm not in the UK so I have no devices to test with.

Check this issue thread for some details on how to potentially downgrade firmware: https://github.com/home-assistant/core/issues/43088

plasticrake avatar Nov 19 '20 18:11 plasticrake

From that link and the link there to a thread on tplink's support site, it seems they've said they can downgrade, but haven't actually said how to do that. If there's a fix, then that would be a better solution, I think. Do you know why this issue only affects UK users? It's a Chinese company, right?

I'm interested in energy monitoring, and I'm on a Time of Use tariff, where the price changes every half hour to match wholesale prices. The Kasa app is useless for that, but I can use your api to read/log the cumulative kW every 30 mins.

probins avatar Nov 19 '20 22:11 probins

@probins HW 4.1 is only available in the UK I think, so far it's only the Hardware revision 4.1 plugs (that I know of) that have gotten this particular firmware version.

I have some older V1 and V2.1 plugs, which did not get this update, they look identical but I guess the insides have changed.

dragon2611 avatar Nov 22 '20 15:11 dragon2611

yes, the plugs I have are all hardware version 4.1

probins avatar Nov 22 '20 17:11 probins

Appears you need to send you MAC address and hardware version to TPLink. Not sure whether to do this, as support for the new protocol does appear close.

Justanotherhomosapien avatar Nov 24 '20 11:11 Justanotherhomosapien

They have mine although as of yet they haven't done anything with it, they also asked for a screenshot of Kasa showing the wrong timezone following a reset, which I was less than amused with given they already have a screenshot of that screen

dragon2611 avatar Nov 24 '20 12:11 dragon2611

From that link and the link there to a thread on tplink's support site, it seems they've said they can downgrade, but haven't actually said how to do that. If there's a fix, then that would be a better solution, I think. Do you know why this issue only affects UK users? It's a Chinese company, right?

I'm interested in energy monitoring, and I'm on a Time of Use tariff, where the price changes every half hour to match wholesale prices. The Kasa app is useless for that, but I can use your api to read/log the cumulative kW every 30 mins.

Thanks for raising this, I am in Ireland and I have the same issue, all my three plugs stopped working a couple of weeks ago, I only got around to investigating now. All have gotten a firmware upgrade to 1.1.0. As a side note the upgrade nearly gave me a heart attack, I use them for lamps and my bedroom lamped turned itself on and off again at 3am one night. At least I'm guessing that was the upgrade and not some poltergeist

jamesbuckley avatar Nov 26 '20 09:11 jamesbuckley

update, anyone? There seems to have been mixed success getting TPLink to downgrade the firmware, but on the positive side they don't seem to have upgraded either of my working plugs. python-kasa seems to be at least partly working.

probins avatar Feb 05 '21 14:02 probins