JPersson77 / LGTVCompanion

Power On and Off WebOS LG TVs together with your PC
MIT License
992 stars 40 forks source link

Sometimes my LG C2 42" won't turn on #111

Closed cyruzin closed 1 year ago

cyruzin commented 1 year ago

Companion:

Version: 2.0.0 Connection method: Wi-Fi Config: Manual, static IP

TV:

Energy saving: Off External connection: Wi-Fi Always ready: Off HDMI Port: 4

image

image

Log:

Sun 12:45:16 > LGTV Companion Service started (v 2.0.0) ---------------------------
Sun 12:45:16 > Configuration file successfully read
Sun 12:45:16 > Data path: C:\ProgramData\LGTV Companion\
Sun 12:45:16 > Device1, LG C2 42", with IP 192.168.15.11 initiated (Enabled:yes, NewConn:yes, WOL:2, PairingKey:845580a9bd95796db80d31f44db44739, MAC: 4C:BA:D7:E2:00:80 , VerifyHdmiInput:4, SetHdmiInput:4, BlankOnIdle:on(5m))
Sun 12:45:16 > Setting shutdown parameter level 0x100
Sun 12:45:16 > ** System requests displays ON.
Sun 12:45:16 > Device1, spawning DisplayPowerOnThread().
Sun 12:45:16 > Device1, spawning DisplaySetHdmiInputThread().
Sun 12:45:16 > Device1, WARNING! SetDisplayHdmiInputThread(): connect: A socket operation was attempted on an unreachable network
Sun 12:45:16 > Device1, repeating WOL broadcast started to MAC: 4C:BA:D7:E2:00:80 using IP address: 192.168.15.11
Sun 12:45:16 > Device1, GetBestRoute2() failed with code 1231
Sun 12:45:16 > Device1, WARNING! WOLthread WS sendto(): 10051
Sun 12:45:16 > Device1, WARNING! DisplayPowerOnThread(): connect: A socket operation was attempted on an unreachable network
Sun 12:45:18 > Device1, GetBestRoute2() selected interface index 26 LUID 1689399783849984 route protocol 2
Sun 12:45:20 > Device1, GetBestRoute2() selected interface index 26 LUID 1689399783849984 route protocol 2
Sun 12:45:22 > Device1, GetBestRoute2() selected interface index 26 LUID 1689399783849984 route protocol 2
Sun 12:45:24 > Device1, GetBestRoute2() selected interface index 26 LUID 1689399783849984 route protocol 2
Sun 12:45:26 > Device1, GetBestRoute2() selected interface index 26 LUID 1689399783849984 route protocol 2
Sun 12:45:28 > Device1, GetBestRoute2() selected interface index 26 LUID 1689399783849984 route protocol 2
Sun 12:45:29 > IPC, Daemon has started.
Sun 12:45:30 > Device1, GetBestRoute2() selected interface index 26 LUID 1689399783849984 route protocol 2
Sun 12:45:32 > Device1, GetBestRoute2() selected interface index 26 LUID 1689399783849984 route protocol 2
Sun 12:45:34 > Device1, GetBestRoute2() selected interface index 26 LUID 1689399783849984 route protocol 2
Sun 12:45:36 > Device1, GetBestRoute2() selected interface index 26 LUID 1689399783849984 route protocol 2
Sun 12:45:37 > [DEBUG] (SSL) ON response 1: {"type":"registered","id":"register_0","payload":{"client-key":"845580a9bd95796db80d31f44db44739"}}
Sun 12:45:37 > [DEBUG] (SSL) ON response 2: {"type":"error","id":"2","error":"500 Application error","payload":{"returnValue":false,"state":"Active","errorCode":"-102","errorText":"The current sub state must be 'screen off'"}}
Sun 12:45:37 > [DEBUG] (SSL) ON response 3: {"type":"response","id":"1","payload":{"state":"Active","returnValue":true}}
Sun 12:45:37 > Device1, power state is: ON
Sun 12:45:38 > Device1, repeating WOL broadcast ended
Sun 12:45:43 > Device1, WARNING! SetDisplayHdmiInputThread(): connect: A connection attempt failed because the connected component did not respond correctly after a period of time, or the established connection failed because the connected host did not respond
Sun 12:45:43 > Device1, Setting HDMI input: 4
JPersson77 commented 1 year ago

Hi @cyruzin the log looks allright as the TV turned on 20 seconds after the service was started. Or did you turn it on manually?

From previous bug reports, what usually cause the issue you are experiencing is that the TV for some reason lost wireless connection from the network while it is off. This can be because of router restarts, tv lost power, network disturbances etc. It seems the wireless network interface of the TV does not reconnect again when this happen. If you have the possibility to switch to a wired connection I would recommend it, otherwise I think it's a matter of minimise the network disturbances and/or trying the other two network options to see if they work better.

See also if you can find examples in the log when the TV did not turn on and paste it here and I will have a look

cyruzin commented 1 year ago

Hi @cyruzin the log looks allright as the TV turned on 20 seconds after the service was started. Or did you turn it on manually?

From previous bug reports, what usually cause the issue you are experiencing is that the TV for some reason lost wireless connection from the network while it is off. This can be because of router restarts, tv lost power, network disturbances etc. It seems the wireless network interface of the TV does not reconnect again when this happen. If you have the possibility to switch to a wired connection I would recommend it, otherwise I think it's a matter of minimise the network disturbances and/or trying the other two network options to see if they work better.

See also if you can find examples in the log when the TV did not turn on and paste it here and I will have a look

Manually. I’ll switch to a wired connection, thanks.

JPersson77 commented 1 year ago

Let me know how it goes

cyruzin commented 1 year ago

Using wired connection works fine:

Mon 10:15:32 > LGTV Companion Service started (v 2.0.0) ---------------------------
Mon 10:15:32 > Configuration file successfully read
Mon 10:15:32 > Data path: C:\ProgramData\LGTV Companion\
Mon 10:15:32 > Device1, LG C2 42", with IP 192.168.15.17 initiated (Enabled:yes, NewConn:yes, WOL:2, PairingKey:845580a9bd95796db80d31f44db44739, MAC: AC:5A:F0:80:73:9C , VerifyHdmiInput:4, SetHdmiInput:4, BlankOnIdle:on(5m))
Mon 10:15:32 > Setting shutdown parameter level 0x100
Mon 10:15:32 > ** System requests displays ON.
Mon 10:15:32 > Device1, spawning DisplayPowerOnThread().
Mon 10:15:32 > Device1, spawning DisplaySetHdmiInputThread().
Mon 10:15:32 > Device1, WARNING! DisplayPowerOnThread(): connect: A socket operation was attempted on an unreachable network
Mon 10:15:32 > Device1, repeating WOL broadcast started to MAC: AC:5A:F0:80:73:9C using IP address: 192.168.15.17
Mon 10:15:32 > Device1, GetBestRoute2() failed with code 1231
Mon 10:15:32 > Device1, WARNING! WOLthread WS sendto(): 10051
Mon 10:15:32 > Device1, WARNING! SetDisplayHdmiInputThread(): connect: A socket operation was attempted on an unreachable network
Mon 10:15:34 > Device1, GetBestRoute2() selected interface index 26 LUID 1689399783849984 route protocol 2
Mon 10:15:36 > Device1, GetBestRoute2() selected interface index 26 LUID 1689399783849984 route protocol 2
Mon 10:15:38 > Device1, GetBestRoute2() selected interface index 26 LUID 1689399783849984 route protocol 2
Mon 10:15:39 > [DEBUG] (SSL) ON response 1: {"type":"registered","id":"register_0","payload":{"client-key":"845580a9bd95796db80d31f44db44739"}}
Mon 10:15:39 > [DEBUG] (SSL) ON response 2: {"type":"error","id":"2","error":"500 Application error","payload":{"returnValue":false,"state":"Active","errorCode":"-102","errorText":"The current sub state must be 'screen off'"}}
Mon 10:15:39 > [DEBUG] (SSL) ON response 3: {"type":"response","id":"1","payload":{"state":"Active","returnValue":true}}
Mon 10:15:39 > Device1, power state is: ON
Mon 10:15:39 > Device1, Setting HDMI input: 4
Mon 10:15:40 > Device1, repeating WOL broadcast ended
Mon 10:16:14 > IPC, Daemon has started.
JPersson77 commented 1 year ago

Thanks for the feedback. I hope it didnt mess up your workspace too much but it seems to help with these kind of issues. Closing the issue but feel free to reopen as needed