Cathwyler / MagicRemoteService

Use your LG Magic Remote as a Windows mouse and control your PC with the LG Magic Remote from your LG WebOS TV
GNU General Public License v3.0
48 stars 2 forks source link

Wake-on-LAN not working #6

Closed Spottyfriend closed 5 months ago

Spottyfriend commented 10 months ago

I have set my PC to work with Wake-on-LAN, and I have tested it with this app on my phone to make sure the settings are correct, and it works perfectly. However, MagicRemoteService's WOL function does not work for me.

Cathwyler commented 10 months ago

To have Wake-on-LAN working you have to set the correct PC MAC adrress in the TVs tab in the PC app. If you change the MAC adress you need to reinstall the app again on the TV for the change to take effect. Be careful if you have multiple network card (Wifi, Ethernet, VPN) the MAC address need to match the one who is used to for data exchange between PC and TV. You can use Wireshark to see if you receive or not the Wake-on-LAN message (unplug the HDMI and the TV will think the PC is shut down and you will have access to the startup button. After strike the button, the TV is broadcasting the magic packet every 2 seconds.

Regards,

Cathwyler

Peskinator commented 6 months ago

Hi,

I am having the same issue. I installed Wireshark, started sniffing packets then unplugged the HDMI cable like suggested, to have access to the start button. I clicked on it, but also used an app on my phone to broadcast the magic packet from another source that is known to work.

As a result, I can see the magic packets sent from my phone, but nothing from the TV's IP address. Thank you!

Cathwyler commented 6 months ago

Can you tell me which webOS sdk version you are running ?

There is probably an error while broadcasting the magick packet. I just fixed a catching error message and i will publish a release tomorow.

Can you check if there is any exception message in the web inspector while broadcasting magick packet ?

Peskinator commented 6 months ago

Here are the info: webOS TV Version: 6.2.1-2414 (on LG C1) Software Version: 03.25.25 Using MagicRemote Service 1.2.2.12

Attached is a screenshot of the console after clicking on "Inspect". Thanks for your support on this! image (i did the same and unplug the HDMI Cable, and click Start) but not message in the output)

Cathwyler commented 6 months ago

There is no error occuring on the TV app. Everything seems normal. And you have a similar TV version than me.

ares-device-info -d CATHWYLER-TVSALON -i
modelName : OLED65C15LA
sdkVersion : 6.3.3
firmwareVersion : 03.36.50

Its probably a network or a configuration issue. The fact is that your PC is receiving the broadcasting magic packet sent from your smartphone but not from your TV. Unfortunatly i don't have free time actually to perform some test issues. But i can give you somes workarounds.

One possibility is that you have wifi AND ethernet enabled on your TV and the broadcasting magic packet is sent to the wrong TV network card.

An other possibility is that your TV is on a guest wifi network and your PC on a private one.

And a third one is that your router is simply blocking broadcasting from your TV because of IDK reason (Not known device, Broadcasting Wifi to Ethernet or Ethernet to Wifi issue, Only fixed IP allowed...).

Let me know if you find any relevant information or you finally solve your issue.

Peskinator commented 6 months ago

Thanks for all your suggestions. This gave me ideas and I continued digging.

Turns out: The magic packet from the TV was not interpreted by Wireshark as a MagicPacket for some reasons. I fixed it by checking "Try heuristic sub-dissectors first" preference in the UDP section of WireShark. (as mention at the end of https://wiki.wireshark.org/WakeOnLAN ).

Doing this confirmed that when Clicking on the Start button (After unplugging the HDMI Cable), does work, and is indeed starting my computer.

So in fact the problem is that the Magic packet is only sent in this scenario (TV is ON, then I unplug the cable, then I press start). Its not sent when starting the TV, and it's not sent when pushing the red button on the remote.

Does those conclusions make sense ?

Thanks again for since amazing tool !

Peskinator commented 5 months ago

After even more digging, I finally know what was the problem:

My TV is not directly plugged to my PC, but through a Soundbar. (PC--HDMI-->Soundbar--HDMI-->TV). So when the TV starts with the computer being off, I don't see the popup with the Start button because the app detects that something is plugged to the input: The soundbar. So I don't have the opportunity to send the magic packet. I see another popup saying something the PC cannot be detected, but no Start button.

If I plug the TV to the PC directly (bypassing my soundbar) everything works as you designed it.

Unfortunately I can't change my setup because the soundbar works way better like this for PC gaming and DTS Movies.

Potential solution could be displaying the Start button in the other popups, or sending the Magic Packet on a Red button press for instance. Maybe there are other solutions but so far i can only think of those ones.

Cathwyler commented 5 months ago

That’s what I was going to suggest. At the beginning, you don’t see the start-up dialog. The app think the PC is booting and that's why you don't see the start-up dialog. After 30 seconds an error connection dialog appears.

I will add an option to circumvent this mechanism in the case of indirect plugging.

Regards

Cathwyler commented 5 months ago

You can try this pre-release 1.2.3.0. I added a direct HDMI wiring option. You need to uncheck it and install on TV.

Let me know if it works fine.

Peskinator commented 5 months ago

Thanks! It works!! That's exactly what I needed :)