bitfocus / companion-module-lgtv-display

MIT License
6 stars 2 forks source link

Module Constantly losing connection #10

Open LCVideoTech opened 8 months ago

LCVideoTech commented 8 months ago

The LGTV module loses connection with my tv a lot. I followed all the steps to connect and it works some of the time. I even calculated my wake on lan ip address (broadcast address). I have the LG 86UM8070PUA and am running companion 3.0.0 on a raspberry pi 4 model b 8gb.

I know that the module has not been updated to work with companion 3.0, but I read we should ask for features before using the tcp/udp module so here I am asking for the module to be updated. If this doesn't get fixed/updated then I will need to try to use the tcp/udp to send rs-232c commands via an adapter.

Thanks

cpuguru07 commented 5 months ago

Same issues here. The module crashes when the TVs are off and doesn't re-initialize when they power on. Have to manually disable/re-enable the module to get it to reconnect.

Jibun-no-Kage commented 1 month ago

Are you sure it is not just the network interface turning off? LG TVs use a very weird method of power on and off, and when powered off, after 2-4 minutes they literally drop off the network and are not ping-able. If the (old) LG TV module does not do an an explicit WOL request and then wait about 90 seconds then the TV will not respond as expected. If the TV is turned on with in the 2-4 minute window after power off, then it works as expected.

Only LG TVs do this odd no-native power on method, Vizio, TCL, etc. all have an explicit power on that is supported by the network interface always being online even stand-by mode. But not LG TVs, when they go into power off stand-by, they literally drop off the network completely as noted above.

I actually wrote a small HTTP REST API in Node-Red that I send commands to, and the Node-Red code then drives the LG TV logic, using a github project written by Wes Sansa, who very actively supports his JavaScript project to drive LG TV ip based communication. To that end, I opened a request to have his code base wrapped into an updated companion module. The current date module has many features missing, such as volume up/down control for example, whereas Wes's code supports just about every LG TV WebOS command/response I know of.

Jibun-no-Kage commented 1 month ago

I did some explicit testing with the older module... turn off TV for about 15 minutes then turned on via companion, and the old module if set to WOL broadcast of 255.255.255.255, my LG TV 50UR9000 series does turn off, but as I noted, you have to wait for about 90 seconds before you do any other function, i.e. wait for the ip control interface to fully initialize as I noted above.