seydx / homebridge-sonybravia-platform

Sony Android TV Platform for Homebridge
MIT License
22 stars 0 forks source link

v2.3 can get stuck on launch #8

Closed epheterson closed 6 years ago

epheterson commented 6 years ago

In v2.3 I started seeing this, it's happened twice so far and I have to wait, or remove my cachedAccessories to resolve it.

It hit it after trying to use the new CEC feature, then launching homebridge while the TV was off. I'm attempting to turn to the CEC while the TV is off, and it crashes. After that, sometimes, on subsequent launches of homebridge I'll hit this issue.

[2018-3-25 22:07:24] [Sony] { Error: connect ECONNREFUSED 192.168.0.18:80
    at Object.exports._errnoException (util.js:1024:11)
    at exports._exceptionWithHostPort (util.js:1047:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1150:14)
  code: 'ECONNREFUSED',
  errno: 'ECONNREFUSED',
  syscall: 'connect',
  address: '192.168.0.18',
  port: 80 }
[2018-3-25 22:07:34] [Sony] Getting apps...
[2018-3-25 22:07:34] [Sony] Error: Failed to load data, status code: 404
    at ClientRequest.<anonymous> (/Users/elp/.nvm/versions/node/v7.6.0/lib/node_modules/homebridge-sonybravia-platform/index.js:104:28)
    at Object.onceWrapper (events.js:316:30)
    at emitOne (events.js:115:13)
    at ClientRequest.emit (events.js:210:7)
    at HTTPParser.parserOnIncomingClient (_http_client.js:565:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)
    at Socket.socketOnData (_http_client.js:454:20)
    at emitOne (events.js:115:13)
    at Socket.emit (events.js:210:7)
    at addChunk (_stream_readable.js:252:12)
[2018-3-25 22:07:44] [Sony] Getting apps...
[2018-3-25 22:07:44] [Sony] Error: Failed to load data, status code: 404
    at ClientRequest.<anonymous> (/Users/elp/.nvm/versions/node/v7.6.0/lib/node_modules/homebridge-sonybravia-platform/index.js:104:28)
    at Object.onceWrapper (events.js:316:30)
    at emitOne (events.js:115:13)
    at ClientRequest.emit (events.js:210:7)
    at HTTPParser.parserOnIncomingClient (_http_client.js:565:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)
    at Socket.socketOnData (_http_client.js:454:20)
    at emitOne (events.js:115:13)
    at Socket.emit (events.js:210:7)
    at addChunk (_stream_readable.js:252:12)
[2018-3-25 22:07:54] [Sony] Getting apps...
seydx commented 6 years ago

The TV is overwhelmed with the requests and because of this you get sometimes "ECONNREFUSED"

what i can to try is to cache the information for hdmi inputs and cec devices to reduce the requests AFTER the first start of homebridge

seydx commented 6 years ago

v2.3.1 is online

I added new cache functions to apps, inputs, cec devices and extra inputs.

So after first start of homebridge, all information will be cached and if you want to refresh the data, just delete the file in the persist folder OR i.e. for apps you can use the "Applist" button within the EVE app to refresh the stored app list

seydx commented 6 years ago

can you try the latest version and give some feedback pls

epheterson commented 6 years ago

So far it has not reproduced, thanks!