PowerScheduler++ test versions (2 Viewers)

Expupil

New Member
July 22, 2009
1
0
Home Country
United Kingdom United Kingdom
Re: PowerScheduler++ Test Versions - 1.1.7.1 for MP 1.2.0 Beta

Thanks for all the effort you have put into this plugin.

I have switched to using this, from the standard Power Scheduler, as there there were problems when using a Kingston SSD and waking again after the first hibernate cycle.

PowerScheduler++ has had no problems resuming from S4 Hibernate.

But what I would prefer is to is wake from S5 Shutdown.

Resuming from Hibernate or rebooting take about the same time on my system, so a clean reboot every power on would be my favorite choice.

I tried using the S5 shutdown option in the settings, but although the wakeup timer is set before shutdown, the system does not wake up.

Is it possible to make it work this way, or if not, can the system S4 hibernate without writing the hibernate file, so it always reboots when waking up?
 

pünktchen

Portal Pro
October 26, 2010
537
201
Home Country
Germany Germany
AW: PowerScheduler++ Test Versions - 1.1.7.1 for MP 1.2.0 Beta

Write a batch file called "mytest.bat":
if %0 == wakeup (
echo wakeup
cmd.exe /k mytestprogram.bat

Your sample is for the wakeup case, am I right?
If argument wakeup is true, than write a message "wakeup" and start "mytestprogram.bat".
It doesn't work for me.

Sorry for any inconvenience.
pünktchen
 

michael_t

Portal Pro
November 30, 2008
1,258
813
Home Country
Germany Germany
AW: PowerScheduler++ Test Versions - 1.1.7.1 for MP 1.2.0 Beta

pünktchen
Sorry for the last post, I had a browser crash and did not realize that it was already sent.

What I meant is:
As a command you could enter e.g. "cmd.exe /C <mypath>\mytestprogram.bat". The argument ("suspend" or "wakeup") is added to the command provided when it is called by PS++. So what is really called is either "cmd.exe /C <mypath>\mytestprogram.bat suspend" or "cmd.exe /C <mypath>\mytestprogram.bat wakeup". In your program code you can query the argument to decide if there is something to do or not:
Code:
if %1==suspend (
  echo parameter is suspend > mytestprogram.log
  rem do something...
) else (
  echo parameter is wakeup > mytestprogram.log
  rem do nothing ...
)

Expupil
It is not possible for a PC to wakeup from S5. This has nothing to do with PowerScheduler or Windows but is a hardware issue.

BTW: Do you use Windows XP or Win7/Vista? For Win7/Vista you should definitifely not use "Hibernate" (S4), because otherwise away mode will not work (Windows feature). Instead you should use "Hybrid sleep" which is a combination of S3 and S4 - it saves data to disk (S4) to survive a possible power loss but regularly resumes from ram (S3) which is very fast.

Michael
 

pünktchen

Portal Pro
October 26, 2010
537
201
Home Country
Germany Germany
AW: PowerScheduler++ Test Versions - 1.1.7.1 for MP 1.2.0 Beta

Hey Michael,

I'm just to stupid today. Nothing works:
test.PNG
View attachment program.rar
:sorry:
 

michael_t

Portal Pro
November 30, 2008
1,258
813
Home Country
Germany Germany
AW: PowerScheduler++ Test Versions - 1.1.7.1 for MP 1.2.0 Beta

What is not working? Enable extensive logging for PS++ and have a look at the logs for the time of suspend / wakeup. The call to the external command should be logged.

Addition: The external command can be a batch file (*.cmd or *,bat), so you do not have to call it with "cmd.exe /C".

Do step by step for debugging:
  • Select your script file (test.bat) from the file dialog right to the text box.
  • See in TvServer log if it gets called without errors.
  • If this works you can work on the script code itself.

Michael
 

fmulders

MP Donator
  • Premium Supporter
  • June 3, 2009
    99
    14
    51
    Home Country
    Netherlands Netherlands
    Re: PowerScheduler++ Test Versions - 1.1.7.1 for MP 1.2.0 Beta

    I have a possible angle on resolving the mute and awake from away mode / sleep after away mode issue. I found a utility called NirCmd, which can UnMute the system. It could be run after a resume to UnMute the system:

    NirCmd - Windows command line tool

    Thanks for this tip!
    I had the mute issue sometimes when waking from away mode. With this cmd tool I let the system unmute after every resume.
    It works perfect!
     

    pünktchen

    Portal Pro
    October 26, 2010
    537
    201
    Home Country
    Germany Germany
    AW: PowerScheduler++ Test Versions - 1.1.7.1 for MP 1.2.0 Beta

    Enable extensive logging for PS++ and have a look at the logs for the time of suspend / wakeup. The call to the external command should be logged. Do step by step for debugging:
    First make sure that cmd.exe without any arguments is called (select it with the file browser button right to the text box).
    Then add the "/C C:\test.bat" to the textbox and see if your script is being called (let it do something you can verify - e.g. write to a log file)

    Hallo Michael,

    I've done what you've sad and thats what I get:
    tv.log
    Code:
    2011-08-05 14:57:01.597234 [(9)]: PowerScheduler: RegisterRemote tag: 6, uris: http://localhost:31458/dd4b7ad1_0b59_44ba_9f85_259d639aad55/hwfnm3nvfqiwuluilvpvy3c__1.rem, http://localhost:31458/dd4b7ad1_0b59_44ba_9f85_259d639aad55/hwfnm3nvfqiwuluilvpvy3c__1.rem
    2011-08-05 14:57:16.162068 [PowerEventThread(8)]: OnPowerEvent: PowerStatus: Suspend
    2011-08-05 14:57:16.164068 [PowerEventThread(8)]: OnPowerEventHandler: PowerStatus: Suspend
    2011-08-05 14:57:16.165068 [PowerEventThread(8)]: TvController.OnSuspend()
    2011-08-05 14:57:16.177068 [PowerEventThread(8)]: Scheduler: stopped
    2011-08-05 14:57:16.204070 [PowerEventThread(8)]: Scheduler: thread stopped.
    2011-08-05 14:57:16.218071 [PowerEventThread(8)]: Stopcard
    2011-08-05 14:57:16.219071 [PowerEventThread(8)]: tvcard:FreeSubChannel: subchannels count 1 subch#0 keep graph=False
    2011-08-05 14:57:16.220071 [PowerEventThread(8)]: DVB subch:0 Decompose()
    2011-08-05 14:57:16.225071 [PowerEventThread(8)]: FreeSubChannel CA: freeing sub channel : 0
    2011-08-05 14:57:16.226071 [PowerEventThread(8)]: tvcard:FreeSubChannel : no subchannels present, pausing graph
    2011-08-05 14:57:16.227071 [PowerEventThread(8)]: dvb:StopGraph called
    2011-08-05 14:57:16.228071 [PowerEventThread(8)]: tvcard:FreeAllSubChannels
    2011-08-05 14:57:16.230071 [PowerEventThread(8)]: dvb:StopGraph
    2011-08-05 14:57:16.246072 [PowerEventThread(8)]: dvb:StopGraph called
    2011-08-05 14:57:16.248072 [PowerEventThread(8)]: tvcard:FreeAllSubChannels
    2011-08-05 14:57:16.251073 [PowerEventThread(8)]: dvb:StopGraph filterstate already stopped, returning.
    2011-08-05 14:57:16.252073 [PowerEventThread(8)]: Stopcard
    2011-08-05 14:57:16.253073 [PowerEventThread(8)]: dvb:StopGraph called
    2011-08-05 14:57:16.254073 [PowerEventThread(8)]: tvcard:FreeAllSubChannels
    2011-08-05 14:57:16.255073 [PowerEventThread(8)]: PowerScheduler: SUSPEND
    2011-08-05 14:57:16.256073 [PowerEventThread(8)]: PowerScheduler: System is going to suspend
    2011-08-05 14:57:16.268074 [PowerEventThread(8)]: Controller: epg stop
    2011-08-05 14:57:16.273074 [PowerEventThread(8)]: user:epg remove
    2011-08-05 14:57:16.274074 [PowerEventThread(8)]: tvcard:FreeSubChannel: subchannels count 0 subch#0 keep graph=False
    2011-08-05 14:57:16.275074 [PowerEventThread(8)]: tvcard:FreeSubChannel :0 - sub channel not found
    2011-08-05 14:57:16.276074 [PowerEventThread(8)]: tvcard:FreeSubChannel : no subchannels present, pausing graph
    2011-08-05 14:57:16.277074 [PowerEventThread(8)]: dvb:StopGraph called
    2011-08-05 14:57:16.278074 [PowerEventThread(8)]: tvcard:FreeAllSubChannels
    2011-08-05 14:57:16.280074 [PowerEventThread(8)]: dvb:StopGraph filterstate already stopped, returning.
    2011-08-05 14:57:16.282074 [PowerEventThread(8)]: PowerScheduler: DeInit controller
    2011-08-05 14:57:16.283074 [PowerEventThread(8)]: Controller: DeInit.
    2011-08-05 14:57:16.284075 [PowerEventThread(8)]: Controller: stop streamer...
    2011-08-05 14:57:16.285075 [PowerEventThread(8)]: RTSP: stop streamer
    2011-08-05 14:57:16.286075 [PowerEventThread(8)]: RTSP: stop all streams (0)
    2011-08-05 14:57:16.288075 [PowerEventThread(8)]: Controller: streamer stopped...
    2011-08-05 14:57:16.289075 [PowerEventThread(8)]: Controller: stop scheduler...
    2011-08-05 14:57:16.290075 [PowerEventThread(8)]: Scheduler: stopped
    2011-08-05 14:57:16.298075 [PowerEventThread(8)]: Controller: scheduler stopped...
    2011-08-05 14:57:16.299075 [PowerEventThread(8)]: Controller: stop epg grabber...
    2011-08-05 14:57:16.300075 [PowerEventThread(8)]: Controller: epg stopped...
    2011-08-05 14:57:16.301075 [PowerEventThread(8)]: Controller: dispose card:Digital Devices DVB-C Tuner 1
    2011-08-05 14:57:16.302076 [PowerEventThread(8)]: dvb:Decompose
    2011-08-05 14:57:16.304076 [PowerEventThread(8)]: tvcard:FreeAllSubChannels
    2011-08-05 14:57:16.306076 [PowerEventThread(8)]:   stop
    2011-08-05 14:57:16.407082 [PowerEventThread(8)]:   Disposing ConditionalAccess
    2011-08-05 14:57:16.408082 [PowerEventThread(8)]:   free...
    2011-08-05 14:57:16.409082 [PowerEventThread(8)]:   free pins...
    2011-08-05 14:57:16.410082 [PowerEventThread(8)]:   free graph...
    2011-08-05 14:57:16.413082 [PowerEventThread(8)]: Remove filter from graph: BDA MPEG2 Transport Information Filter
    2011-08-05 14:57:16.415082 [PowerEventThread(8)]: Remove filter from graph: MediaPortal Ts Analyzer
    2011-08-05 14:57:16.422082 [PowerEventThread(8)]: Remove filter from graph: MPEG2-Demultiplexer
    2011-08-05 14:57:16.426083 [PowerEventThread(8)]: Remove filter from graph: Inf Tee
    2011-08-05 14:57:16.429083 [PowerEventThread(8)]: Remove filter from graph: Digital Devices Common Interface 3
    2011-08-05 14:57:16.435083 [PowerEventThread(8)]: Remove filter from graph: Digital Devices Digital Video Capture 1
    2011-08-05 14:57:16.445084 [PowerEventThread(8)]: Remove filter from graph: Digital Devices DVB-C Tuner 1
    2011-08-05 14:57:16.449084 [PowerEventThread(8)]: Remove filter from graph: DVBC Network Provider
    2011-08-05 14:57:16.451084 [PowerEventThread(8)]:   free devices...
    2011-08-05 14:57:16.452084 [PowerEventThread(8)]:   decompose done...
    2011-08-05 14:57:16.453084 [PowerEventThread(8)]: Controller: dispose card:Digital Devices DVB-C Tuner 2
    2011-08-05 14:57:16.454084 [PowerEventThread(8)]: Controller: dispose card:MediaPortal IPTV Source Filter
    2011-08-05 14:57:16.456084 [PowerEventThread(8)]: Controller: dispose card:RadioWebStream Card (builtin)
    2011-08-05 14:57:16.457084 [PowerEventThread(8)]: RadioWebStream:Dispose()
    [COLOR="Red"]2011-08-05 14:57:16.459085 [PowerEventThread(8)]: PowerScheduler: Starting external command: C:\Windows\System32\cmd.exe /C C:\test.bat suspend[/COLOR]
    2011-08-05 14:57:16.472085 [PowerEventThread(8)]: PowerScheduler: External command finished
    2011-08-05 14:57:17.426140 [(25)]: PowerScheduler: UnregisterRemote StandbyHandler 6
    2011-08-05 14:57:17.427140 [(25)]: PowerScheduler: UnregisterRemote WakeupHandler 6
    2011-08-05 15:00:44.511000 [PowerEventThread(8)]: TV service PowerEventThread 30
    2011-08-05 15:00:44.512000 [PowerEventThread(8)]: TV service PowerEventThread 30
    2011-08-05 15:00:54.567575 [PowerEventThread(8)]: OnPowerEvent: PowerStatus: ResumeAutomatic
    2011-08-05 15:00:54.569575 [PowerEventThread(8)]: OnPowerEventHandler: PowerStatus: ResumeAutomatic
    2011-08-05 15:00:54.570576 [PowerEventThread(8)]: TvController.OnResume()
    2011-08-05 15:00:54.571576 [PowerEventThread(8)]: Controller: setup HeartBeat Monitor
    2011-08-05 15:00:54.573576 [HeartBeatMonitor(20)]: Controller: Heartbeat Monitor initiated, max timeout allowed is 30 sec.
    2011-08-05 15:00:54.576576 [PowerEventThread(8)]: PowerScheduler: RESUMEAUTOMATIC
    2011-08-05 15:00:54.577576 [PowerEventThread(8)]: PowerScheduler: System has resumed from standby
    [COLOR="Red"]2011-08-05 15:00:54.584576 [PowerEventThread(8)]: PowerScheduler: Starting external command: C:\Windows\System32\cmd.exe /C C:\test.bat wakeup[/COLOR]
    2011-08-05 15:00:54.652580 [PowerEventThread(8)]: PowerScheduler: External command finished
    2011-08-05 15:00:54.653580 [PowerEventThread(8)]: PowerScheduler: ReInit Controller
    2011-08-05 15:00:59.654866 [PowerEventThread(8)]: Controller: Initializing TVServer
    2011-08-05 15:00:59.655866 [PowerEventThread(8)]: Controller: 1 init attempt
    2011-08-05 15:00:59.656866 [PowerEventThread(8)]: C:\ProgramData\Team MediaPortal\MediaPortal TV Server\gentle.config
    2011-08-05 15:00:59.659867 [PowerEventThread(8)]: Controller: using MySQL database connection: Server=HTPC;Database=MpTvDb;User ID=root;Password
    2011-08-05 15:00:59.660867 [PowerEventThread(8)]: ----------------------------

    error.log
    Code:
    2011-08-05 14:57:16.470085 [PowerEventThread(8)]: PowerScheduler: Exception in RunExternalCommand():
    2011-08-05 15:00:54.651580 [PowerEventThread(8)]: PowerScheduler: Exception in RunExternalCommand():

    When I start "C:\Windows\System32\cmd.exe /C C:\test.bat suspend" via Windows "run" all is fine:confused:

    Do you need more logs?

    Thanks
    pünktchen
     

    michael_t

    Portal Pro
    November 30, 2008
    1,258
    813
    Home Country
    Germany Germany
    AW: PowerScheduler++ Test Versions - 1.1.7.1 for MP 1.2.0 Beta

    You are right; "C:\Windows\System32\cmd.exe /C C:\test.bat" does produce an error. Obviously a complex command string is not acceptable. But you can enter "C:\test.bat" which will work fine (just tested).

    Michael
     

    datfreak

    MP Donator
  • Premium Supporter
  • March 19, 2006
    157
    18
    Re: PowerScheduler++ Test Versions - 1.1.7.1 for MP 1.2.0 Beta

    hi, is there a work around for the system being muted after away mode?
    I tried using PS ++ to run nircmd.exe command to unmute after wakeup but it does not work.(but the nircmd command works when I run it not from PS++)

    At the moment I have to exit MP unmute and restart MP.. On a HTPC that does not had a keyboard.

    any other ideas?
     

    Jay_UK

    Test Group
  • Team MediaPortal
  • October 6, 2009
    1,781
    283
    Derby
    Home Country
    United Kingdom United Kingdom
    Re: PowerScheduler++ Test Versions - 1.1.7.1 for MP 1.2.0 Beta

    Hi there,

    Have you tried running nircmd from a bat/cmd file, and then get PS++ to call that?

    J.
     

    Users who are viewing this thread

    Top Bottom