Hi! My Vero 4K+ just in, and I’m working on replacing my old LibreElec NUC. I’ll explain my WoL challenge
I have a Windows 10 ‘server’ functioning as a NAS. It’s configured to be awake only when needed. When any PC or laptop on the network turns on, the NAS gets a WoL-request and wakes up. As long as any of the (fixed) IP addresses of the PC/laptops remain pingable, the NAS remains on. Pings all negative? NAS turns off.
The Vero remains pingable after suspending. So there’s the challenge.
- Is there a way to disable the network on the Vero at suspend?
- Is there a way to send a WoL-request when the Vero comes out of suspended mode?
Thanks in advance for any advice!
I don’t know about #1 but I believe
settings>system>power savings>try to wake remote servers on access>[enable]
auto discovers the MAC address and sends a WOL request as needed.
From the Wiki I got the impression mounting network shares with autofs was the way to go. But in that case the mapped folders are no longer on a remote server, as far as Kodi is concerned. So no WoL.
I did just find a script for wake.py though. Trying that now.
My main concern is #1 though, I really have no idea how to handle that just yet.
P.S. I forgot to mention the MySQL database for Kodi is also running on the NAS server.
Depending on whether you are using Wired or Wireless networking, you could do: connmanctl disable ethernet or connmanctl disable wifi and then re-enable in wake.py.
os.system() would be a quick and cheerful way to do this instead of interacting with the network manager via DBus. You shouldn’t need privileges, if memory serves.
Good luck with that, your going to need it. Kodi gets rather upset when it doesn’t have immediate access to MySQL. If you manage to get it to work without Kodi crashing every time expect a good 2-5 minutes on wakeup where Kodi appears to be frozen before it springs back to life again. I haven’t tried letting my Windows server sleep for the better part of the last decade just because it caused more problems than the cost of the extra electricity was worth.
Thanks for your input guys. I’m realizing I also need to consider the Home Assistant automations that use the IR blaster to turn the TV to the proper source for Kodi, when Kodi is turned on. Seems Kodi is always ‘idle’ now, never ‘off’.
Probably I’d better move the MySQL database to the Vero then somehow.
Looks like I’ll be doing some redecorating.
If you are using CEC on your TV then you should be able to do it that way instead of messing with IR. If Kodi’s CEC settings are set to allow switching input you could put in your wakeup script
kodi-send -a CECActivateSource
I couldn’t get CEC to work reliably on my Samsung TV on a Raspberry Pi before. But perhaps I’ll give it another shot, thanks.
I think the power and source switching are pretty much the minimum for any CEC device to have so you stand a shot. If
CECActivateSource doesn’t work you can give
CECToggleState a try.
It seems the CEC controls to turn on and off the TV at suspend are already part of the Kodi GUI. So apparently no need to edit wake.py / standby.py. I found the settings here:
Settings > system settings > input > peripherals > CEC adapter
Settings to activate were:
- Turn devices to standby mode when screensaver activates
- Wake devices when screensaver stops
Then in Settings > Interface > Screensaver
3. Adjusted the screensaver timeout to 10 minutes (default was 3).