WOL not working with specific server
#1
Hello wise Kodi forum members, I hope everyone had a great Christmas.

I'm having trouble with WOL after I rearranged my hardware. I hope someone can help me troubleshoot this. I've been messing with it for a little over a week now, so I'm not sure I'll remember everything. If something doesn't make sense, please let me know, and I'll try to clarify or re-test it.

I have a couple of old single-disk Zyxel NAS units and an Atom PC that used to be my Kodi box (LibreELEC), with some local storage for movies. WOL was working fine in this setup - Kodi waking up the Zyxel units.

At some point I replaced the Atom with a Core-i5 PC, which became my Kodi box (again, LibreELEC). WOL was still working fine with the Zyxel units.

Two weeks ago I moved the Core-i5 to another room and set it up as a NAS only using openmediavault - so the hard disks that used to be local storage in the Kodi box are now in a remote NAS. And the Atom PC went back into the media room and returned to its role of Kodi box. In the Atom I installed LibreELEC from scratch, then copied over some files from the previous installation - a few custom scripts, addons, addon_data, sources.xml, advanced_settings.xml, favourites.xml, maybe a few others. I didn't bring over the old databases, I thought it would be easier to start over because the sources were changing. I started cleaning up my sources using the GUI. Pointing each source to the new IP and shared folder (I'm using SMB, by the way). Then set the content and let Kodi scan each source to rebuild the databases.

Now Kodi can wake up any Zyxel NAS when needed, but not the Core-i5 most of the time. I can wake the Core-i5 fine from my cell phone using a free app or from my Windows PC with a Python script.

One thing I noticed in the Kodi box was the MAC discovery was working for the Zyxels, but failing for the Core-i5. I manually added the Core-i5 to sources.xml and to the ARP table in the Kodi box, and the GUI warnings disappeared. Did I mask a bigger problem here?

WOL would still not work with the Core-i5. I checked the logs and I could see Kodi calls to wake the Zyxel NAS, but not to wake the Core-i5 - as if it wouldn't think it needed to.

A couple of days ago I was trying to play a movie and trigger the WOL call, it didn't work, and I got distracted with something else. I came back some 10-15 minutes later, tried again with the same movie, and it worked. I started to suspect there was a timing issue. So I went into wakeonlan.xml and reduced the timeout setting to 10 seconds. At first it seemed to help - I would hit <Enter> on a movie, Kodi would tell me it was no longer available, then I would wait for 20-30 seconds and try again, and it worked. But it doesn't seem to be consistent. Yesterday I tried to do the same thing, it didn't work.

I can still wake the Core-i5 from my cell or from the Windows PC whenever I want, it always works.

I wonder 1) if I did something wrong, 2) if this is something easy to fix, 3) if I should start from scratch again (i.e., reinstall LibreELEC).

Here's a log file. I enabled debugging, tried to play a movie a couple of times (see "LIRC: - NEW 1c 0 KEY_ENTER devinput (KEY_ENTER)"), and disabled debugging again. The WOL wait dialog never came up.

I have removed the hard disk from one Zyxel to use it in the new NAS, but the other Zyxel is still active. I'm not using it as a source anymore, but I think I can set it up again for a test if needed.

Any help will be appreciated.

Thank you,

VMat
Reply
#2
And just now I played a file from local storage, then stopped and tried a different file from the new NAS, and it triggered the WOL call.

Partial log here.

Thank you,

VMat
Reply
#3
I'd first ask myself if WoL packet is received 100% of the time by the network segment your server is in. You can run tcpdump or wireshark to find this out. Then you could use wakeonlan app for your mobile to try different options like magic packet with different IP addresses (broadcast on network or specific address).
Maintainer of Kodi from Debian | Got an issue with Kodi from Debian? Report it here: Kodi from Debian - Support Thread
Reply
#4
(2022-12-28, 02:58)basilgello Wrote: I'd first ask myself if WoL packet is received 100% of the time by the network segment your server is in. You can run tcpdump or wireshark to find this out. Then you could use wakeonlan app for your mobile to try different options like magic packet with different IP addresses (broadcast on network or specific address).

Hi basilgello,

Sorry, please bear with me while I try to follow that.

WOL never fails when initiated from my cell phone or from my Windows PC. I would think the receiving end is working fine. What am I missing?

When initiated from the Kodi box, it will either work, in which case I'll see it in kodi.log and on the GUI dialog, or not work, in which case I will not see it in kodi.log and there is no GUI dialog. The latter case is the one I'm focused on. It seems to me the magic packet is never sent in this case, so what are we looking for in the network trace? Or again, what am I missing?

Thanks,

VMat
Reply
#5
So the issue is that Kodi does not try to emit WoL in some cases, right?
Maintainer of Kodi from Debian | Got an issue with Kodi from Debian? Report it here: Kodi from Debian - Support Thread
Reply
#6
Reading WakeOnAccess code I want to check if it is better to shoot WakeOnLan packet first to broadcast ipv4 address. Yatse does exactly that and it works reliably. The reason the dialog can be omitted is https://github.com/xbmc/xbmc/blob/21d98c...s.cpp#L471
Maintainer of Kodi from Debian | Got an issue with Kodi from Debian? Report it here: Kodi from Debian - Support Thread
Reply
#7
(2022-12-28, 05:05)basilgello Wrote: So the issue is that Kodi does not try to emit WoL in some cases, right?

Correct. I mean, that's how I see it when I look at the logs I posted.
Reply
#8
(2022-12-28, 05:13)basilgello Wrote: Reading WakeOnAccess code I want to check if it is better to shoot WakeOnLan packet first to broadcast ipv4 address. Yatse does exactly that and it works reliably. The reason the dialog can be omitted is https://github.com/xbmc/xbmc/blob/21d98c...s.cpp#L471

Looking at CWakeOnAccess::FindOrTouchHostEntry I can see it checks the "next wake" time against the current time. That might explain why I get it to work after some time playing a video from local storage... Huh

I'm not great at C++, I'd need to spend several days setting up a dev environment and testing this theory. But I'd try to force a return true from that method to see what happens. Or at least debug-print the variables inside it to see if it's ever setting need_wakeup to true.

VMat
Reply
#9
I am not a LibreELEC expert, but if you can ssh into your box, you can use gdb there to debug Kodi without building it from sources.
https://hex.ro/wp/blog/gdb-changing-the-...g-program/
Maintainer of Kodi from Debian | Got an issue with Kodi from Debian? Report it here: Kodi from Debian - Support Thread
Reply
#10
(2022-12-28, 15:25)basilgello Wrote: I am not a LibreELEC expert, but if you can ssh into your box, you can use gdb there to debug Kodi without building it from sources.
https://hex.ro/wp/blog/gdb-changing-the-...g-program/

This looks very promising!

Seems like I need to figure out how/where to place the source files, though. Right now I can see the stack trace, but I'm not able to print any variable contents. I'll look into it in the next few days and report back.

Thank you,

VMat
Reply
#11
Sorry, had to take a break from this. Now back at it...

I got a new SSD yesterday for another project. And I still have the old HDD with the LibreElec installer. So I thought it would be a good test to start from scratch and see what happens, without touching the existing installation in the old SSD.

It turns out... I installed LibreElec, set up one source pointing to the new NAS, let Kodi scan it for media, and turned on WOL in settings. The MAC discovery worked, immediately - good sign. Then I turned off the NAS, went to my movies in Kodi and hit the first one. WOL worked right away.

I wanted to know what was different. So I plugged in both SSD's and booted the Kodi box to the new one. And started comparing things and copying files over from old to new, piece-by-piece. It seems all was well until I copied the Addons*.db files. Next time I started Kodi, WOL wouldn't work anymore.

Anyway... at this point, I think it's pretty safe to say the problem is not in the NAS, but in my Kodi installation. Unless someone thinks there's still value in troubleshooting this, I'll just nuke the old SSD and start from scratch.

Thanks,

VMat
Reply

Logout Mark Read Team Forum Stats Members Help
WOL not working with specific server0