Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not a bug: Help with WOL packet forward request #214

Open
Amoeba00 opened this issue May 24, 2024 · 10 comments
Open

Not a bug: Help with WOL packet forward request #214

Amoeba00 opened this issue May 24, 2024 · 10 comments

Comments

@Amoeba00
Copy link

Has anyone figured out how to properly setup a packet forward for the WOL component? It all works fine on the same subnet - so it's not a bug - but wondered if anyone out there was able to come up with a solution.

Port forward works fine to 3001 - and the TV definitely turns off or goes to sleep when expected.
Port forward to 7 and/or 9 does not - TV won't wake back up and I have to use the remote.

Any suggestions?

I have the TV behind a router specifically for IOT devices.
Debug log file (redacted) when performing the "Test" from the app:

[     .        .    ][D---][   LG TV   ]  Magic packets (WOL) are already being sent out
[     .        .    ][D---][   LG TV   ]  WOL-tastic packet > <WAN IP of Router>     - OK
[     .     14:48:13][D---][   LG TV   ]  WOL-tastic packet > <WAN IP of Router>     - OK
[     .     14:48:14][D---][   LG TV   ]  WOL-tastic packet > <WAN IP of Router>     - OK
[     .     14:48:15][D---][   LG TV   ]  WOL-tastic packet > <WAN IP of Router>     - OK
[     .     14:48:16][D---][   LG TV   ]  WOL-tastic packet > <WAN IP of Router>     - OK
[     .     14:48:17][D---][   LG TV   ]  The socket was closed due to a timeout (onConnect)
[     .        .    ][D---][   LG TV   ]  Retrying connection...
[     .        .    ][D---][   LG TV   ]  Magic packets (WOL) are already being sent out
[     .        .    ][D---][   LG TV   ]  WOL-tastic packet > <WAN IP of Router>     - OK
[     .     14:48:18][D---][   LG TV   ]  WOL-tastic packet > <WAN IP of Router>     - OK
[     .     14:48:19][D---][   LG TV   ]  WOL-tastic packet > <WAN IP of Router>     - OK
[     .     14:48:20][D---][   LG TV   ]  WOL-tastic packet > <WAN IP of Router>     - OK
[     .     14:48:21][D---][   LG TV   ]  WOL-tastic packet > <WAN IP of Router>     - OK
[     .     14:48:22][D---][   LG TV   ]  The socket was closed due to a timeout (onConnect)
[     .        .    ][D---][   LG TV   ]  Retrying connection...
[     .        .    ][D---][   LG TV   ]  Magic packets (WOL) are already being sent out
[     .        .    ][D---][   LG TV   ]  WOL-tastic packet > <WAN IP of Router>     - OK
[     .     14:48:23][D---][   LG TV   ]  WOL-tastic packet > <WAN IP of Router>     - OK
[     .     14:48:24][D---][   LG TV   ]  WOL-tastic packet > <WAN IP of Router>     - OK
[     .     14:48:25][D---][   LG TV   ]  WOL-tastic packet > <WAN IP of Router>     - OK
[     .     14:48:26][D---][   LG TV   ]  WOL-tastic packet > <WAN IP of Router>     - OK
[     .     14:48:27][D---][   LG TV   ]  The socket was closed due to a timeout (onSSLhandshake)
[     .        .    ][D---][   LG TV   ]  WOL-tastic packet > <WAN IP of Router>     - OK
[     .        .    ][D---][   LG TV   ]  Retrying connection...
[     .        .    ][D---][   LG TV   ]  Magic packets (WOL) are already being sent out
[     .     14:48:28][D---][   LG TV   ]  WOL-tastic packet > <WAN IP of Router>     - OK
[     .     14:48:29][D---][   LG TV   ]  WOL-tastic packet > <WAN IP of Router>     - OK
[     .     14:48:30][D---][   LG TV   ]  WOL-tastic packet > <WAN IP of Router>     - OK

Thanks!

@JPersson77
Copy link
Owner

JPersson77 commented May 24, 2024

Hi @Amoeba00 yes there are success stories. Wol magic paxkets are UDP, is your router able to forward UDP? What is the make/model of router?

Another idea is to enable "always ready" if you have that feature on the TV as the app (v4) can power on the TV without WOL if that feature is enabled

@Amoeba00
Copy link
Author

Hey - thanks for the quick response...

I'm running AsusWrt-Merlin and I've got the forward packet set as UDP. My LG in question is the C1. I found a thread where it could be an issue with QuickStart+ on or off and then ethernet or actual Wifi, but considering it works fine when I plug it in directly on the same switch/LAN - I don't think it's the TV... which is why I'm wondering what specifically worked.

I also tried all the combinations with the new Persistence option and of course the regular WOL options in the app. Any other suggestions for me to try? Thanks much!

Router Port Forward Config:

LG_PortForward_WOL

@JPersson77
Copy link
Owner

JPersson77 commented May 25, 2024

Thanks, there is also Discord where you may want to ask the same question.

I think the configuration looks allright. Also, assuming that it is possible, you may have more success if you edit the ARP table of the router to add the TV IP.

The packet is sent to port 9 (discard protocol) so a forward on that port is correct. (In a sense the port does not matter for wol since it is layer2 - as soon as a network interface receives the specific magic packet it does not matter which port it was sent to)

Can you connect a pc to the TV-subnet and run wireshark to see if the packets are forwarded properly.

Can you try using a well known tool such as aquilasoft's wake-on-lan to see an udp packet sent ro the router is Forwarded to the subnet? (Just to dismiss the possibility that the magic packet from lgtv companion is incorrectly formatted in some way)

@JPersson77
Copy link
Owner

JPersson77 commented May 25, 2024

Also, another shot. Did you try forwarding to the broadcast address instead of the TV IP. I.e 255.255.255.255 or alternatively (fictive, since I don't know exactl IPs) 192.168.1.255 if the netmask is 255.255.255.0

@Amoeba00
Copy link
Author

Amoeba00 commented May 28, 2024

OK - so I decided to plug the computer into the same router as the switch - just to make sure it was still working as expected. And now - your software doesn't even trigger the TV off. So then I went to ColorControl - and that test on/off works. (I do prefer yours because the memory footprint is significantly lower than CC). So now I'm starting over with LGTV Companion to get that working on the same LAN. I think it got wrapped around the axle with having a different IP without deleting the entry. Once I get yours working on the same LAN - then I'll go back to the port forward (fwiw, I did make the arp table entry a while ago when I first started troubleshooting this, but haven't gone with wireshark yet).

Thanks again for your responses, maybe I just need to start with a clean slate (or even try with another computer to rule out mine).

@JPersson77
Copy link
Owner

Hi @Amoeba00 any success?

@Amoeba00
Copy link
Author

Amoeba00 commented Jun 9, 2024

Uhh - what did you change with v4.03?!?! It now works through the router!

@JPersson77
Copy link
Owner

No big changes in v4.0.3 that should specifically affect this. But v4 can power on a device without WOL if "always ready" is enabled like mentioned previously - can it be that? Or did the UDP forward start working?

@Amoeba00
Copy link
Author

So weird - and now it's back to not working - which leads me to believe it's the router. When I posted that, the test from the app worked quite a few times, but it wouldn't work resuming from sleep - so as I was about to troubleshoot that - now the test stopped working. The only logical explanation at this point is that the remote control is now sentient and it doesn't want to lose its significance.

@JPersson77
Copy link
Owner

A bit of humor always goes a long way for sure. I think it's likely the remote may have evolved as well. :-D

Oh well, let's leave the thread open and maybe someone can contribute with some additional feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants