Page 1 of 2 12 LastLast
Results 1 to 15 of 22

Thread: Nag Message Remover for Unsubbed Series 1

  1. #1
    Join Date
    Jul 2003
    Posts
    769

    Nag Message Remover for Unsubbed Series 1

    EDIT 12/27/2004

    This one's even better as it is more generalized. It works on my unsubbed SA1/3.0 but YMMV. If it doesn't work it's probably because the MFS path is different on your Tivo. You can browse MFS with TW to find where it needs to change.

    It's not a TW module so you'll have to run from cron or something. Just cut and paste this code and call it delnag.tcl or sumthin:

    Code:
    #!/tvbin/tivosh
    
    proc deletemsg {} {
    global subject msg 
            puts "Found Mail with Subject: $subject"
            puts "Deleting...."
            dbobj $msg set Deleted 1
            event send $TmkEvent::EVT_DATA_CHANGED $TmkDataChanged::MESSAGES 0
    }
    
    
    if { $argv == "" } {
            puts "usage: $argv0 \'some string in subject\'"
            puts "                                        "
            puts " This script will delete pre-tivo messages"
            puts " Many of these are nag messages.        "
            puts " Include in parameters the subject of   "
            puts " the message like this:                 "
            puts " $argv0  Tivo Service Interrupted"
            puts "                                             "
            puts " note that it triggers on a substring so just "
            puts " running this will also work: "
            puts "                                             "
            puts " $argv0: Interrupted                         "
            puts "                                             "
            puts " Just be careful to be specific enough to    "
            puts " not delete stuff you don't want to delete   "
            puts "                                             "
            puts " running this will delete all ptretivo messages:       "
            puts "                                             "
            puts "   $argv0 DELETE-ALL                         "
            puts "                                             "
            puts " it's a good way to eliminate nag messages   "
    }
    
    set db [ dbopen ]
    
    ForeachMfsFile fsid name type  "/MessageItem/PreTivoCentral"  ""  {
       RetryTransaction {
            set msg [db $db openid $fsid]
            set subject [dbobj $msg get Subject]
            set deleted [dbobj $msg get Deleted]
            if { $deleted != 1 } {
                    if { [ string first "$argv" "$subject" ] != -1 } {
                            deletemsg
                    } elseif { $argv == "DELETE-ALL" } {
                            deletemsg
                    }
    
            }
       }
    }

    Old information below this line -----------------


    EDIT2: I have included the script called 'nagkiller' that is a tivoweb module. I have been using this one now for weeks with no noticable side effects. The delnag script is the one referred to in the text below and is buggy. I will leave it in case anyone wants to fix it. It does not rely on tivoweb.
    ------------------------
    EDIT: There's a memory leak when running this script frequently. If you have Tivoweb then try the module shown further down the thread. if not, maybe running this script in the background with an endless loop might improve things.
    -------------------------------------------------------

    Here's a little script to remove those annoying "Daily Call Required" PreTivoCentral mail messages you get twice-daily when using an unsubbed Tivo.

    Disclaimer: I have not tested the script extensively. It seems to work on my SA1/3.0 but YMMV. As always, use this at your own risk. You must accept all the consequences of using this software or not use it at all. This is very raw alpha code. You may also want to wait for more experienced developer feedback to make sure the script does not cause more subtle damage before using it.


    The best way to use it would be to issue a cron job that runs it every so often. I didn't try doing an priority stuff so you may want to run from a setpri environment that will not cause a pause in the video. I run it from a cron job that runs every 30 minutes and do not notice any video stuttering when it is run.

    Post your feedback here in order to help others and possibly improve the script.

    Props to Jeff Keegan and the Tivoweb(and plus) project developers. By reading the tivoweb mail module, I was able to write this in 20 minutes.

    EDIT: This script does nothing to 'fake out' the unsubbed Tivo into 'thinking' it has already had a successful dial-in. For that, you need to find fixup30.tcl. This just takes out the tivo message that pops up twice a day whenever you press the Tivo key. This message always has the subject "Daily Call Required". This script will only delete messages that are: not already deleted, have the subject "Daily Call Required" and are set to display when you press the Tivo key.
    Attached Files Attached Files
    Last edited by cojonesdetoro; 12-28-2004 at 07:14 PM. Reason: Added new TivoWeb module to do this.
    perl -e 'print unpack("u","\@2\&\%V92\!Y;W4\@:&\%C:V5D(\%E/55\(\@5\&EV\;R\!T;V1A>3\\-\`"),"\n";'

  2. #2
    Join Date
    Jul 2003
    Posts
    769
    I have since found that running this script too frequently results in the "No EventSwitcher active" bug. Searches show it to be mostly a 3.1 problem but this is not the first time I've seen it in 3.0. It used to happen with a hack I was working on that leaked file handles.

    I can't seem to find much information about this except that the only fix is a reboot once the bug is encountered. I'm going to try running wiht less frequency and see what happens. I was running it at 10 minute intervals since I didn't think there was any harm in that. I have switch to hourly so let's see what happens.

    Does anyone know more about the nature of this bug and possible techniques to avoid it?

    Perhaps the database open handles are never being cleared when the script exits. It's probably some sort of memory leak. Perhaps the only fix is to have the script run in an endless loop? That's messy and hogs resources.
    perl -e 'print unpack("u","\@2\&\%V92\!Y;W4\@:&\%C:V5D(\%E/55\(\@5\&EV\;R\!T;V1A>3\\-\`"),"\n";'

  3. #3
    Join Date
    Mar 2002
    Posts
    1,339

    infinite looping

    rename it whatever.itcl & throw it in /tivoweb-tcl/modules. the script will get sourced at tivoweb startup & can ping/pong/invoke itself periodically w/o requiring any new db handles or extra processes...
    ---
    Give a man a fish and he will eat for a day. Teach a man to fish and he will sit in a boat all day and drink beer

  4. #4
    Join Date
    Jul 2003
    Posts
    769
    Quote Originally Posted by rc3105
    ping/pong/invoke itself periodically w/o requiring any new db handles or extra processes...
    Sounds like a good idea. I'll give that a shot and see how it goes. I gotta figure out the best way to have a tivo module stay running in an endless loop. A module has to return control to Tivoweb. How do you fork off a process in tivosh? Is there a facility in Tivoweb for having a proc called at repeated intervals?

    I was also thinking of just emulating a browser and going to tivoweb through a socket at port 80.
    perl -e 'print unpack("u","\@2\&\%V92\!Y;W4\@:&\%C:V5D(\%E/55\(\@5\&EV\;R\!T;V1A>3\\-\`"),"\n";'

  5. #5
    Join Date
    Mar 2002
    Posts
    1,339
    doesn't have to be a full blown module or worry about returning control, something as simple as

    Code:
    #ping-pong.itcl
    
    proc ping_pong { } {
     puts stdout "ping_pong"
     #insert nag killer code here
     after 30000 ping_pong
    }
    
    ping_pong
    will add the procedure ping_pong to tivoweb & invoke it initially. then it schedules itself to run again in 30 seconds. vwait & event handlers will progress normally. if ping_pong's scheduled but another procedure hasn't returned control it'll execute when control returns to the vwait loop. as long as ping_pong-nag_killer doesn't take forever to execute & return control it won't impact tw performance measurably
    ---
    Give a man a fish and he will eat for a day. Teach a man to fish and he will sit in a boat all day and drink beer

  6. #6
    Join Date
    Jul 2003
    Posts
    769
    Nice technique. I'll post it here after I got it working.
    perl -e 'print unpack("u","\@2\&\%V92\!Y;W4\@:&\%C:V5D(\%E/55\(\@5\&EV\;R\!T;V1A>3\\-\`"),"\n";'

  7. #7
    Join Date
    Jul 2003
    Posts
    769
    Ah, much better. Thanks for the tip. I did not know the 'after' command allowed that... very handy. It seems to work well so far.

    Instructions:

    create a file called 'whatever.itcl' (name doesn't matter) in the tivoweb modules directory and put this text in there.

    Do a chmod 755 whatever.itcl

    restart Tivoweb

    Create a Tivo message in the 'PreTivoCentral' section with the subject "Daily Call Required" and see if it disappears.


    EDIT: You may want to take out the 'puts' commands that print information or else it will fill up the tivoweb logs. You also may want to increase the 30 second interval if you see any performance related anamolies. Works fine here but YMMV.

    Code:
    #!/tvbin/tivosh
    proc nagkiller {} {
            global db
            puts "nagkiller running at [ exec /bin/date ] "
            # Main code that deletes PTC nag messages for unsubbed Tivo
            
            # comment this out replaced with global statement above
            #set db [ dbopen ]
            ForeachMfsFileTrans fsid name type  "/MessageItem/PreTivoCentral"  "" 20 {
                    set msg [db $db openid $fsid]
                    set subject [dbobj $msg get Subject]
                    set deleted [dbobj $msg get Deleted]
                    if { $deleted != 1 && "$subject" == "{Daily Call Required}" } {
                            puts "Found PreTivoCentral Mail with subject: $subject"
                            puts "Deleting...."
                            dbobj $msg set Deleted 1
                            event send $TmkEvent::EVT_DATA_CHANGED $TmkDataChanged::MESSAGES 0
                    }
            }
            after 30000 nagkiller
    }
    nagkiller

    Note: This module will not show up in the tivoweb main menu.
    Last edited by cojonesdetoro; 04-25-2004 at 12:29 PM.
    perl -e 'print unpack("u","\@2\&\%V92\!Y;W4\@:&\%C:V5D(\%E/55\(\@5\&EV\;R\!T;V1A>3\\-\`"),"\n";'

  8. #8
    Join Date
    Jul 2003
    Posts
    769
    <slap to the forehead>

    The dbopen should not be needed now...

    Editted original script above
    Last edited by cojonesdetoro; 04-25-2004 at 12:32 PM.
    perl -e 'print unpack("u","\@2\&\%V92\!Y;W4\@:&\%C:V5D(\%E/55\(\@5\&EV\;R\!T;V1A>3\\-\`"),"\n";'

  9. #9
    Join Date
    Mar 2002
    Posts
    1,339
    I've often wondered why there wasn't a cron module included with the main tivoweb distribution. scripts can launch binaries yanno...
    ---
    Give a man a fish and he will eat for a day. Teach a man to fish and he will sit in a boat all day and drink beer

  10. #10
    Join Date
    Jul 2003
    Posts
    769
    Quote Originally Posted by rc3105
    scripts can launch binaries yanno...
    Sho'nuff, I wrote a dirt-simple module to do CGI-like script execution. I thought aboout cron as well. The only thing is that while cron is working, tivoweb can't respond. There's also already a nice cron binary that does the job and takes few resourses (S1 version, anyway). Althoughm it would nice to edit the crontab AND run the module from tivoweb.

    I think the bigger priority is to make TCL scripts run this way so as to avoid multiple tivosh instances and resources (defined procs and handles). I'm thinking of porting a pop mail client called tpop to run this way. It retrieves pop mail to tivo messages.

    I also PMed Sanderton about this. He has this dailymail hack where he rewrote all these functions so that hack 'thought' it was running under tivoweb. It would have been easier to run it this with a parameter the mail schedule. He also has that great 'endpad' hack that lends itself well to this method.

    I posted a message in the tivoweb development thread as well. I suggested the development of a 'silent resident module' standard. Silent because it doesn't necessarily show up on the main menu and resident because it
    executes periodically.

    BTW, is it just my browser or are buttons missing on this site?
    perl -e 'print unpack("u","\@2\&\%V92\!Y;W4\@:&\%C:V5D(\%E/55\(\@5\&EV\;R\!T;V1A>3\\-\`"),"\n";'

  11. #11
    Join Date
    Jul 2003
    Posts
    769
    I found a problem with this technique. If you either a full or quick restart of tivoweb the proc gets called again. It creates an additional event that calls the proc. I have to figure out a way to determine if the current iteration is a restart or a 'fresh' start of tivoweb.
    perl -e 'print unpack("u","\@2\&\%V92\!Y;W4\@:&\%C:V5D(\%E/55\(\@5\&EV\;R\!T;V1A>3\\-\`"),"\n";'

  12. #12
    Join Date
    Mar 2002
    Posts
    1,339
    Code:
    #ping-pong.itcl
    
    proc ping_pong { } {
     puts stdout "ping_pong"
     #insert nag killer code here
     after 30000 ping_pong
    }
    
     if { [info exist boot_refresh] } {
         set boot_refresh "refresh"
     } else {
         set boot_refresh "boot"
     }
    
    ping_pong
    or you could declare a global that's incremented every time whatever.itcl is loaded, or you could check the list of registered events to see if ping_pong is allready scheduled, or <insert favorite scheduling algorithm here>...
    ---
    Give a man a fish and he will eat for a day. Teach a man to fish and he will sit in a boat all day and drink beer

  13. #13
    Join Date
    Jul 2003
    Posts
    769
    The boot_refresh var is exactly what I was seeking. How do you check the list of registered events?

    EDIT:
    removed stupid statement

    EDIT2: Okay this change works in the main proc. if anyone is actually using this, replace the main code outside the proc with this:

    if { [info exist boot_refresh] } {
    set boot_refresh "refresh"
    puts "Tivo reboot not adding event for nagkiller."
    } else {
    set boot_refresh "boot"
    puts "Tivo boot. starting nagkiller."
    nagkiller
    }


    I didn't think a variable set in a module was automatically global. I guess I just should have tried it.
    Last edited by cojonesdetoro; 04-30-2004 at 09:56 PM.
    perl -e 'print unpack("u","\@2\&\%V92\!Y;W4\@:&\%C:V5D(\%E/55\(\@5\&EV\;R\!T;V1A>3\\-\`"),"\n";'

  14. #14
    Join Date
    Jun 2001
    Posts
    707
    Will this work on a DTIVO S2? Probably not, but I am currently running a 2nd TIVO just as a player (I mfs_ftp programs to it), and I allways get the DVR SERVICE NEED TO BE ACTIVATED message...

    Just asking...

  15. #15
    Join Date
    Jul 2003
    Posts
    769
    Do you have tivoweb on there? Is the message a tivo mail message? Does it show up in the "Pre Tivo" section of the mail messages in tivoweb.
    perl -e 'print unpack("u","\@2\&\%V92\!Y;W4\@:&\%C:V5D(\%E/55\(\@5\&EV\;R\!T;V1A>3\\-\`"),"\n";'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •