• The forum software that supports hummy.tv has been upgraded to XenForo 2.1!

    This upgrade brings a number of improvements including the ability to bookmark posts to come back to later. Please bear with us as we continue to tweak things and open a new thread for any questions, issues or suggestions in Site/Forum Issues.

Old / redundant EPG data

I've just noticed something odd about the EPG data in my WebIf display: the EPG data goes all the way back to 6th October and many of the old entries have channel number zero, probably because of the channel re-tune that was necessary a few weeks ago. The Webif EPG is very slow to respond, too, presumably because of this. The Humax UI seems to be perfectly normal. Is there a way to to reset the EPG data to fix this? I'm using custom firmware 2.13 on a an HDR.
Thanks for any advice.
 

Black Hole

May contain traces of nut
I believe this has been mentioned before. The EPG data accumulates, but I thought af123 had fixed it so only current data gets extracted.
 

af123

Administrator
Staff member
Yes, the EPG database that the Humax firmware maintains sometimes seems to accumulate old data. That isn't anything to do with the custom firmware.

You can find out what range of data is in your current database by running the epgrange diagnostic:

Code:
Running: epgrange
Wed Nov  7 08:30:00 GMT 2012
Sun Nov 18 23:50:00 GMT 2012
I should probably make the EPG extractor ignore old records but it doesn't currently.

To clear the data, you need to boot the box into maintenance mode (run the diagmode diagnostic then turn off/on using the remote control), then remove the /mnt/hd1/dvbepg/epg.dat file by telnetting in and using the rm command followed by reboot.

Code:
humax# rm /mnt/hd1/dvbepg/epg.dat
humax# reboot
 

Ezra Pound

Well-Known Member
You can find out what range of data is in your current database by running the epgrange diagnostic:
I don't get any data when running, epgrange. I think it must be missing a dependency, from WebIf >> Diagnostics I get :-
Code:
>>> Beginning diagnostic epgrange
Running: epgrange
 
>>> Ending diagnostic epgrange
From Telnet I get :-
Code:
humax# diag epgrange
Running: epgrange
date: invalid option -- 'D'
Try `date --help' for more information.
date: invalid option -- 'D'
Try `date --help' for more information.
humax#
It looks like it doesn't like date -D
 

xyz321

Well-Known Member
The busybox command 'date' supports the -D option but I suspect that the date command from the binutils package does not. The binutils package will take precedence. A more universal way to convert from epoch time would be to use the @ format, even if it is somewhat buried deep in the documentation ;)

Code:
date -d @<epoch-time>
 
OP
B

BlackCat3000

Member
Thanks for the suggestions, everyone. I ran epgrange and got the following, somewhat surprising, output:

Running: epgrange
Fri Mar 30 14:55:00 GMT 2012
Sun Nov 18 23:50:00 GMT 2012

I was under the impression that the oldest EPG data dated from 6th October, not 30th March. :eek:
The box is currently recording so I'll try clearing out the EPG data when the box goes quiet.
 
OP
B

BlackCat3000

Member
This may be at least partly my own fault. :rolleyes: I checked the channel group for the EPG in the WebIf settings and it seems the channel group is an old one that existed before the recent channel shake-up, containing channels that no longer exist. Changing it to a new group, where all the channels do exist, has speeded up things considerably.

Would it make sense for WebIF to delete or ignore anything to do with channel zero?

I'm still going to tidy up that EPG data, though. :)
 

af123

Administrator
Staff member
I updated the diagnostic to use an explicit date binary between your two runs.
 

Ezra Pound

Well-Known Member
Ah, that explains it, is it possible to access the scripts called up when using [Telnet] diag 'script' or Web-If >> Diagnostics >> 'script' >> Run Diagnostic?. I guess they are on the Hummy server somewhere
 
OP
B

BlackCat3000

Member
I finally got round to clearing out the old EPG data:
Running: epgrange
Fri Nov 16 00:00:00 GMT 2012
Fri Nov 23 23:55:00 GMT 2012
The EPG display in WebIf is much faster now. Thanks to everyone for helping me to sort it out.
 

/df

Active Member
Ages ago
Yes, the EPG database that the Humax firmware maintains sometimes seems to accumulate old data. That isn't anything to do with the custom firmware.
...
To clear the data, you need to boot the box into maintenance mode (run the diagmode diagnostic then turn off/on using the remote
It's possible to automate the EPG data clean-up.
  1. Define a flag file, say .clr in the EPG directory.
  2. Create a script to live in /mod/boot/xinit.d that spawns a process to poll for the discovery of the EPG filesystem and delete the EPG file and the flag file if the flag file is found, like this xepg:
    Code:
    #!/bin/sh
    
    log() {
          printf "XEPG: %s\n" "$*"
    }
    
    if [ "$(cat /etc/model)" = "HD" ]; then
            epg=/media/drive1/epgsavedata
    else
            epg=/mnt/hd1/dvbepg/epg.dat
    fi
    
    ( 
      step=2
      epgflg="${epg%/*}"
      while [ ${ii:=200} -gt 0 ]; do
          sleep "$step"
          df "$epgflg" 2>/dev/null >/dev/null && break
          ii=$((ii-step))
      done
    
      epgflg="${epgflg}/.clr"
      log "Checking flag $epgflg"
      if [ -e "$epgflg" ]; then
          log "About to clear EPG file $epg ..."
          rm -f "$epg" && 
                  log "... cleared." &&
                  rm -f "${epgflg}"
      fi
    ) &
  3. Now after creating the flag file and restarting, BANG the old data is gone; there may be an AV glitch shortly after the picture appears as the deletion happens.
There could be a diagnostic epgclear to set the flag so that the whole process can be run from the Webif.

Or is there now already a better solution?
 
Top