JPersson77 / LGTVCompanion

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

TV screen turns on after PC shuts down #172

Closed JonasFi closed 5 months ago

JonasFi commented 1 year ago

Hello

I have been having this issues on and off for quite some time now. I turn off my PC, but then the TV screen just turns itself back on. I seem to SOMETIMES fix it by going to my TV settings and setting the wired connection (ethernet) IP to manual, then when it doesnt work anymore, I set it back to automatic. I have a feeling all my issues are caused by the fact that I have not set a static DHCP lease for the TV, but I cannot for the love of me find a way to do it in my router settings...looked up google, youtube, still cant seem to figure it out. Ive got a ZTE mc888 5g router, so I dont know, maybe someone here can help me out... Im not too tech-savvy when it comes to these things, so...

Also attaching log and json files, maybe thats of some use config.json Log.txt

Sorry for my ignorance

JPersson77 commented 1 year ago

Hi @JonasFi no worries. Wish I could help with your router.

From looking at the log it is apparent that the app cannot properly communicate with the TV. Your guess a about using a static ip may be right but in this log snippet you attached the TV is totally unreachable so that might indicate something else as well. What model TV is it?

Can you please go inte the network settings of the TV and write down the IP of the TVs wired connection (since you said you are using a network cable). Then verify its the same IP in the app's configuration for the device. If it is the same IP you should now be able to use the test function (the drop down arrow on the main 'configure' button). Then upload the log here and I will have a look at it

JonasFi commented 1 year ago

The model of the TV is LG 55UQ75003

The TVs wired connection IP adress is 192.168.0.62. And I can absolutely verify that it is the same IP used for the applications configuration. I see the test function, but I cannot seem to be able to use it... For example when I click test and a popup comes up stating to click YES to power off the device after clicking it a new popup comes up telling me to press ENTER to power the device back on again, yet the device did not power off in the first place, or at least it didnt seem like it... ... Or was it supposed to be like this?

Log.txt

JonasFi commented 1 year ago

Maybe the problem is not in the application...maybe its the HDMI cable Im using? One end is connected to my graphics cards HDMI 2 port, and the other one goes into the TVs HDMI 1 port...could this be the cause perhaps?

JPersson77 commented 1 year ago

Hi again, it's not to do with the hdmi cable.

The test function should power off the TV when you click yes and then power it on again when you press enter on the keyboard.

But in your case the app cannot communicate with the TV. It fails when connecting it looks like. I dont know the tv model but its quite recent so I assume its similar to the OLED variants. I also notice that you have a pairing key (in config.json) so the app must have connected at least once at some time earlier.

So then what may be wrong? A) your TV and pc may not be on the same subnet/routable. I notice in the log that you seem to have more than one network adapters. B) you may need to switch to 'legacy' connection method in the device configuration C) maybe there is a setting in your TVs configuration which prohibit external connections over ip. D) maybe you are confising the TVs wireless IP with the wired IP (different adapters)

JPersson77 commented 1 year ago

And another tip worth trying is to ensure that both the TV and PC is set to receive the ip automatically (dhcp) and then shut off everything, including routers, access points, modems and see if that helps.

But if you dont have a static IP in your router for the TV you may have to recheck the IP in the configuration after restarting the router

JonasFi commented 1 year ago

Checked all the things youve mentioned but nothing helped...so I did the old "uninstall it then install it again" thing and now everything works great. Even the test function works. Im attaching the log, just in case. Maybe you can cross-check it with the old logs of mine and see something...

Log.txt

JonasFi commented 1 year ago

This doesnt really achieve anything, since we didnt figure out the cause of the problem, I know... But maybe with time Ill catch it :)

JonasFi commented 1 year ago

Same thing happened out of nowhere again just now...not even reinstalling the software helps anymore...at a loss here, no idea what to do

JPersson77 commented 1 year ago

HI again, please review my comments above again and onfirm what you have tested. It seems something is causing the app to fail to communicate with the TV.

JonasFi commented 1 year ago

Yup, reviewed it all:

Both PC and TV are on the same subnet.

Tried the legacy option, it didn't do anything

Checked all the settings, nothing seems to be preventing external connections

And nope, I'm not confusing the IPs...

Also tested your tip. Both devices were set to receive the IP automatically...

JPersson77 commented 1 year ago

Thanks can you please post another log here again showing the system booting, letting it srttle for 1 minute and then shutting down

JonasFi commented 1 year ago

Well the thing is the log probably won't show anything wrong since yesterday I tried reinstalling the application again, and of course it works now... :) It's really weird how it stops working after several days seemingly out of nowhere though...

JPersson77 commented 1 year ago

Bit weird that a reinstall makes it work again. I'm assuming that you dont delete config.json manually after uninstalling, and then the config should be absolutely the same after reinstalliing

Got any specialised firewall software installed?

Keep the logging enabled please and next time it stops working send the whole log and we have another look

JonasFi commented 1 year ago

I use Revouninstaller, and it always deletes all the leftover files, so I doubt that config file stays around...

And nope, no specialised firewall software here..

And will do! Thank you for your time :)

JPersson77 commented 1 year ago

Ok I see, if revo delete the file you would have to (re) configure. Is this what happens after reinstall?

JonasFi commented 1 year ago

Yup, I hate to do it all over again, and if the configuration is successful, I get this popup on my TV screen. Though yesterday when I was reinstalling it for a few times, it didn't work and I didn't get that notification...it only worked on the third reinstallation

20231022_222742

JonasFi commented 1 year ago

Found a way to recreate the problem:

So apparently the application breaks when I put my PC to sleep. When it goes to sleep my TV screen wont turn off. I wake up the PC then turn it off again, and the TV screen never turns off with it ever again. I have to reinstall the app again to fix it all. Attaching a log file

Log.txt

JPersson77 commented 10 months ago

Hi, I have fixed a problem in the codebase which may affect your issue. Will upload a new version (3.3+) during the day. Please feedback if it helps your specific issue.

JonasFi commented 10 months ago

Well with the newest v3.3.3 version I cannot connect my TV at all it seems. Tried installing/uninstalling the software three times now. It just wont connect...

JPersson77 commented 10 months ago

Hiya, that seems very unexpected. Can you enable the log and paste it, along with config.json please. Maybe use padyebin or similar. Both files are in c:/programdata/lgtv companion/

JonasFi commented 10 months ago

config.json Log.txt

JPersson77 commented 10 months ago

Hi, from the logs it looks misconfigured. My first guess would be that your TV does not have an IP of 192.168.0.62, can you confirm whether that is the case? Once the PC and TV can communicate you will get a dialogue on your TV to pair since there is no saved pairing key at the moment.

JonasFi commented 10 months ago

Yeah I know, but I never get that dialogue box on my TV when I try to connect the two devices. And yeah, that is the IP. Here, look: Adress

JPersson77 commented 10 months ago

Thanks, if you uncheck ipv6? Do you need ipv6?

JonasFi commented 10 months ago

Well I just unchecked it and tried to reconnect the TV, but still no dialogue box

JonasFi commented 10 months ago

Not even sure what ipv6 exactly is to be honest... :D

JPersson77 commented 10 months ago

That checkbox turn off support for IPv6 (it basically means more ip-adresses https://en.wikipedia.org/wiki/IPv6)

For me this looks like network issues then. Can you try opening a command promt (win+r and then cmd.exe) and execute"ping 192.168.0.62". You should get output similar to this if you PC can communicate with the TV: image

JonasFi commented 10 months ago

Here you go:

PING_TEST

JPersson77 commented 10 months ago

In the log you have three IPs for you PC (assuming different network adapters).

Host IPs detected: 10.5.0.2/16, 192.168.0.108/24, 192.168.137.1/24

Do you have the possibility to shut down (disable in device manager for example) the network interfaces which is not connected to the same LAN as your TV and see if that affect the issue? Just to try and troubleshoot

JonasFi commented 10 months ago

I am sure I have the possibility, just not the ability to do that... :D I have NO IDEA where to even start with this request, sorry... Not tech savvy enough to even find those so called "network interfaces" in my device manager:

Device_Manager

JonasFi commented 10 months ago

Could it be that NordVPN is behind all this?

JPersson77 commented 10 months ago

I have run into at least one other user who ran into issues with installing NordVPN. S/he had to completely uninstall to remediate. Not sure why at the moment.

To the original question, I am guessing you should try disabling Wireless AC-9462, Virtual adapter #2

JonasFi commented 10 months ago

Disabled it, removed the TV from the software, tried to add it again, but still no luck connecting it...

Log.txt config.json

JPersson77 commented 10 months ago

Thanks, that eliminated the wireless NIC I think. Can you try to use CMD and navigating to c:/program files/lgtv companion/ and then execute "lgtvcli.exe -poweron device1" and see how it goes? Do you get error messages?

Would it be a horrible nuisance to uninstall nordvpn for a test? Can't say I know it will solve anything but it might provide clues.

Also, do you use Discord? May well be easier to talk there https://discord.gg/7KkTPrP3fq

JPersson77 commented 9 months ago

Hi again, following our conversation on Discord - did you manage to install and use a newer version or still using 3.1.5?

JPersson77 commented 5 months ago

Closing due to inactivity, please feel free to reopen as needed.