bitfocus / companion-module-lgtv-display

MIT License
6 stars 2 forks source link

Module will now not connect at all to LG TVs? Log shows 'Could no connect to TV' #15

Open Jibun-no-Kage opened 1 month ago

Jibun-no-Kage commented 1 month ago

Module will now not connect at all to LG TVs? It was working a few days ago, now seems unable to connect at all, even WOL seems to fail. Rather odd, parent system has not changed, no updated, companion version has not changed. Just stopped working. Now getting errors in the log. See below.

Date | Module | Type | Log
2024-08-07T15:50:48.406Z | Instance/Controller | info | Enable instance Casitas-TV-Wired
2024-08-07T15:50:48.406Z | Instance/ModuleHost | info | Starting connection: "Casitas-TV-Wired"(qtSy6BTQ30S02FFvUQ3NR)
2024-08-07T15:50:48.412Z | Instance/ModuleHost | debug | Connection "Casitas-TV-Wired" started
2024-08-07T15:50:48.494Z | Instance/Casitas-TV-Wired | verbose | stdout: Starting up module class: G
2024-08-07T15:50:48.494Z | Instance/Casitas-TV-Wired | verbose | stdout: Sentry disabled
2024-08-07T15:50:48.496Z | Instance/ModuleHost | debug | Registered module client "qtSy6BTQ30S02FFvUQ3NR"
2024-08-07T15:50:48.498Z | Instance/Casitas-TV-Wired | verbose | stdout: Module-host accepted registration
2024-08-07T15:50:48.510Z | Instance/Controller | debug | instance "Casitas-TV-Wired" configuration updated
2024-08-07T15:50:50.268Z | Instance/Controller | info | Enable instance Casitas-TV-Wireless
2024-08-07T15:50:50.269Z | Instance/ModuleHost | info | Starting connection: "Casitas-TV-Wireless"(jWQdVVTlYHChP-I4fSMDk)
2024-08-07T15:50:50.275Z | Instance/ModuleHost | debug | Connection "Casitas-TV-Wireless" started
2024-08-07T15:50:50.356Z | Instance/Casitas-TV-Wireless | verbose | stdout: Starting up module class: G
2024-08-07T15:50:50.356Z | Instance/Casitas-TV-Wireless | verbose | stdout: Sentry disabled
2024-08-07T15:50:50.357Z | Instance/ModuleHost | debug | Registered module client "jWQdVVTlYHChP-I4fSMDk"
2024-08-07T15:50:50.359Z | Instance/Casitas-TV-Wireless | verbose | stdout: Module-host accepted registration
2024-08-07T15:50:50.371Z | Instance/Controller | debug | instance "Casitas-TV-Wireless" configuration updated
2024-08-07T15:50:53.523Z | Instance/Wrapper/Casitas-TV-Wired | error | Could not connect to TV.
2024-08-07T15:50:55.381Z | Instance/Wrapper/Casitas-TV-Wireless | error | Could not connect to TV.

What is interesting is that I have used Wes's LGTV-IP-Control, but happens to be on a Linux system, not on companion on Windows 11 Pro. So I know the issue is not specific to the TV or network. Wondering if there is a way to get more details on the failure from the module? This was literally working fine, less than 24 hours ago, in the same environment.

Just to validate, running Wes's lgtv-ip-control library directly works...

import { Inputs, LGTV } from 'lgtv-ip-control';

const lgtv = new LGTV('192.168.1.24', 'XX:XX:XX:XX:XX:XX:XX', 'XXXXXX');

lgtv
  .connect()
  .then(async () => {
    console.log('Select HDMI1...');
    await lgtv.setInput(Inputs.hdmi1);
    await new Promise((resolve) => setTimeout(resolve, 5000));
    console.log('Select HDMI2...');
    await lgtv.setInput(Inputs.hdmi2);
  })
  .catch(console.error)
  .finally(() => lgtv.disconnect());

Output... TV does respond, and changes input to HDM1 then to HDMI2...

~# node lgtv-ip-control.mjs
Select HDMI1...
Select HDMI2...
Jibun-no-Kage commented 1 month ago

Bump? It appears that the module is not attempting to do two things consistently. One, WOL is not being sent initially. I have confirmed via the Wake-on-LAN module that the TV will respond to the WOL packet. Two, if the TV is up, the network interface via wired or wireless, can be pinged, as in the interface as not powered down as the TV goes into long stand-by, the power on command fails to be honored. This consistent across macOS and Windows 11 Pro. This consistent across the 3 LG TVs I have access to at this time. Calling the JavaScript module directly as illustrated above does work. So that would suggest the issue is within the unique code of the module that is not part of Wes's lgtv-ip-control module or maybe companion its self? Also the connection status of the module its-self now often reports 'Connecting...' but clearly the connection module seems frozen or stuck or otherwise timed out. Disabling and enabling the connection module has only rare and limited success. Last, I know that Wes actively supports his project, since I also use it in Node Red, so a suggestion would be to the connection module confirm it is always using the latest version of Wes's module?