2018-07-01, 07:01 AM
My KODI/XBMC box is running on a Raspberry Pi. It's very solid and works great. The NextPVR addon seems to be doing it's job mostly; it downloads guide data, lets me watch live TV, and does recordings. The NextPVR backend is running on home built server running Windows Server 2012. It too is very solid, and works great! I have 53tb of storage, filled to 6tb free with Music, Family Pictures, TV Shows, Movies, Games, backup storage, etc. I also have 3 tuners capable of receiving 5 channels at once. The NextPVR backend software runs on boot up, and communicates with Kodi regularly, as I said working well in harmony.
Anyway, enough back story.. My problem:
I've been missing a lot of recordings due to (I believe) a problem with the addon not waking the server to record a show. If the server is running and awake when a recording is due to start, it works perfectly fine. But I've actually witnessed a show get missed because the server doesn't wake to start. At first, I thought there was a 2-way communication between Kodi (Raspberry Pi) and NextPVR (server). Where if a schedule is made, it creates a timer on the server to wake itself up in time for the recording. But the more I research it, it looks like that's not the case at all. Kodi is apparently supposed to be sending a WOL (wake-on-lan) packet to the server to get things started. In my case, it seems like it's not doing that job. When I look in the PVR settings of Kodi, there is a "Power Saving" tab, where there appears to be a script being called that initiates the wake up. That script is said to be located in "/usr/bin/setwakeup.sh". I looked at that file and it doesn't have any information as to what it's doing, or anywhere to input an IP address. Could this be where my problem is? Am I missing something here?
Contents of "/usr/bin/setwakeup.sh":
For a test, I have a set recording schedule made for "The Price is Right", which is on CBS daily at 11:00am (EST) M-F. When I'm home from work some days, I have watched to see if the server wakes up for the recording. I've had the schedule set for a month, and to date there have only been maybe 3 recordings. I know the show is on, and Kodi shows the timers are enabled and then missed, with an error like "NextPVR backend was not available". Well duh, you never woke the server up!
Is there some trick I need to do to make this work? I suppose I could go in on the server and manually create a wake up timer to have the system be on from 11:00am-12:00pm every day. But that defeats the purpose. Shouldn't this all work automatically? Looking for any help or advice here, I'm completely lost.
Thanks!
Anyway, enough back story.. My problem:
I've been missing a lot of recordings due to (I believe) a problem with the addon not waking the server to record a show. If the server is running and awake when a recording is due to start, it works perfectly fine. But I've actually witnessed a show get missed because the server doesn't wake to start. At first, I thought there was a 2-way communication between Kodi (Raspberry Pi) and NextPVR (server). Where if a schedule is made, it creates a timer on the server to wake itself up in time for the recording. But the more I research it, it looks like that's not the case at all. Kodi is apparently supposed to be sending a WOL (wake-on-lan) packet to the server to get things started. In my case, it seems like it's not doing that job. When I look in the PVR settings of Kodi, there is a "Power Saving" tab, where there appears to be a script being called that initiates the wake up. That script is said to be located in "/usr/bin/setwakeup.sh". I looked at that file and it doesn't have any information as to what it's doing, or anywhere to input an IP address. Could this be where my problem is? Am I missing something here?
Contents of "/usr/bin/setwakeup.sh":
Code:
#!/bin/sh
################################################################################
# This file is part of OpenELEC - [url]http://www.openelec.tv[/url]
# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
#
# OpenELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# OpenELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
if [ -f /sys/class/rtc/rtc0/wakealarm ]; then
logger -t setwakeup.sh "### Setting system wakeup time ###"
echo 0 > /sys/class/rtc/rtc0/wakealarm
echo $1 > /sys/class/rtc/rtc0/wakealarm
logger -t setwakeup.sh "### $(cat /proc/driver/rtc) ###"
fi
For a test, I have a set recording schedule made for "The Price is Right", which is on CBS daily at 11:00am (EST) M-F. When I'm home from work some days, I have watched to see if the server wakes up for the recording. I've had the schedule set for a month, and to date there have only been maybe 3 recordings. I know the show is on, and Kodi shows the timers are enabled and then missed, with an error like "NextPVR backend was not available". Well duh, you never woke the server up!
Is there some trick I need to do to make this work? I suppose I could go in on the server and manually create a wake up timer to have the system be on from 11:00am-12:00pm every day. But that defeats the purpose. Shouldn't this all work automatically? Looking for any help or advice here, I'm completely lost.
Thanks!