Linux - [RELEASE]Plugin for Timer- and Powermanagement in XBMC and TVHeadend

  Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Hasu0bs Offline
Senior Member
Posts: 165
Joined: Jan 2011
Reputation: 2
Post: #61
You cannot edit any files in the openelec filesystem since it is read only. Thus these scripts can not be used on openelec. BUT if you look under settings and PVR stuff you will find that they have already been implemented. I never tested this but it is supposed to work...
find quote
Daddy_Dog Offline
Junior Member
Posts: 16
Joined: Feb 2013
Reputation: 0
Location: UK
Post: #62
Many thanks: I'll ask in the OpenELEC forum.
find quote
Hasu0bs Offline
Senior Member
Posts: 165
Joined: Jan 2011
Reputation: 2
Post: #63
Have you even tried the build in functions?

http://openelec.tv/forum/13-miscellaneou...esn-t-work
find quote
Daddy_Dog Offline
Junior Member
Posts: 16
Joined: Feb 2013
Reputation: 0
Location: UK
Post: #64
Hasu0bs - Not sure I know what you are referring to, but I cannot find any options for auto wake-up in either XBMC or the Tvheadend configurations
find quote
_BJ1 Offline
Senior Member
Posts: 166
Joined: Apr 2010
Reputation: 0
Location: Germany
Post: #65
New version 0.1.6 is out. See post #1 in this thread. The script waits for postprocessor scripts or commands (e.g. comskip, markad) which can defined within tvheadend before shutdown the system. This is optional and can configured in the setup of the plugin.
find quote
_BJ1 Offline
Senior Member
Posts: 166
Joined: Apr 2010
Reputation: 0
Location: Germany
Post: #66
New version 0.1.7 is out. See post #1.
find quote
spontex Offline
Member
Posts: 94
Joined: Jan 2012
Reputation: 0
Post: #67
Hi,
I am currently using htpc-wakeup-scheduler but I am considering switching to this plug-in that I have just discovered.

I have a few questions about it:
* Does it check for network activity before shutting down the computer? E.g. if an incoming SSH connection is active or a NFS share is being accessed, does it prevent the computer from shutting down.
* Does it take into account the Tvheadend pre-recording time + the system boot time in order to set the next wakeup time?

Thank you for your work!
find quote
_BJ1 Offline
Senior Member
Posts: 166
Joined: Apr 2010
Reputation: 0
Location: Germany
Post: #68
(2013-08-28 19:29)spontex Wrote:  * Does it check for network activity before shutting down the computer? E.g. if an incoming SSH connection is active or a NFS share is being accessed, does it prevent the computer from shutting down.
No. But this feature will be implemented in future releases.
(2013-08-28 19:29)spontex Wrote:  * Does it take into account the Tvheadend pre-recording time + the system boot time in order to set the next wakeup time?
Yes.
find quote
spontex Offline
Member
Posts: 94
Joined: Jan 2012
Reputation: 0
Post: #69
Ok,
About the network activity, I have improved today the htpc-wakeup-scheduler to check it.
I used this code and it seems to work at this time:

Code:
def detectNetworkActivity():
  import subprocess
  output = subprocess.Popen('netstat -ano | grep ESTABLISHED | grep -v "127.0.0.1" | grep -v "off"',
                          stdout=subprocess.PIPE,
                          shell=True).communicate()
  output = output[0].strip().split("\n")
  for line in output:
    logging.info('Netstat output: ' + line)
  clients_nb = len(output)
  logging.info(str(clients_nb) + ' client(s) connected')  
  return clients_nb > 0
(This post was last modified: 2013-08-28 20:31 by spontex.)
find quote
_BJ1 Offline
Senior Member
Posts: 166
Joined: Apr 2010
Reputation: 0
Location: Germany
Post: #70
Oh, thanks for the code. Will check and implement this in the next days!
find quote
spontex Offline
Member
Posts: 94
Joined: Jan 2012
Reputation: 0
Post: #71
Ok, I will then switch to this plug-in when it handles the network connections, because I store my documents on my HTPC (which used to be always on) and I do not want these NFS shares to be disconnected when accessing them or my SSH sessions to be ended unexpectedly. Perhaps should I move my documents to a NAS server...
Thank you again
find quote
spontex Offline
Member
Posts: 94
Joined: Jan 2012
Reputation: 0
Post: #72
Hi,
Below is a small fix in the network activity detection code:

Code:
# detects incoming network activity
def detectNetworkActivity():
  import subprocess
  output = subprocess.Popen('netstat -ano | grep ESTABLISHED | grep -v "127.0.0.1" | grep -v "off"',
                          stdout=subprocess.PIPE,
                          shell=True).communicate()
  output = output[0].strip()
  if output:
    output = output.split("\n")
    for line in output:
      logging.info('Netstat output: ' + line)
    clients_nb = len(output)
  else:
    clients_nb = 0    
  logging.info(str(clients_nb) + ' client(s) connected')      
  return clients_nb > 0
find quote
_BJ1 Offline
Senior Member
Posts: 166
Joined: Apr 2010
Reputation: 0
Location: Germany
Post: #73
0.1.8 is out. Check of active network connections implemented. Be aware that this isn't tested with a NAS because I don't own such a thing. So handle this option with care. Feedback is also welcome. Anyway check of active users via ssh or active connections via samba works fine.
find quote
spontex Offline
Member
Posts: 94
Joined: Jan 2012
Reputation: 0
Post: #74
Great!
I will install your plug-in soon.
Thank you
find quote
spontex Offline
Member
Posts: 94
Joined: Jan 2012
Reputation: 0
Post: #75
Hi,
I have just installed your plug-in.
At this time I do not know if my computer will stop when no recording is active .. I will let you know!

About the installation instructions:
- The README file assumes you use /home/xbmc but I use /home/<login> so they should perhaps use ~ or $HOME in order to be generic
- My remote mapping did not seem to work when I used a remote.xml file. I renamed it to keyboard.xml (as indicated in the XBMC wiki) and now it works. I did not try again with remote.xml but I can if needed...
- The README file should mention that the TvHeadend username and password need to be set up inside XBMC.

Again, thank you for this add-on!
find quote
Post Reply