tavicu / homebridge-samsung-tizen

Homebridge plugin for Samsung TV's with Tizen OS
MIT License
647 stars 87 forks source link

Unknown Warning Message #390

Closed Christian-CFP closed 2 years ago

Christian-CFP commented 3 years ago

I dont know what this is:

Here in debug:

31.7.2021, 14:20:26HOME BridgePreparing Advertiser for 'Fernseher 1B13' using bonjour-hap backend! 31.7.2021, 14:20:26HOME BridgeWARNING<(node:507) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 state.change listeners added to [Device]. Use emitter.setMaxListeners() to increase limit 31.7.2021, 14:20:26HOME BridgeWARNING(Use node --trace-warnings ... to show where the warning was created) 31.7.2021, 14:20:26HOME BridgeStarting to advertise 'Fernseher 1B13' using bonjour-hap backend! 31.7.2021, 14:20:26HOME BridgeFernseher 1B13 is running on port 34065.

tavicu commented 3 years ago

As the message suggested you need to trace the warnings so we can see what are they triggered by.

The plugin sends the 'state.change' event when one of these action happens: ['wakeup', 'standby', 'artmode.change']

How many TVs do you have in your config?

Christian-CFP commented 3 years ago

Hi, this happens only when I start/restart the homebridge. This do not happend when its running just at the startup. And its independent if the TV is on or off. I just got one TV (Q90R).

tavicu commented 3 years ago

My plugin sets only 4 listeners per device. From what i've read the default maximum listeners are 10.

Do you have many plugins installed only one instance of homebridge? If you do, i recommend looking to create multiple instance (you could take a look at homebridge docker).

Christian-CFP commented 3 years ago

I've got 10 plugins devided by 5 instances so I guess thats fine.

Christian-CFP commented 3 years ago

PS 6 Plugins are in the instance with yours. This warning is only since the ver. 5.

tavicu commented 3 years ago

Depending on how many devices you have for each plugin :D

You could try the --trace-warnings, maybe we will get more info.

Christian-CFP commented 3 years ago

I do not know how to get use of this node --trace-warnings

tavicu commented 3 years ago

I think you just call node --trace-warnings ... in your terminat, including the three dots I never used it :D

tavicu commented 3 years ago

Or i think another solution is to start homebridge in debug mode and it will show the warning with the trace.

MarkBarbieri commented 3 years ago

Same issue here, I've seen it for a while. debug mode doesn't help, but node trace-warnings does

[05/08/2021, 6:38:35 pm] Homebridge v1.3.4 (Homebridge) is running on port 51106.
Preparing Advertiser for 'TV E63D' using ciao backend!
(node:28193) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 state.change listeners added to [Device]. Use emitter.setMaxListeners() to increase limit
    at _addListener (events.js:451:17)
    at Device.addListener (events.js:467:10)
    at new Switch (/usr/lib/node_modules/homebridge-samsung-tizen/lib/accessories/switch.js:26:21)
    at /usr/lib/node_modules/homebridge-samsung-tizen/lib/device.js:52:32
    at Array.forEach (<anonymous>)
    at new Device (/usr/lib/node_modules/homebridge-samsung-tizen/lib/device.js:50:30)
    at SamsungPlatform.init (/usr/lib/node_modules/homebridge-samsung-tizen/index.js:47:26)
Starting to advertise 'TV E63D' using ciao backend!
tavicu commented 3 years ago

I think i know from what is it! Do you have multiple switches for the TV?

MarkBarbieri commented 3 years ago

I think i know from what is it! Do you have multiple switches for the TV?

Yep, sure do

Christian-CFP commented 3 years ago

Me too.

tavicu commented 3 years ago

That’s it then! For every switch an event listener is created!

i will change they way it works!

Christian-CFP commented 3 years ago

That’s it then! For every switch an event listener is created!

i will change they way it works!

was that ironic?

tavicu commented 3 years ago

Don’t know what sound ironic to you. Probably “that’s it then” but i was referring as “that’s the problem, that’s why the warning messages appears” … especially since in the previous message i said “I probably know from what is it” :)

Christian-CFP commented 3 years ago

Ok got it. Sorry.

tavicu commented 2 years ago

Hi. I have updated the plugin and now only one listener is created for updating all accessories instead of having one listener for every accessory.

I didn't publish a new version of the plugin yet, so the warning will be there until I do that. I still have some issues i want to fix and then i will release the new version. Maximum at the end of the week.