PDA

View Full Version : Scheduler For EPG Collector & NPVR EPG Update



rwnz
2012-07-16, 07:58 AM
NPVR has been running sweetly for a couple of years or so, where I used Task Scheduler to wake my computer from Sleep, run a batch file to run EPG Collector and then NPVR EPG updater, then put my computer back to sleep. I've just reformatted my hard drive and reinstalled NPVR and EPG Collector but cannot get the scheduled update to work. If I run the batch file directly it all works properly but if I use Task Scheduler to trigger it then the process stops with an error while EPG Collector is accessing its ini file.

I had the same problem when I originally installed this a couple of years ago. I thought I had determined that the cause was that Task Scheduler is very picky about having file paths written in full and all files in the chain being given full permissions. I also improved it by ticking 'Run with highest privileges'. I spent many hours trying to get it working originally and don't have the time to do so this time.

What other ways do users achieve this EPG update bearing in mind that I want to wake and sleep the computer and I must use a 3rd party utility to get the EPG data?

Cheers.

martint123
2012-07-16, 10:19 AM
If you post your batch file someone may be able to spot what is going wrong, full text of the error message may help as well. ISTR that by default the scheduler runs not as a normal user, so default paths etc do not exist.
I'm running an external grabber from the scheduler and haven't had a problem as yet.

Jaggy
2012-07-16, 11:08 AM
Err ummm am I missing something here?? I just use the built in NextPVR update event & using an updateEPG.bat file located in the script directory it runs EPG Collector fine.

rwnz
2012-07-16, 12:11 PM
It'll be me missing something. That's why I asked. I felt there must be something simpler. I'll look into this further when I get back on at the end of the week. I see the script directory but need to find out more about the NextPVR update event.
Also noted about Task Scheduler not running as a normal user.
Thanks.

Jaggy
2012-07-17, 03:55 AM
The update event is fairly straight forward, it looks for UpdateEPG.bat in the scripts directory & if it finds it runs it & waits for it to end, once that happens it then does the normal internal update & when that finishes it look for PostUpdateEPG,bat in scripts & then runs that (I use this to backup my Db, config & the xxxx-backup.xml files onto my main recording drive, just in case C:\ ever dies on me)

rwnz
2012-07-20, 11:25 AM
I though batch files are meant to make things simple! I've put it into Scripts but when I run EPG Collector.exe from the bat file then EPG Collector.ini doesn't load but when I run EPG Collector.exe directly it does.

martint123
2012-07-20, 11:50 AM
That is just the same as your previous problem with the scheduler isn't it? It will also probably be running as something other than you as a user.
File ownerships? paths? Post your batch file and someone may spot the oddity.

Jaggy
2012-07-20, 09:30 PM
So it runs EPG Collector & in the EPG Collector log is says it can't find the ini??

You can also run it pointing to an ini files like I do after it collects my DVB-S data for my second collection, DVB-T data this time...

the normal collection



REM Make sure it is back at the root of C drive
c:
cd\

REM I have EPG Collector installed in a Progs directory
cd C:\Progs\EPG Collector\Program

REM run EPG Collector
EPGCollector.exe


the second collection pointing at a different ini file



REM Run EPG Collector using a different ini file
EPGCollector.exe /ini="C:\Documents and Settings\All Users\Application Data\Geekzone\EPG Collector\EPG-Collector(DVB-T).ini"


OK so this is for XP & on Win7 the ini will be in User\something but I did find I had to put the whole path into the line including drive letter for it to work.

rwnz
2012-07-21, 05:52 AM
Thanks. I've got the batch file working now. It appears to have been because I was using
C:\ProgramData\EPGCollectorV020014\EPGCollector.ex e
whereas I needed to use:
CD C:\ProgramData\EPGCollectorV020014\
EPGCollector.exe

However, I can't get NPVR to run it (nor will it wake my computer from sleep). I've checked in the wiki and seem to be doing it as per instructions. My batch file is:

Rem This batch file is triggered by NPVR at the time programmed into Settings-Misc2-EPG Update Hour and downloads the EPG data from Freeview DVB-T into Freeview MHEG.xml (in C:\ProgramData\EPGCollectorV020014). Completion of this triggers NPVR to update its EPG from the Freeview MHEG.xml file.

CD C:\ProgramData\EPGCollectorV020014\

EPGCollector.exe

My batch file is in the correct location and is named correctly:
33905

The configuration of NPVR is:
33906

I take it that 'EPG Update Hour' = 17 is 5pm.

Jaggy
2012-07-21, 11:01 AM
However, I can't get NPVR to run it (nor will it wake my computer from sleep).

We would need NextPVR logs to check what is going on in that case.... the NRecord.log is the one I think after it should have woken the PC to update the EPG


I take it that 'EPG Update Hour' = 17 is 5pm.

Sounds right to me.

rwnz
2012-07-22, 02:18 AM
We would need NextPVR logs to check what is going on in that case.... the NRecord.log is the one I think after it should have woken the PC to update the EPG.

I note that NPVR wakes OK to record programs. NRecord.log reflects this too.

With regard to running the EPG, there is no entry in any log (that is in Users\Public\NPVR\Logs folder) which shows any activity at the time I've entered into Update EPG Hour.

Jaggy
2012-07-22, 02:32 AM
Well start a thread in NextPVR support then with your logs for when it should have run the EPG update for sub to have a look at.... I know it should log something as I have seen it in the logs before but I can't remember which log it was in.

rwnz
2012-07-22, 02:46 AM
Thanks Jaggy. I've just noticed that when a recording starts, the NRecord.log does acknowledge the EPG Update Hour

[...startup]
2012-07-21 14:35:06.039 [DEBUG][4] OnStart()
2012-07-21 14:35:06.195 [DEBUG][5] MVPManager thread started
2012-07-21 14:35:06.195 [DEBUG][5] MVP Server: C:\Program Files\NPVR\NextPVR.exe
2012-07-21 14:35:06.772 [INFO][4] Using local in-process recording service
2012-07-21 14:35:17.001 [DEBUG][4] RecordingServiceProxy@exit
2012-07-21 14:35:17.016 [INFO][4] RecordingService.Startup()
2012-07-21 14:35:17.016 [INFO][4] Starting remoting service
2012-07-21 14:35:17.063 [DEBUG][8] Requesting wake up for 'EPGWAKEUP' at 22/07/2012 2:00 p.m.
2012-07-21 14:35:17.063 [DEBUG][8] About to update EPG
2012-07-21 14:35:17.141 [INFO][4] Starting web server on: 8866
2012-07-21 14:35:17.141 [INFO][4] Setting working directory to: C:\Program Files\NPVR\
2012-07-21 14:35:17.141 [INFO][4] Web root: C:\Users\Public\NPVR\web
2012-07-21 14:35:17.188 [DEBUG][8] Updating EPG...
2012-07-21 14:35:17.328 [DEBUG][8] About to run C:\Users\Public\NPVR\Scripts\UpdateEPG.bat
2012-07-21 14:35:17.484 [INFO][7] RecordingService starting...
2012-07-21 14:35:17.484 [DEBUG][7] Loading recording schedule
but I don't understand what this is about as it is not at the time set for EPG Update Hour, the script does not appear to run (which it shouldn't do at the time of this recording), and it happens at the start of any recording.

Jaggy
2012-07-22, 04:03 AM
I see you have posted the not waking etc. problem in the support forum....good

I just tried running a similar command to what you have in your UpdateEPG batch & the "CD" command (like yours) caused a DOS error, so try the modified batch below & see if that fixes the other problem (I'm from the old school & like to do things "one step at a time" & over all it just seems to have saved heaps of time over the years)



Rem This batch file is triggered by NPVR at the time programmed into Settings-Misc2-EPG Update Hour and downloads the EPG data from Freeview DVB-T into Freeview MHEG.xml (in C:\ProgramData\EPGCollectorV020014). Completion of this triggers NPVR to update its EPG from the Freeview MHEG.xml file.

C:
CD\
CD ProgramData\EPGCollectorV020014
EPGCollector.exe
CD\

rwnz
2012-07-22, 05:50 AM
Thank you Jaggy. On its own the batch file works OK with it written the way I have it. If I open it then it will run EPG Collector and download the EPG data to the XML file in the EPG Collector folder. Then when I run Settings - Channels - Update EPG the schedule gets updated. I initially had it written the way you have suggested but I found it didn't affect the way the batch file performed. However I suppose that it could report an error back to NPVR so I'll alter it to what you suggest and see if it affects the EPG Update Hour operation.

rwnz
2012-07-22, 06:29 AM
6pm has just passed so before it did I set the EPG Update Hour to 18, emptied the EPG, deleted the xml file and left the computer running. No update occurred.

Jaggy
2012-07-22, 10:15 PM
Well that would have been a good time to post your logs in that other thread....... sub is unlikely to reply to your questions without you supplying complete logs of it "not doing" it's stuff.

MaleXLR
2014-05-14, 01:02 AM
Did you ever get to the bottom of this? Last week my update was happening automatically, but this week it isn't. I did add one extra line to my batch file to clear temporary *.ts live tv files.

Summarising:
If I manually run UpdateEPG.bat it works and I get an updated TVGuide.xml;
Then, if I go to settings and click "Update EPG", my EPG is updated and everyone is happy!

However, as was your experience, if I rely on the NextPVR automatic schedule, nothing is updated and the TVGuide.xml remains unchanged.

I just experimented by removing my "del" line and NextPVR still didn't update.

Graham
2014-05-14, 05:39 PM
However, as was your experience, if I rely on the NextPVR automatic schedule, nothing is updated and the TVGuide.xml remains unchanged.


The automatic scheduled update EPG runs in the user context of the NextPVR recording service. The batch file may be running in the wrong folder or with the wrong user id.

MaleXLR
2014-05-15, 12:05 AM
Thanks Graham. I hopped onto the end of a different thread and Sub has requested some logs.

The strange thing is that the automatic update unexpectedly sprang into action yesterday at a scheduled time of 6:30:00 pm, but then I changed it to 6:30:00 am and nothing happened this morning. The batch file is in the Scripts folder of "Documents and Settings" (good old Windows XP) and I assume that if the folder and/or user ID was wrong then the 6:30:00 pm update would have failed!?!