MortJC / homebridge-platform-orbit

Orbit Irrigation System platform plugin for HomeBridge
MIT License
34 stars 6 forks source link

I have an issue... it is my system problem or a bug? #28

Closed platini76 closed 3 years ago

platini76 commented 3 years ago

[4/12/2020, 02:31:55] [B-Hyve Irrigazione] WebSocket Error ErrorEvent { target: ReconnectingWebSocket { _listeners: { error: [Array], message: [Array], open: [Array], close: [] }, _retryCount: 1, _shouldReconnect: true, _connectLock: false, _binaryType: 'blob', _closeCalled: false, _messageQueue: [ '{"event":"ping"}' ], onclose: null, onerror: null, onmessage: null, onopen: null, _handleOpen: [Function (anonymous)], _handleMessage: [Function (anonymous)], _handleError: [Function (anonymous)], _handleClose: [Function (anonymous)], _url: 'https://api.orbitbhyve.com/v1/events', _protocols: [], _options: { WebSocket: [Function], connectionTimeout: 10000, maxReconnectionDelay: 64000, minReconnectionDelay: 2000, reconnectionDelayGrowFactor: 2 }, send: [Function (anonymous)], _ws: WebSocket { _events: [Object: null prototype] {}, _eventsCount: 0, _maxListeners: undefined, readyState: 2, protocol: '', _binaryType: 'nodebuffer', _closeFrameReceived: false, _closeFrameSent: false, _closeMessage: '', _closeTimer: null, _closeCode: 1006, _extensions: {}, _receiver: null, _sender: null, _socket: null, _bufferedAmount: 0, _isServer: false, _redirects: 0, url: 'https://api.orbitbhyve.com/v1/events', _req: [ClientRequest],

},
_connectTimeout: Timeout {
  _idleTimeout: -1,
  _idlePrev: null,
  _idleNext: null,
  _idleStart: 331364,
  _onTimeout: null,
  _timerArgs: undefined,
  _repeat: null,
  _destroyed: true,
  [Symbol(refed)]: true,
  [Symbol(kHasPrimitive)]: false,
  [Symbol(asyncId)]: 207929,
  [Symbol(triggerId)]: 0
},
_uptimeTimeout: Timeout {
  _idleTimeout: 5000,
  _idlePrev: null,
  _idleNext: null,
  _idleStart: 70514,
  _onTimeout: null,
  _timerArgs: undefined,
  _repeat: null,
  _destroyed: true,
  [Symbol(refed)]: true,
  [Symbol(kHasPrimitive)]: false,
  [Symbol(asyncId)]: 1580,
  [Symbol(triggerId)]: 1057
}

}, type: 'error', message: 'TIMEOUT', error: Error: TIMEOUT at ReconnectingWebSocket._handleTimeout (/usr/lib/node_modules/homebridge-platform-orbit/node_modules/reconnecting-websocket/dist/reconnecting-websocket-cjs.js:529:42) at Timeout. (/usr/lib/node_modules/homebridge-platform-orbit/node_modules/reconnecting-websocket/dist/reconnecting-websocket-cjs.js:524:75) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7)

MortJC commented 3 years ago

Are you running the latest version of the plugin?

Looks like you can't connect to https://api.orbitbhyve.com/v1/events from your system.

On Fri, Dec 4, 2020 at 12:33 PM platini76 notifications@github.com wrote:

[4/12/2020, 02:31:55] [B-Hyve Irrigazione] WebSocket Error ErrorEvent { target: ReconnectingWebSocket { _listeners: { error: [Array], message: [Array], open: [Array], close: [] }, _retryCount: 1, _shouldReconnect: true, _connectLock: false, _binaryType: 'blob', _closeCalled: false, _messageQueue: [ '{"event":"ping"}' ], onclose: null, onerror: null, onmessage: null, onopen: null, _handleOpen: [Function (anonymous)], _handleMessage: [Function (anonymous)], _handleError: [Function (anonymous)], _handleClose: [Function (anonymous)], _url: 'https://api.orbitbhyve.com/v1/events', _protocols: [], _options: { WebSocket: [Function], connectionTimeout: 10000, maxReconnectionDelay: 64000, minReconnectionDelay: 2000, reconnectionDelayGrowFactor: 2 }, send: [Function (anonymous)], _ws: WebSocket { _events: [Object: null prototype] {}, _eventsCount: 0, _maxListeners: undefined, readyState: 2, protocol: '', _binaryType: 'nodebuffer', _closeFrameReceived: false, _closeFrameSent: false, _closeMessage: '', _closeTimer: null, _closeCode: 1006, _extensions: {}, _receiver: null, _sender: null, _socket: null, _bufferedAmount: 0, _isServer: false, _redirects: 0, url: 'https://api.orbitbhyve.com/v1/events', _req: [ClientRequest],

}, _connectTimeout: Timeout { _idleTimeout: -1, _idlePrev: null, _idleNext: null, _idleStart: 331364, _onTimeout: null, _timerArgs: undefined, _repeat: null, _destroyed: true,

}, _uptimeTimeout: Timeout { _idleTimeout: 5000, _idlePrev: null, _idleNext: null, _idleStart: 70514, _onTimeout: null, _timerArgs: undefined, _repeat: null, _destroyed: true,

} }, type: 'error', message: 'TIMEOUT', error: Error: TIMEOUT at ReconnectingWebSocket._handleTimeout (/usr/lib/node_modules/homebridge-platform-orbit/node_modules/reconnecting-websocket/dist/reconnecting-websocket-cjs.js:529:42) at Timeout. (/usr/lib/node_modules/homebridge-platform-orbit/node_modules/reconnecting-websocket/dist/reconnecting-websocket-cjs.js:524:75) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MortJC/homebridge-platform-orbit/issues/28, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN5E4TXXO66LFE6XKLCO7ULSTA4AHANCNFSM4UMZCHPQ .

idsnowghost commented 3 years ago

I have this same issue on latest version. Any resolution?

It appeared randomly on a Homebridge restart after running the plugin previously successfully. Errors on every boot of Homebridge now, and plugin doesn't work as a result.

idsnowghost commented 3 years ago

It seems like the websocket is timing out when loading the plugin upon starting up Homebridge. Is it possible to attempt this initial connection more than once? I'm running Homebridge on a slower SBC and it takes awhile (5~ minutes) to fully load up Homebridge.

I've found a workaround: Load the plugin as a child bridge, then kill the process once Homebridge is fully loaded and CPU utilization drops below 100%. Then the child bridge restarts and plugin loads, connects to the Orbitbhyve API as normal. Everything works fine until restart.

MortJC commented 3 years ago

The bent library I'm using to "login" to the api does not have a timeout or retry parameter. Your device must be very slow if it takes 5 mins to load HomeBridge.

On Tue, Jun 29, 2021 at 3:17 AM idsnowghost @.***> wrote:

It seems like the websocket is timing out when loading the plugin when starting Homebridge. Is it possible to attempt this initial connection more than once? I'm running Homebridge on a slower SBC and it takes awhile (5~ minutes) to fully load up Homebridge.

I've found a workaround: Load the plugin as a child bridge, then kill the process once Homebridge is fully loaded and CPU utilization drops below 100%. Then the child bridge restarts and plugin loads, connects to the Orbitbhyve API as normal. Everything works fine until restart.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MortJC/homebridge-platform-orbit/issues/28#issuecomment-869865612, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN5E4TQEYT5NBLJHU3UC62DTVCVA3ANCNFSM4UMZCHPQ .