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

ECONNRESET during startup with HS300 power strip #338

Open
1 task done
Tom-Dibble opened this issue Feb 13, 2024 · 11 comments
Open
1 task done

ECONNRESET during startup with HS300 power strip #338

Tom-Dibble opened this issue Feb 13, 2024 · 11 comments
Labels

Comments

@Tom-Dibble
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

On HomeBridge restart, I get errors like the following:

What, if anything, has recently changed?

Issue showed up on initial install (and each restart of HomeBridge after that). The HS300 is a 6-outlet strip; the error appears for two of the 6 outlets (note that all six are on and under load).

[2/12/2024, 8:55:58 PM] [KasaSmart.API] TCP [[ip address]]:9999 Error: connect ECONNRESET [[ip address]]:9999
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'connect',
  address: '[[ip address]]',
  port: 9999
}

Note that [[ip address]], [[uuid]] and [[id]] have been used throughout to mask off ip addresses, uuids, and device ids, respectively; contact me if the non-masked values are relevant.

Interestingly, in 4 restarts of HomeBridge the two outlets in the log below (these are outlets 1 and 6 on the strip) 3 times; the third restart a different two outlets gave the same errors (outlets 5 and 4 on the strip).

After startup, all outlets appear to be exposed in HomeKit, and even the extra power-usage value is available for them in the Eve app. Other than the errors in the logs, I don't see any issues with them.

Version

v8.0.2

Node Version

v18.19.0

Homebridge Version

1.7.0

Which OS/Platform?

Docker (Linux)

Relevant log output

[2/12/2024, 8:55:36 PM] [Homebridge UI] Changes to config.json saved.
[2/12/2024, 8:55:42 PM] [Homebridge UI] Homebridge restart request received
[2/12/2024, 8:55:42 PM] [Homebridge UI] UI / Bridge settings have not changed; only restarting Homebridge process
[2/12/2024, 8:55:42 PM] [Homebridge UI] Sending SIGTERM to Homebridge
[2/12/2024, 8:55:42 PM] Got SIGTERM, shutting down Homebridge...
[2/12/2024, 8:55:47 PM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[2/12/2024, 8:55:52 PM] [HB Supervisor] Restarting Homebridge...
[2/12/2024, 8:55:52 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /var/lib/homebridge/node_modules --strict-plugin-resolution
[2/12/2024, 8:55:52 PM] [HB Supervisor] Started Homebridge v1.7.0 with PID: 25488
[2/12/2024, 8:55:54 PM] Loaded config.json with 3 accessories and 4 platforms.
[2/12/2024, 8:55:54 PM] Loaded 9 cached accessories from cachedAccessories.
[2/12/2024, 8:55:54 PM] ---
[...]
[2/12/2024, 8:55:55 PM] Loaded plugin: [email protected]
[2/12/2024, 8:55:55 PM] Registering platform 'homebridge-tplink-smarthome.TplinkSmarthome'
[2/12/2024, 8:55:55 PM] ---
[2/12/2024, 8:55:55 PM] Loading 4 platforms...
[...]
[2/12/2024, 8:55:56 PM] [KasaSmart] Configuring cached accessory: [Terrarium Top Lamp] UUID: [[uuid]] deviceId: [[id]] 
[2/12/2024, 8:55:56 PM] [KasaSmart] Configuring cached accessory: [Terrarium Bottom Left Light] UUID: [[uuid]] deviceId: [[id]] 
[2/12/2024, 8:55:56 PM] [KasaSmart] Configuring cached accessory: [Terrarium Bottom Right Light] UUID: [[uuid]] deviceId: [[id]] 
[2/12/2024, 8:55:56 PM] [KasaSmart] Configuring cached accessory: [Terrarium Bottom LED Strips] UUID: [[uuid]] deviceId: [[id]] 
[2/12/2024, 8:55:56 PM] [KasaSmart] Configuring cached accessory: [Terrarium Bottom Heater] UUID: [[uuid]] deviceId: [[id]] 
[2/12/2024, 8:55:56 PM] [KasaSmart] Configuring cached accessory: [Terrarium Top Heaters] UUID: [[uuid]] deviceId: [[id]]
[...]
[2/12/2024, 8:55:56 PM] Homebridge v1.7.0 (HAP v0.11.1) (Homebridge 3B11) is running on port 51899.
[2/12/2024, 8:55:56 PM] [KasaSmart] Device First Online: [Terrarium Top Lamp] plug [[[id]]] [[ip address]] 9999
[2/12/2024, 8:55:56 PM] [KasaSmart] Adding: [Terrarium Top Lamp] plug [[[id]]]
[2/12/2024, 8:55:56 PM] [KasaSmart] [Terrarium Top Lamp] Removing stale Characteristic: [Outlet.Brightness] uuid:[[[uuid]]]
[2/12/2024, 8:55:56 PM] [KasaSmart] Device First Online: [Terrarium Bottom Left Light] plug [[[id]]] [[ip address]] 9999
[2/12/2024, 8:55:56 PM] [KasaSmart] Adding: [Terrarium Bottom Left Light] plug [[[id]]]
[2/12/2024, 8:55:56 PM] [KasaSmart] [Terrarium Bottom Left Light] Removing stale Characteristic: [Outlet.Brightness] uuid:[[[uuid]]]
[2/12/2024, 8:55:56 PM] [KasaSmart] Device First Online: [Terrarium Bottom Right Light] plug [[[id]]] [[ip address]] 9999
[2/12/2024, 8:55:56 PM] [KasaSmart] Adding: [Terrarium Bottom Right Light] plug [[[id]]]
[2/12/2024, 8:55:56 PM] [KasaSmart] [Terrarium Bottom Right Light] Removing stale Characteristic: [Outlet.Brightness] uuid:[[[uuid]]]
[2/12/2024, 8:55:56 PM] [KasaSmart] Device First Online: [Terrarium Bottom LED Strips] plug [[[id]]] [[ip address]] 9999
[2/12/2024, 8:55:56 PM] [KasaSmart] Adding: [Terrarium Bottom LED Strips] plug [[[id]]]
[2/12/2024, 8:55:56 PM] [KasaSmart] [Terrarium Bottom LED Strips] Removing stale Characteristic: [Outlet.Brightness] uuid:[[[uuid]]]
[2/12/2024, 8:55:56 PM] [KasaSmart] Device First Online: [Terrarium Bottom Heater] plug [[[id]]] [[ip address]] 9999
[2/12/2024, 8:55:56 PM] [KasaSmart] Adding: [Terrarium Bottom Heater] plug [[[id]]]
[2/12/2024, 8:55:56 PM] [KasaSmart] [Terrarium Bottom Heater] Removing stale Characteristic: [Outlet.Brightness] uuid:[[[uuid]]]
[2/12/2024, 8:55:56 PM] [KasaSmart] Device First Online: [Terrarium Top Heaters] plug [[[id]]] [[ip address]] 9999
[2/12/2024, 8:55:56 PM] [KasaSmart] Adding: [Terrarium Top Heaters] plug [[[id]]]
[2/12/2024, 8:55:56 PM] [KasaSmart] [Terrarium Top Heaters] Removing stale Characteristic: [Outlet.Brightness] uuid:[[[uuid]]]
[...]
[2/12/2024, 8:55:58 PM] [KasaSmart.API] TCP [[ip address]]:9999 Error: connect ECONNRESET [[ip address]]:9999
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'connect',
  address: '[[ip address]]',
  port: 9999
}
[2/12/2024, 8:55:58 PM] [KasaSmart.API] [Terrarium Top Heaters] device.send() Error: connect ECONNRESET [[ip address]]:9999
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'connect',
  address: '[[ip address]]',
  port: 9999
}
[2/12/2024, 8:55:58 PM] [KasaSmart] [Terrarium Top Heaters] {"errno":-104,"code":"ECONNRESET","syscall":"connect","address":"[[ip address]]","port":9999}
[2/12/2024, 8:55:58 PM] [KasaSmart] [Terrarium Top Heaters] {"errno":-104,"code":"ECONNRESET","syscall":"connect","address":"[[ip address]]","port":9999}
[2/12/2024, 8:55:58 PM] [KasaSmart.API] TCP [[ip address]]:9999 Error: connect ECONNRESET [[ip address]]:9999
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'connect',
  address: '[[ip address]]',
  port: 9999
}
[2/12/2024, 8:55:58 PM] [KasaSmart.API] [Terrarium Top Heaters] device.send() Error: connect ECONNRESET [[ip address]]:9999
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'connect',
  address: '[[ip address]]',
  port: 9999
}
[2/12/2024, 8:55:58 PM] [KasaSmart] [Terrarium Top Heaters] {"errno":-104,"code":"ECONNRESET","syscall":"connect","address":"[[ip address]]","port":9999}
[2/12/2024, 8:55:58 PM] [KasaSmart] [Terrarium Top Heaters] {"errno":-104,"code":"ECONNRESET","syscall":"connect","address":"[[ip address]]","port":9999}
[2/12/2024, 8:55:58 PM] [KasaSmart] [Terrarium Top Heaters] {"errno":-104,"code":"ECONNRESET","syscall":"connect","address":"[[ip address]]","port":9999}
[2/12/2024, 8:55:58 PM] [KasaSmart] [Terrarium Top Heaters] {"errno":-104,"code":"ECONNRESET","syscall":"connect","address":"[[ip address]]","port":9999}
[2/12/2024, 8:55:58 PM] [KasaSmart] [Terrarium Top Heaters] {"errno":-104,"code":"ECONNRESET","syscall":"connect","address":"[[ip address]]","port":9999}
[2/12/2024, 8:55:58 PM] [KasaSmart.API] TCP [[ip address]]:9999 Error: TCP Socket Closed. segment:0 hadError:false
    at Socket.<anonymous> (/homebridge/node_modules/homebridge-tplink-smarthome/node_modules/tplink-smarthome-api/src/network/tcp-socket.ts:128:19)
    at Object.onceWrapper (node:events:632:26)
    at Socket.emit (node:events:517:28)
    at TCP.<anonymous> (node:net:350:12)
[2/12/2024, 8:55:58 PM] [KasaSmart.API] [Terrarium Top Lamp] device.send() Error: TCP Socket Closed. segment:0 hadError:false
    at Socket.<anonymous> (/homebridge/node_modules/homebridge-tplink-smarthome/node_modules/tplink-smarthome-api/src/network/tcp-socket.ts:128:19)
    at Object.onceWrapper (node:events:632:26)
    at Socket.emit (node:events:517:28)
    at TCP.<anonymous> (node:net:350:12)
[2/12/2024, 8:55:58 PM] [KasaSmart] [Terrarium Top Lamp] {}
[2/12/2024, 8:55:58 PM] [KasaSmart] [Terrarium Top Lamp] {}

Configuration

{
    "name": "KasaSmart",
    "addCustomCharacteristics": true,
    "inUseThreshold": 0,
    "deviceTypes": [
        "plug",
        "bulb"
    ],
    "devicesUseDiscoveryPort": false,
    "platform": "TplinkSmarthome"
}
@Tom-Dibble Tom-Dibble added the bug label Feb 13, 2024
@LazaroFilm
Copy link

Same issue here. This started happening a few days ago.

@shaarkys
Copy link

shaarkys commented Mar 5, 2024

Isn't that same error as described #246 ?

@ZeliardM
Copy link

I changed over to UDP communication and the errors have gone away.

@roberkane212
Copy link

@ZeliardM how did you do so?

@owine
Copy link

owine commented Mar 12, 2024

I changed over to UDP communication and the errors have gone away.

So far, I can confirm this does indeed silence the errors. Thanks for sharing it.

@ZeliardM how did you do so?

In Plugin Config, under Advanced Settings flip Transport from None to UDP and restart Homebridge or the child bridge.

@roberkane212
Copy link

@owine thank you!!

@ZeliardM
Copy link

Thanks @owine!

@LazaroFilm
Copy link

I changed over to UDP communication and the errors have gone away.

So far, I can confirm this does indeed silence the errors. Thanks for sharing it.

@ZeliardM how did you do so?

In Plugin Config, under Advanced Settings flip Transport from None to UDP and restart Homebridge or the child bridge.

I have done this. it seems to happen less frequently but is still happening. Restarting HomeBridge seems to solve it.

@Slycamer
Copy link

Jsut wanted to add that this issue still exists and no amount of "restart the homebridge" fixes it

@peterbinks
Copy link

FWIW changing to UDP communication has seemingly solved the errors for me

@Slycamer
Copy link

Slycamer commented Dec 11, 2024

FWIW changing to UDP communication has seemingly solved the errors for me

Have no idea how that works for you since I get this:

UDP 10.0.9.160:9999 Error: UDP Timeout after 15000ms
10.0.9.160:9999 {"smartlife.iot.common.emeter":{"get_realtime":{}}}
at Timeout._onTimeout (/var/lib/homebridge/node_modules/homebridge-tplink-smarthome/node_modules/tplink-smarthome-api/src/network/udp-socket.ts:64:15)
at listOnTimeout (node:internal/timers:594:17)
at processTimers (node:internal/timers:529:7)

Like... a LOT

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

No branches or pull requests

8 participants