Closed mda30 closed 7 years ago
i've made some changes to the code, on mine and haven't had this error with using "yes" and im trying to do that more graceful, this only happens in realtime? and its because of timeouts.
I will try and apply this to my code, and do another pull request.
there is a thread on this error that should help catch it, and i may be able to get around it with the way i'm handling the NaN by using the last cached value.
http://stackoverflow.com/questions/23632914/how-to-handle-etimedout-error
but i just need to see, it almost feels to me like its not expecting a call back at that point, or that the callback is formatted incorrectly.
any update on this? I have exactly the same issue. I have the http-temperature plugin polling the exact same esp8266/Arduino and working fine.. but when I set up a status_url on the http plugin, homebridge crashes after 20 seconds or so with the callback error above. I've tried commenting out the callback on line 45 of the plugins index.js file but doesn't solve.. what I've found is that It seems to get status OK when homebridge starts up, but then it hangs and then crashes after that...
ive also noticed.. when ti tries to poll to get status.. setting up a continuous ping to the device its trying to poll.. it literally swamps the thing its trying to read and it stops responding on the network.. its almost like the poll request is flooding the device.. eventually the device that was been polled (after homebridge has crashed) comes back to life.. it would be great if could just stop homebridge crashing but ideal if this could work.. im a newbie to nodejs, but can anyone tell me which library is been called to do the http request?
If you are using 'realtime' it uses polling-to-event but if you are using any other method it should use request.
I don't have the techincal skill to fix it but happy for others to have a look and I can merge their request
Line 51 & 89 uses interval of 300ms, try increasing it maybe?
Sometimes the server i am calling is slow to respond and homebridge it terminating on a timeout error. I have looked at index.js but I am not competent with javascript so would appreciate any help either increasing the timeout or adding a handler for the timeout so homebridge keeps running. Thanks for any help!
[9/18/2016, 10:34:36 PM] [Deck Jets] HTTP get power function failed: connect ETIMEDOUT 192.168.1.152:3480 /usr/local/lib/node_modules/homebridge-http/index.js:45 callback(error); ^
ReferenceError: callback is not defined at /usr/local/lib/node_modules/homebridge-http/index.js:45:19 at Request._callback (/usr/local/lib/node_modules/homebridge-http/index.js:115:4) at self.callback (/usr/local/lib/node_modules/homebridge-http/node_modules/request/request.js:187:22) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at Request.onRequestError (/usr/local/lib/node_modules/homebridge-http/node_modules/request/request.js:813:8) at emitOne (events.js:96:13) at ClientRequest.emit (events.js:188:7) at Socket.socketErrorListener (_http_client.js:308:9) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at emitErrorNT (net.js:1271:8) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9)