PDA

View Full Version : last successful call / mfs entries



mrblack51
07-15-2001, 12:24 AM
how is everyone figuring out what entries there are in the mfs database? i have changed the NoMoreNagz script to incorporate the changeDialtime script (no big deal really), but i would like to set the 'Last Successful Call' value in the database. I can change the 'Last Call Attempt' and can set the 'Last Call Status', but I would like to tell it that the Last successful call was now as well. here is the changed script that i am working with.

#!/tvbin/tivosh
##############
# NoMoreNagZ #
##############
#
# 07-14-01 Last Call Attempt now set
# Next Call Attempt now set
source /tvlib/tcl/tv/Inc.itcl
source /tvlib/tcl/tv/mfslib.tcl
source /tvlib/tcl/tv/setup.tcl
source /tvlib/tcl/tv/StatusStrings.itcl

set serviceState 5
set now [clock seconds]
set stateExpiration [expr ($now / 86400) + 365]
set nextCall [expr ($now) + 364*24*60*60]

set db [dbopen]
transaction { set setup [db $db open /Setup]
dbobj $setup set ServiceState $serviceState
dbobj $setup set ServiceStateExpiration $stateExpiration
dbobj $setup set LastCallStatus $StatusStrings::Succeeded
dbobj $setup set LastCallAttempt $now
dbobj $setup set NextCallAttempt $nextCall
}
dbclose $db

mrblack51
07-15-2001, 12:30 AM
well, here I go answering my own question. if anyone wants to know, i used 'dumpobj /Setup' to see all the entries. here is the updated script:

#!/tvbin/tivosh
##############
# NoMoreNagZ #
##############
#
# 07-14-01 Last Call Attempt now set
# Next Call Attempt now set
# Last Successful Call now set
source /tvlib/tcl/tv/Inc.itcl
source /tvlib/tcl/tv/mfslib.tcl
source /tvlib/tcl/tv/setup.tcl
source /tvlib/tcl/tv/StatusStrings.itcl

set serviceState 5
set now [clock seconds]
set stateExpiration [expr ($now / 86400) + 365]
set nextCall [expr ($now) + 364*24*60*60]

set db [dbopen]
transaction { set setup [db $db open /Setup]
dbobj $setup set ServiceState $serviceState
dbobj $setup set ServiceStateExpiration $stateExpiration
dbobj $setup set LastCallStatus $StatusStrings::Succeeded
dbobj $setup set LastCallAttempt $now
dbobj $setup set LastSuccessCall $now
dbobj $setup set NextCallAttempt $nextCall
}
dbclose $db

chipster
07-19-2001, 01:02 AM
Thanks for NoNoreNagz. Ran the script through tivosh, and my system info screen indicates all the changes, with next call set for next year. But the machine still attempts a call each evening anyway - indicating failure, and a next call a few hours later. I can run the script again, get the info screen to look nice, but the call will still try again.

I examined the log (tvlog) - and there appears to be a variable "secSinceLast" which keeps incrementing despite the setting lastSuccess to now. My secSinceLast reports over 600000 in the log, and keeps going higher despite nomorenagz.

Tcphonehome is still invoked daily.

What if.... I replace the tcphonehome binary with something like "ls" - renamed to tcphonehome - so when invoked, nothing of consequence should happen. Think this will send the machine to the nuthouse?? There's also the tcwatchdog binary which looks interesting as well.

Note: Using chattr to preserve all changes between boots.

Oh... and how do I invoke 'dumpobj /Setup' to see the settings? Does this list all available variables and values? From the bash prompt? Or a new script run via tivosh? A Linux newbie here, but learning fast.

Thanks

mrblack51
07-19-2001, 01:15 AM
dumpobj works in tivosh, so you would do:

bash 2.02# tivosh
%dumpobj /Setup

i noticed the same problem with the call being attempted every night. im not sure if there is a cron type setup with the tivo, so we could schedule the nomorenagz script to be run once a night. you could try renaming tcphonehome to something else and copying the nomorenagz script into its place.

i will take a look for that secSinceLast, but thats darn good detective work. dumpobj will dump whatever is in the database you specify. 'dumpobj /Setup' will show you basically the same info that is on the system info screen.

chipster
07-19-2001, 01:42 AM
Got the dumpobj list - thanks. Was hoping to see the secSinceLast varible listed - not...

I also got some occasional reboots while experimenting the last few days. First thought was heat related - but still did it with the cover off. Log doesn't show a reboot issued, but I kinda suspect Tivo is up to something - that's why I'm wondering about tcwatchdog.

As for secSinceLast, yesterday I had tried just setting it to 300 within the script - no affect - and I didn't expect one. I cannot get the true varible name to load into the db (SecSinceLast? - note cap) - or does tcphonehome calculate this from some unknown variable/clock. I'll be scrolling through the tcphonehome binary for clues - this bin definitely puts secSinceLast in the log, and I have found the string within the binary.

Too many hobbies... didn't want another.... esp with a crash course in Linux required.

chipster
07-19-2001, 01:52 AM
mrblack51...

By the way... I had noticed tonight that after the failed call (608PM) attempt, it was going to try again a few hours later. By rerunning the script, that next call did not occur - but it will surely will try tomorrow night again.

Yesterday I had tried the line:

tivosh /mypath/nonagz.itcl

within Setup.itcl.

This did not appear to work. Need to find a boot-time script to insert the command, and perhaps a do/while and wait loop.

mrblack51
07-19-2001, 10:23 AM
i havent been running nonagz with tivosh. you should be able to do a /mypath/nonagz.itcl or whatever

InTek
07-19-2001, 11:51 PM
Wow, you guys are close...

I had no idea that anyone had publicly gone this far with a service hack...

chipster, the startup script you are looking for is rc.sysint. It is in /etc/rc.d on the active partition. You could call "nomorenagz.itcl" at the end of it, just like with the bash prompt. While you are in there, add a line at the end like this:

rm -f /var/log/*

which will clean out your logs every time you boot. Also, find the lines:

rm -f /var/run/syslogd.pid /var/run/klogd.pid
syslogd -p /var/dev/log -m 10000
klogd

and comment them out by putting a "#" and a space in front of them. This will stop the logging deamons from running in the first place (which saves a few CPU cycles and will also help speed up the system a bit).

Remember to chattr +i this file when you are done...

BTW, You are on the right track with the "secSinceLast" thing; also look for ReschedCall and numFails... You will get there...

Mr. Black, great work on the nomorenags script, but *please* be carefull. TiVo has about 250,000 subs right now and if they do not get a bunch more soon, there will be no more Tivo. Please remember that.

chipster
07-20-2001, 12:08 AM
Thanks for the hints InTek... the log hack was next on my list - thanks for that too.

As for Tivo, they're getting my money as well. The fun is in the hunt - not the kill.

And you may be right about keeping this at a lower profile...

trainboy
07-22-2001, 10:35 AM
Running this script from the end of /etc/rc.d/rc.sysinit seemed like a good idea at the time but it appears to collide with something else over the use of the setup lock (it may be tcphonehome.tcl which is running at the time). I'll have to do a little digging around in the near future to see how this can be fixed but in the meantime, don't expect this to work from rc.sysinit.

chipster
07-26-2001, 12:08 PM
trainboy,

I've had occasional success running nomorenagz from rc.sysinit. Since my last post, I've put a while / sleep function in a script to repeat nomorenagz every few hours. But I can't get this to work from rc.sysinit.

this is my script (from memory):

#!/bin/bash
# Reset.itcl

while (true)
do
{
/etc/rc.d/nonagz.itcl
/bin/sleep 7200
}
done

I can invoke this from the bash prompt as follows:

/etc/rc.d/Reset.itcl& # & appended for Run in background process

I can do ps from the tivosh prompt and see the sleep function, and the unit updates every two hours.

I can't seem to get this to work from rc.sysinit??? Probably just too lame with Linux. I don't see "sleep" listed when I invoke PS from the tivosh prompt.

What would the command syntax be from rc.sysinit? Does it need to be assigned to a particular console (tty) - as we do to get the bash prompt in the first place??? If so, how?? Tried with and without the trailing "&". Is this a place to use the "exec" command??? How???

And it still tries to call anyway - I'm still trying out things with secSinceLast, numFails to no avail. Also found a file, /var/persist/CallID which I looks like it contains the time of the last success call. Changed to current time, but secSinceLast still counts up / not reset. Had a reboot yesterday while I was away, and I think this has something to do with numFails or the ReschedCall/Reason - wherever that gets set...

AArgh.... need a SLEEP command for myself...

SuperVHS
07-26-2001, 10:09 PM
You can create a .bashrc file that will run when you boot up. That might be a better place for your nonagz routine. Since the root is read only, I have it execute a script in my VAR partition and I can modify it any time I want to add something new without having to remount the root ar read write.

mrblack51
07-27-2001, 02:42 AM
did you take a look at the LAST-MONTHLY-BACKHAUL file in the /var/persist directory? it also appears to have a date/time in it.

of course, i didn't really like finding the tivoLog.longterm in the /var/persist directory either. wow, they track you in a number of places.

i just replaced the times in both with the date/time i used to set my lastCallSuccess. i will let you know if it still works ok. the latest autogenerated message indicated that since it had been 28 days since my last call, i had 3 left.

chipster
07-27-2001, 09:55 AM
Hadn't played with last-monthly-backhaul yet, but was on the list.

Have changed my mind about my reboots. Caught the unit yesterday stuck on "Powering Up". My PC bios wouldn't recognize the drive when I attached it. Placed it in the fridge for an hour, and the PC sees it. Looks like the drive is on its deathbed. Got another lct20 locally - backup finished this AM successfully. I had never seen any indication of Tivo-invoked reboot in the logs.

During the backup last night, I put in a drive from a different open box DTivo (real cheap from BB - missing everything but box, told them was purchasing for parts - no access card included, but with $100 rebate!). This had older, used 2.0 software on it. Added bash command and my reset/nonagz routines to the drive before mounting it.

The previous owner had a lifetime on the box - didn't notice any hacks, and it had last called home in March. I quickly got the nag screen and all Tivo functions were disabled (over 30 days). I ran my reset routine (from bash prompt), and all appears well. Have set the sleep time to 1800 (every half-hour). Looking at logs, it still tried to call last night, but all functions still work. numFails is up to 6 - got to figure this one out. Oh.. added:

set secSinceLast 0

to nonagz. Log says secSinceLast is 0 - but I don't believe it, maybe just in generating the log entry. Saw this before. If i let a call fail before running nonagz, secSinceLast shows a big number always incrementing. On the bright side, the stored secSinceLast for this drive goes back to March - so the value is stored on the drive somewhere - not in hardware.

Now to consult the manual on bashrc. What directory does this go in? How often does it invoke? Special syntax dor this file?? I don't want multiple instances of my reset routine running if bashrc is invoked each time bash is run. Pitiful trying to learn Linux on the fly - and ignorant of these basic concepts.

SuperVHS
07-27-2001, 10:54 AM
If you are getting the bash prompt on the serial port, that is always there and run only one time (as is .bashrc which should be placed in the root "/"). So no worries about mutiple programs running.
I can't comment on TiVoNet, as I do not have it or expect to get it.
My .bashrc is very simple:

#bashstuff / .bashrc 5/14/01
export PATH=/var/new/devbin:$PATH
. /var/new/script/alias.tcl

alias.tcl is a script that creates a bunch of alias's (dir="ls -al")
but could also run other scripts. I did this so I would not have to repeatedly modify the root which is mounted r/o.

Some people set the serial port speed
stty=57600

chipster
07-27-2001, 12:27 PM
Thanks for the quick lesson SuperVHS...

Will play with it this weekend.

chipster
07-29-2001, 12:59 AM
SuperVHS,

Added .bashrc to root directory - very basic:

# .bashrc
/etc/rc.d/reset.itcl


DTivo does continuous reboots - never gets past "Powering Up" - then reboots a minute or two later. Removed .bashrc and DTivo boots fine.

Must not like this script in bashrc ...

Of course, bash is invoked to run rc.sysinit -

So bashrc is run just before rc.sysinit.

My reset.itcl loops nonagz, which invokes tivosh.

I'm guessing that rc.sysinit has to do some work *before* tivosh can run happily (or before the db functions are happy). So I'm probably trying to put my cart ahead of my horse by attemptin nonagz in bashrc.

Back to playing, but not a high priority right now...

SuperVHS
07-30-2001, 01:18 PM
Chipster

Interesting. If you want to try a minor change, try adding a sleep command as the first command of the .bashrc file: "sleep 3m" will have it pause for 3 minutes and that should allow the rest of the tivo to get set up (or it will cause your reboot to wait 3 minutes - grin).

Also, you are running nonagz in the background when you run it from the command prompt. I would think you also have to do the same in your reset script. Eh?

chipster
07-30-2001, 07:20 PM
Doh! ... place a sleep to allow rc.sysinit to complete... why didn't I think of that....

And yes... I have been placing a trailing "&" on the script to run in background.

Will report after some play.....

chipster
07-31-2001, 01:58 AM
Now that I think about it - I probably forgot the "&" before.

Anyway, the loop runs - but no updates from .bashrc.

But got it working, and thanks for pointing me to the right section of the manual - so to speak...

It wants the *interactive* login initialization..... hint.

SuperVHS
07-31-2001, 09:30 AM
One other thing. Notice in my .bashrc file the alias.tcl call starts with a dot space (". "). This tells the system that any changes made are to be kept and made available to the system. If the alias.tcl file changed the path but was simply executed, the path will only be changed within the shell of the alias.tcl program and the change will not be seen by any other commands / processes.

So you might want to try ". /etc/rc.d/reset.itcl" in your .bashrc file

I'm not a big Linux user and I have to keep looking up this stuff. Sorry if it is in bits and pieces.

chipster
07-31-2001, 03:10 PM
I'm also looking things up as needed. Crash Linux course...

As I mentioned, I've got it working now - but .bashrc wasn't the file that tivosh likes. ..... /.bash_login is the one. This may also be affected by where, within rc.sysinit, I call for the bash prompt on TTY3. I do it at the end, and everything's A-OK. At least until it gets my real last call time...

mrblack51
08-01-2001, 04:24 PM
well, nomorenagz didnt do everything i was hoping, but its getting there.

my dtivo hit 30 days without a call, and disabled the record button. my season passes were still recording last i checked, but i havent check on whether i can create a new one.

the one thing i thought of regarding all this is that without a daily call, a few things happen:

secSinceLast doesnt get reset
numFails doenst get reset
ReschedCall doesnt get reset
Tivoloution magazine doesnt download
network showcases dont download (i think)
guide data doesnt download (on sa boxes)
system updates dont download

now, i highly doubt that the system updates are tied to any of those messages automatically generated by the system. the first three entries i mentioned would be plausable causes, but one thing noone has mentioned is the tivoloution magazine. would the tivo generate those expiration messages when the magazine expires?

number6
08-01-2001, 07:49 PM
Originally posted by mrblack51
my dtivo hit 30 days without a call, and disabled the record button. my season passes were still recording last i checked, but i havent check on whether i can create a new one.


My SA Tivo (which is outside the US and has never done a GS except via me loading a headend slice I have used previously). It also has the above problem - it had this problem since the 1st or second day after I put 2.0.1 on it [its now over 2 weeks since I put up 2.0.1 on my Tivo].

I can setup manual recordings and season passes and they record and are recording fine without guide data.
I cannot get into any of the Wish List, Pick programs by time or name etc. I would love to get rid of the service interrupted status if I knew where it was stored.

I have loaded a fake slice that contains 1 future program in January 2011. The System menu shows that the Tivo has guide data to Jan 26 2011, - it still knows that no recent guide data has been downloaded even when I tried loading a recent made up slice of program guide data.

The system menu shows Boat Anchor mode is true and Backdoors are enabled.



... mentioned is the tivoloution magazine. would the tivo generate those expiration messages when the magazine expires?


Before I had 2.0.1 I had 1.3 on my Tivo, which had data when it was in the US but not since it left the US, it worked fine all the menus worked even though the Tivo couldn't phone home. - including never having Tivolution magazine or showcases.

Tivo therefore have changed the types of things they check rather than stuff in /Setup.

What we need is a way to spy on the MFS entries/keys that myworld is accessing and updating as that would show these places.

Anyone got a hacked 'intercept library' for libmfs.so that can do this [show all MFS entries/keys being read written].
I'm thinking something like a the regmon utility available for Window NT/2K systems.

number6
08-02-2001, 08:24 AM
Originally posted by mrblack51
well, nomorenagz didnt do everything i was hoping, but its getting there.

my dtivo hit 30 days without a call, and disabled the record button. my season passes were still recording last i checked, but i havent check on whether i can create a new one.



Check this out, I installed tivoweb 1.9.1 on my system tonight and got it working, I noticed when I browsed onto the /Setup object using the MFS browser in Tivoweb 1.9.1
that there is a entry called ServiceInfo.

see entry bolded below:

Setup 5502/10 {
Version = 431
ServiceInfo = 5502/11
PostalCode = 6000
TimeZone = 0
DaylightSavingsPolicy = 1
Source = 5502/12 5502/13
Complete = 7
CallWaitingPrefix = {}
DialPrefix = {}
ThumbsLogMagicNumber = 1186385486
VCRIrCodeNum = 0
BannerTimeout = 250
SoundVolume = 25
RecordQuality = 75
ServiceState = 5
ServiceStateExpiration = 11900
LastSuccessCall = 996703572
LastCallAttempt = 996790101
NextCallAttempt = 996858452
LastCallStatus = Failed
IndexPath = /Setup
}


Now, when I click on the link in Tviowbe for the ServiceInfo object its dumps dump that object (#5502/11) and it looks like this:

Notice the entry I've bolded, hmm, LastsuccessPGDCall?
That looks very interesting.

ServiceInfo 5502/11 {
SwSystemName = 2.0.1-002-000
LastSuccessPGDCall = 0
AuthTollFree = 1
CallInProgress = 0
CallStatusInfo = {14
}
}

Problem is I am not sure where this object is to be found - the only way to get at it I think is via TCL.
I was wondering if someone could either (a) set the above field to non-zero [like a valid second value close to todays date] and see if that gets rid of the service interrupted problem.

or

Check what this is set to on a Tivo with live data and report back what it is.
Maybe we can crack the Service Interrupted problem after all.

sputnik
08-02-2001, 12:09 PM
On my subed unit, LastSuccessPDGCall is 996708979

trainboy
08-02-2001, 11:42 PM
996708979? That looks about right for a Unix time_t for about now. Or, in other words, the number of seconds since 1970, Jan 1, 00:00. Sometime around the 200th day of this year (I just eyeballed it). Could probably figure out how to make up a new one or just write a two-line Perl script to tell you what today's is.

slims
08-11-2001, 12:09 PM
i have a no more nag script that will make the tivo thing that you have a full sub lifetime account.
If youwant the info go to http://dealdatabase.com/forum/showthread.php?s=&threadid=2988
its right there in black and white

TiVo_Canada
08-11-2001, 10:32 PM
Slims,

Why did you chose a Service State Expiration of "11582" and not something further in the future?

mrblack51
08-12-2001, 03:42 AM
if you are already modifying the script, then why not combine the other benefits of the fixup02c.tcl script, such as automatically setting the state expiration to 365 days from $now, and whatnot. granted, your walkthrough is quite good, and very useful, i would just like to see it be as good as it can.

khmann
08-12-2001, 10:41 AM
me thinks perhaps someone is from the freeTV crowd, and not particuarly linux-saavy. but still, thankyou for contributing.

slims
08-12-2001, 11:04 AM
Ok first i only set the 11582 beause youdont need to set it to anything else. yu will nerver have to dail in again. I did't know where the other setups are to change so i just left them alone.if you can tell me where the file is to change the tivo from trying to call i wil do that i will set it fo like 2 years. that will make the tivo modem never fail.

So if you can please send me the info onwhere the file iswhat dir
thanks
-slims

I will be setting up a anglefire acount with the Zip file on it for eery one.

Have a a great day and hack the shit out of the TIVO because its fun and free. lol