Skip to content

Commit

Permalink
Remove ip_address from send_magic_packet
Browse files Browse the repository at this point in the history
Without ip_address the wakeonlan magic packet will be sent to the default 255.255.255.255 (boardcast). This is required because during standby, the devices will not have their IP up and running.
  • Loading branch information
cbirchinger authored Jul 8, 2024
1 parent 183935b commit edd766f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion LGTV/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def __get_youtube_id_from_url(self, url_string):
def on(self):
if not (self.__macAddress) and not (self.__ip):
print ("Client must have been powered on and paired before power on works")
send_magic_packet(self.__macAddress, ip_address=self.__ip)
send_magic_packet(self.__macAddress)

def off(self):
self.__send_command("request", "ssap://system/turnOff")
Expand Down

5 comments on commit edd766f

@matt3197
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My LG c4 doesn't turn on unless I execute wakeonlan with the IP, which still works when the TV is off.

wakeonlan -i 1.2.3.4 "d4:26:26:26:26:26"

I updated remote.py and to add the IP. It didn't work, but I now see that my update is EXACTLY what the python code used to have. Still not working though. Trying to figure out why or find a workaround.

@klattimer
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm not 100% certain sending to the broadcast address is correct, imagine if you have two or more TVs on the same network... This is either bad design by LG or a sketchy implementation by us... Needs a bit pondering but I think the IP address should be sent and we should avoid broadcasts.

@themorien
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverting the line back to send_magic_packet(self.__macAddress, ip_address=self.__ip) made the tv turn on for me.

Thank you

@matt3197
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also reverted the code back and functionality to turn the TV on using LGWebOSRemote is now working, whereas it's broken with the latest version of the code.

I tried turning off the "Always Ready" function of my LG C4 to see if I could reproduce the issue that the latest update supposedly fixes, but even with "Always Ready" disabled, the TV correctly powered on using the previous working version of the code.

While each TV should have it's own unique MAC address the identified which TV needs to turn on, the functionality just isn't working for some of us without including the IP.

If we can get some more information and I can reproduce the issue, then I will pass along my findings so that you can decide the best approach to a solution that works for everyone.

We appreciate your code! It's working quite well for me with the IP added back to wakeonlan.

@klattimer
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback, looks like an erroneous PR. I'm going to revert it.

Please sign in to comment.