merdok / homebridge-webos-tv

Homebridge plugin for LG webOS TVs
MIT License
656 stars 88 forks source link

C1 - Random Disconnects #488

Closed simplytoast1 closed 10 months ago

simplytoast1 commented 1 year ago

I have a C1 and I am able two successfully power on and off the TV but the weird thing is after a set period of time (varies greatly) although the plug-in is reporting the TV successfully turned on. It doesn’t and a reboot of the plug-in (not the TV) fixes it.

Odd

merdok commented 1 year ago

Hi, you would need to post a debug log of that situation in order for me to be possible to identify the issue.

simplytoast1 commented 1 year ago

Absolutely. I will start the log capture and post at the next time this happens.

merdok commented 1 year ago

ok

simplytoast1 commented 1 year ago
(node:47043) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 tvTurnedOn listeners added to [LgTvController]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)

Sorry it took so long as I said it is unpredictable.

merdok commented 1 year ago

Thanks, but since this is just a warning, it should not have any effects on the plugin. Also more context needed, you would have to provide the full log and point me to place where to look.

simplytoast1 commented 1 year ago

Thanks, but since this is just a warning, it should not have any effects on the plugin. Also more context needed, you would have to provide the full log and point me to place where to look.

Apologies. I enabled Debug mode but realized I need to run Homebridge in debug mode as well to get the information. Keeping my eyes out for the next error.

simplytoast1 commented 1 year ago

Thank you for your patience and here is some debug logging...

[4/21/2023, 8:08:41 PM] [homebridge-webos-tv] [LG TV] Wake on LAN callback - sent magic packet, trying to connect to tv... [4/21/2023, 8:08:41 PM] [homebridge-webos-tv] [LG TV] Trying to wake up TV! Mac: xx:xx:xx:xx:xx:xx, BroadcastAdr: 255.255.255.255 [4/21/2023, 8:08:41 PM] [homebridge-webos-tv] [LG TV] Connecting to TV [4/21/2023, 8:08:50 PM] [homebridge-webos-tv] [LG TV] Connecting to TV [4/21/2023, 8:09:04 PM] [homebridge-webos-tv] [LG TV] Connecting to TV [4/21/2023, 8:09:12 PM] [homebridge-webos-tv] [LG TV] Connecting to TV [4/21/2023, 8:09:21 PM] [homebridge-webos-tv] [LG TV] Connecting to TV [4/21/2023, 8:09:35 PM] [homebridge-webos-tv] [LG TV] Connecting to TV [4/21/2023, 8:09:43 PM] [homebridge-webos-tv] [LG TV] Connecting to TV [4/21/2023, 8:09:52 PM] [homebridge-webos-tv] [LG TV] Connecting to TV [4/21/2023, 8:10:00 PM] [homebridge-webos-tv] [LG TV] Error - Error: Sec-WebSocket-Accept header from server didn't match expected value of xxxxxxxxxxx at WebSocketClient.failHandshake (/usr/local/lib/node_modules/homebridge-webos-tv/node_modules/websocket/lib/WebSocketClient.js:339:32) at WebSocketClient.validateHandshake (/usr/local/lib/node_modules/homebridge-webos-tv/node_modules/websocket/lib/WebSocketClient.js:326:14) at ClientRequest.handleRequestUpgrade (/usr/local/lib/node_modules/homebridge-webos-tv/node_modules/websocket/lib/WebSocketClient.js:261:14) at ClientRequest.emit (node:events:513:28) at Socket.socketOnData (node:_http_client:582:11) at Socket.emit (node:events:513:28) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9) at Socket.Readable.push (node:internal/streams/readable:234:10) at TCP.onStreamRead (node:internal/stream_base_commons:190:23) [4/21/2023, 8:10:00 PM] [homebridge-webos-tv] [LG TV] Connecting to TV [4/21/2023, 8:10:00 PM] [homebridge-webos-tv] [LG TV] Connecting to TV [4/21/2023, 8:10:00 PM] [homebridge-webos-tv] [LG TV] Connecting to TV [4/21/2023, 8:10:00 PM] [homebridge-webos-tv] [LG TV] Connecting to TV [4/21/2023, 8:10:00 PM] [homebridge-webos-tv] [LG TV] Connecting to TV

I was able to get the TV to connect by manually powering it on. I'm assuming something my at play with WoL?

merdok commented 1 year ago

Looks indeed that it might be an Wake On Lan issue. You should check whether the magic packet always reach your TV. Also keep in mind that you have to enable some extra features in the TV settings for it to work correctly, as other otherwise the TV will disconnect form the network when powered off.

yclai1229 commented 1 year ago

Hi~

What kind of TV program to start can not allow TV to disconnect.

At present, my LG C1 also encountered the same problem. After a period of shutdown, I couldn't wake up TV.

Thanks

merdok commented 1 year ago

There are some settings for that in the tv settings menu. Usually the tv will turn off the network devices to save energy but you can prevent that with a tv setting