simont77 / fakegato-history

Module to emulate Elgato Eve history
MIT License
167 stars 15 forks source link

crash while setting the clock #100

Closed thkl closed 3 years ago

thkl commented 3 years ago

from time to time my app using version 0.5.6 of fakegato-history crashes at this point:

Error: This callback function has already been called by someone else; it can only be called one time.
    at /usr/local/addons/hap-homematic/node_modules/hap-nodejs/dist/lib/util/once.js:11:19
    at FakeGatoHistory.setCurrentS2W2 (/usr/local/addons/hap-homematic/node_modules/fakegato-history/fakegato-history.js:843:4)
    at S2W2Characteristic.emit (events.js:327:22)
    at S2W2Characteristic.EventEmitter.emit (/usr/local/addons/hap-homematic/node_modules/hap-nodejs/dist/lib/EventEmitter.js:59:38)
    at S2W2Characteristic.Characteristic._this.setValue (/usr/local/addons/hap-homematic/node_modules/hap-nodejs/dist/lib/Characteristic.js:338:23)
    at /usr/local/addons/hap-homematic/node_modules/hap-nodejs/dist/lib/Accessory.js:940:36
    at Array.forEach (<anonymous>)
    at HAPServer.Accessory._this._handleSetCharacteristics (/usr/local/addons/hap-homematic/node_modules/hap-nodejs/dist/lib/Accessory.js:808:18)
    at HAPServer.emit (events.js:315:20)
    at HAPServer.EventEmitter.emit (/usr/local/addons/hap-homematic/node_modules/hap-nodejs/dist/lib/EventEmitter.js:59:38)

it would be nice to try catch this error

the last debug message is Clock adjust : 2e584b25

simont77 commented 3 years ago

This is the firs time that I see this error, and I'm running fakegato 24/7 since over 3 years now. Which plugin is using fakegato and which version of homebridge and node are you using?

thkl commented 3 years ago

i am not using homebridge .. i use it separatly in https://github.com/thkl/hap-homematic

simont77 commented 3 years ago

I'm not familiar with hap-homematic. Assuming that the crash is caused by the function setCurrentS2W2, it is called only when Eve.app update the E863F11C characteristic. Going back to my original decoding of the protocol "In this write-only characteristics a time stamp is written by Eve.app every second if the accessory is selected in the app."

So I would assume that for some reason requests are being queued in hap-homematic, and then delivered all together. @NorthernMan54 Any other idea?

thkl commented 3 years ago

I am the author of hap-homematic and there is no queue for requests or so ....

thkl commented 3 years ago

ok i've found the error. there was an enabling of 2 logging types for one accessory. sorry 4 wasting your time