plasticrake / homebridge-tplink-smarthome

TP-Link Smarthome Plugin for Homebridge
MIT License
468 stars 69 forks source link

Stopped working from Homebridge `ECONNREFUSED` #257

Open levydanqc opened 2 years ago

levydanqc commented 2 years ago

Is there an existing issue for this?

What happened?

Out of nowhere, I'm now not able anymore to control my plug.

There's this error in the log and it's weird because the IP adress that it is showing is one of my computer (not even the one with homebridge) and not the plug...

I don't know why.

I tried upgrading the the latest v7.1.0, but it's the same.

Also I'm still able to control the plugs from the Kasa App, so it really is from homebdrige.

What, if anything, has recently changed?

Nothing's changed. It just happened out of nowhere...

Version

v7.1.0-next.0 / v7.0.1

Node Version

v16.14.0

Homebridge Version

v1.4.0

Which OS/Platform?

Linux

Relevant log output

[3/23/2022, 12:56:39 AM] [TplinkSmarthome.API] TCP 192.[...]:9999 Error: connect ECONNREFUSED 192.[...]:9999
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '192.[...]',
  port: 9999
}
[3/23/2022, 12:56:39 AM] [TplinkSmarthome.API] [Lampe] device.send() Error: connect ECONNREFUSED 192.[...]:9999
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '192.[...]',
  port: 9999
}
[3/23/2022, 12:56:39 AM] [TplinkSmarthome] [Lampe] {"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"192.[...]","port":9999}

Configuration

{
    "name": "TplinkSmarthome",
    "addCustomCharacteristics": true,
    "switchModels": [
        "HS103"
    ],
    "deviceTypes": [
        "plug",
        "bulb"
    ],
    "_bridge": {
        "username": "[...],
        "port": [...]
    },
    "platform": "TplinkSmarthome"
}
EricSabe commented 2 years ago

+1 for all of my TPLink devices.

EricSabe commented 2 years ago

I set up one of my switches for manual discovery and now it's controllable from HB. Now only dozens more to do. 😐

phydeauxfilms commented 2 years ago

Have this same problem. Seems to trigger when I access my eufy security devices. Tried the manual discovery for all my devices with no joy. Was testing before sending this and could get it working fine until I checked the connection on the eufy cameras (which aren't connected to the bridge at all BTW). Been struggling with this for days. Started from scratch several times. Ditched my Hoobs install and started fresh with a Homebridge install. Split my network in two. Added separate router and extender. Tracked down all 70ish devices (most not TP-link) and spread them over two networks. This seems to be the culprit. The TP-link system and the eufy system seem to conflict. Still getting this error. Not sure what to do at this point because when it triggers, my cameras go off line and I can't control any TP-link devices. So if I hear a noise at night I want to do two things: check the cameras and turn on the light. Anyway, here is a sample of the error messages: [11/05/2022, 14:33:51] [TplinkSmarthome] [Living Room South] set [On] [11/05/2022, 14:33:51] [TplinkSmarthome] [Living Room South] Error: connect EHOSTUNREACH 10.0.1.115:9999 [11/05/2022, 14:33:54] [TplinkSmarthome.API] TCP 10.0.1.135:9999 Error: connect EHOSTUNREACH 10.0.1.135:9999 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) { errno: -113, code: 'EHOSTUNREACH', syscall: 'connect', address: '10.0.1.135', port: 9999 } [11/05/2022, 14:33:54] [TplinkSmarthome.API] [Living Room North] device.send() Error: connect EHOSTUNREACH 10.0.1.135:9999 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) { errno: -113, code: 'EHOSTUNREACH', syscall: 'connect', address: '10.0.1.135', port: 9999 }

phydeauxfilms commented 2 years ago

I don't know why or what I did, but the system has been stable since a few hours after I posted this. Maybe I had too many things on one router. Maybe the range extender I was using was over loaded. Maybe the magical network fairies took a liking to me... Everything seems to be working now. Set up two routers, with separate domain ranges, and DHCP servers and reserved each device its very own IP address so I could use manual discovery and it has been stable all night.

Edit to add: Spoke too soon. Literally just after I pressed the comment button I checked the cameras and the logs and got an error again. Still seems more stable than it was before I started this.

EricSabe commented 2 years ago

I think the magical fairies are temperamental.

phydeauxfilms commented 2 years ago

I think the magical fairies are temperamental.

LOL, That they are. Before I totally reorganized my network I was able to trigger it on command by checking the eufy cameras and operating some Tplink switches at the same time. Now it's much less often and I can't even trigger it at the moment. Last error was at 9:30 am this morning. It may just be an overloaded network combined with home bridge, a Pi-hole, and a neighborhood that has 116 Wifi networks within range of my apartment (true story, I checked wifi explorer). IDK. Just glad it's working at the moment.