PDA

View Full Version : DailyMail: a daily e-mailed status report from your TiVo


Pages : 1 [2] 3 4 5 6 7 8 9 10 11

alextegg
01-05-2004, 12:57 PM
Originally posted by alextegg
I'm pretty sure I ftp'd in binary and chmod'd. I can't try it interactively till tonight. I think(!) I set all the variables correctly too. Will check and report back...

Just ran it manually and it worked fine, so it obviously wasn't fired by cron for some reason.

The single code base would be good as I prefer this reduced mail size, but I also prefer the HTML mail, which I now can't have :eek:

Have rebooted TiVo, so hopefully all will be well now?!? :confused:

Alex

LJ
01-05-2004, 01:04 PM
I've got mine running from cron. The end of my crontab is:

# m h dom mon dow command
0 7 * * * /var/hack/dailymail_LJ.tcl > /var/log/dailymail 2>&1

On the days I've not received an email the log shows that the script aborted due to 'record in use' type errors.

Which reminds me, I spotted a bit of code in Brian Wagener's moviesort.tcl script which might be useful for the times when you really don't want your script to crash because the TiVo's hogging the record you want:
try {
set slists [get_programshowings $fsid 1]
} catch str {
puts "Ignoring Exception $str"
}

smiffy
01-06-2004, 04:39 AM
Originally posted by Francesco
Every time I try to run cron manually I get this: "cron: can't lock /var/hack/cron/cron.pid, otherpid may be 192: Resource temporarily unavailable"

Any ideas?

Me too... well very similar...

bash-2.02# /var/hack/bin/cron &
[1] 398
bash-2.02# /var/hack/bin/cron: can't lock /var/hack/cron/cron.pid, otherpid may
be 387: Resource temporarily unavailable

[1]+ Exit 1 /var/hack/bin/cron
bash-2.02#


Its seems to be working though as I have just modified the crontab file to a couple of minutes ahead and now received my email....

Can someone remind me how to modify the rc.sysinit.author? (mount rw???)

thanks

sanderton
01-06-2004, 05:52 AM
Do you already have cron running? OInce started, it runs until you kill it.

alextegg
01-06-2004, 05:56 AM
Hmm, with regard to my problem, updated my dailymail script and didn't get an email, ran dailymail manually last night and it worked.

No 'Tuesday' mail this morning, though.

Looks like I might have this 'record in use' error?

Any suggestions, stuart?

Ta

Alex

smiffy
01-06-2004, 07:22 AM
I assume that its running as I have started it manually. And have received an email.

Its just so that it autoloads shoud I restart!:D

ChrisJB
01-06-2004, 07:40 AM
Hi

I'm still getting this error when running dailymail manually:
(I'm running TivowebPlus 1 pre5 on a UK machine)

bash-2.02# ./dailymail.tcl
can't read "::version": no such variable
while executing
"if {$::version >= 3} {
set guideindexdir "/GuideIndexV2"
} else {
set guideindexdir "/GuideIndex"
}"
(file "/var/hack/tivoweb-tcl/modules/index.itcl" line 644)
invoked from within
"source /var/hack/tivoweb-tcl/modules/index.itcl"
(file "./dailymail.tcl" line 539)

I had assumed that the version check code had been fixed but this error seems to suggest otherwise. Is anyone else successfully running Dailymail with the enhanced TiVoweb and if so, what changes did you make to get it to work?

Thanks!

sanderton
01-06-2004, 07:41 AM
They said it had been - are you sure you have the latest version?

ChrisJB
01-06-2004, 09:21 AM
Yes, I am pretty sure; the tar.gz file is named as pre5 which is the latest according to the first post on the dd thread. I'm assuming that the httpd-tt.tcl file that was "fixed" is also in that tarball.

I'm going to do something which probably doesn't make any sense, which is to go back to the original TiVoweb 1.9.4 and see if I can get DailyMail functioning again. Then I'll have to decide! Do I want some clever TW extras or an email from the TiVo every morning?

ChrisJB
01-06-2004, 09:21 AM
Yes, I am pretty sure; the tar.gz file is named as pre5 which is the latest according to the first post on the dd thread. I'm assuming that the httpd-tt.tcl file that was "fixed" is also in that tarball.

I'm going to do something which probably doesn't make any sense, which is to go back to the original TiVoweb 1.9.4 and see if I can get DailyMail functioning again. Then I'll have to decide! Do I want some clever TW extras or an email from the TiVo every morning?

sanderton
01-06-2004, 09:29 AM
You can "fix" DailyMail by putting

global version
set version 2

next to where the version3 variable is set

ChrisJB
01-06-2004, 10:11 AM
I reinstalled the vanilla Tivoweb and sure enough, Dailymail worked again.

I tried your suggested fix and got this


bash-2.02# chmod 755 -c /var/hack/dailymail.tcl
mode of /var/hack/dailymail.tcl changed to 0755 (rwxr-xr-x)
bash-2.02# cd /var/hack
bash-2.02# ./dailymail.tcl
no value given for parameter "source" to "base64dec"
while executing
"base64dec"
("uplevel" body line 11)
invoked from within
"uplevel $body"
invoked from within
"transaction {uplevel $body}"
(procedure "RetryTransaction" line 5)
invoked from within
"RetryTransaction {
if {$::version3} {
set lconfig [db $db open /State/LocationConfig]
set setup [db $db open /State/ServiceConfig]
..."
(file "./dailymail.tcl" line 552)


Grrr...

Interestingly, when I reinstalled tivowebplus and started it up, it shows itself as pre4 on the "startup page" I don't know whether the author forgot to update the version number or whether there's a few bits of old code still floating around that don't address the version issue?

Just wondering why your suggerstion didn't work, thou Stuart. Here's what I added
set version3 false ;# change to true if you are on v3
global version
set version 2
set uktivo true ;# change to false if you are a colonial

sanderton
01-06-2004, 10:29 AM
They seem to have broken something else too, and fixing one problem has just revealed the next.

To be honest, I've written my modules for 1.9.4 and as that's the version I have installed and 99% of people have installed, it's difficult to deal with this kind of thing.

What does TiVoWebPlus add on a UK machine? I hacked in the streaming links to my ui.itcl; it's only two lines of code!

falcontx
01-06-2004, 11:22 AM
I was directed to take a look at this thread due to incompatibility issues with TivoWebPlus..

First I'd like to note that version 1.0-pre5 does say -pre4 when it is booted, but that is only because I forgot to update the version in the code.. With that being said, I'll explain why this particular module is not working well with TivoWebPlus..

A typical TivoWeb module is placed in the modules directory and uses the TivoWeb core to obtain data about the TiVo.. The initial compatibility issue with TivoWebPlus was that we had mistakenly removed the $::version3 variable that is highly relied upon by many modules developed for TivoWeb 1.9.4 final. Once we fixed that issue, we have had no other compatibility issues with typical TivoWeb modules..

The reason this particular script is different is that it does not operate upon the TivoWeb core.. Instead, it simply sets up a TivoWeb-like environment and then uses some of it's functions.. The problems arise when this script loads the index.itcl from the TivoWebPlus modules directory. Our version of index.itcl has been updated to use our new $::version variable in order to allow for easier implimentation of cross-platform functionality. This does not affect typical modules as even if they use functions from other modules in TivoWebPlus, all of the variables are properly set by the core. However, since this script's TivoWeb-like environment does not support this new variable (without adding the code that sanderton mentioned), problems arise.

falcontx

sanderton
01-06-2004, 12:19 PM
So Chris, probably the easiest thing to do is to take a copy of the index.itcl from 1.9.4, rename it something like index_old.itcl and put it somewhere like /var/hack, then edit DailMail's "source" command to point to the old version. No promises mind; that might break something else.

Should TiVoWebPlus ever get so must-have and stable that I upgrade my TiVos to it, then I'll make sure my modules work on it, but until then I'm going to stay 1.9.4 based.

ChrisJB
01-06-2004, 06:49 PM
Thanks falcon and Stuart for your suggestions and points of view, all of which I understand and appreciate.

I can see a solution, either to nick the pice of code that deals the streaming or chip in the old index file for Dailymail to work off.

Thanks again

davistw
01-06-2004, 09:31 PM
Originally posted by sanderton
So Chris, probably the easiest thing to do is to take a copy of the index.itcl from 1.9.4, rename it something like index_old.itcl and put it somewhere like /var/hack, then edit DailMail's "source" command to point to the old version. No promises mind; that might break something else.

Should TiVoWebPlus ever get so must-have and stable that I upgrade my TiVos to it, then I'll make sure my modules work on it, but until then I'm going to stay 1.9.4 based.

Pointing my dailymail at a copy of 1.9.4's index.itcl fixed my problem...
Thanks.

davistw
01-06-2004, 09:32 PM
Originally posted by sanderton
So Chris, probably the easiest thing to do is to take a copy of the index.itcl from 1.9.4, rename it something like index_old.itcl and put it somewhere like /var/hack, then edit DailMail's "source" command to point to the old version. No promises mind; that might break something else.

Should TiVoWebPlus ever get so must-have and stable that I upgrade my TiVos to it, then I'll make sure my modules work on it, but until then I'm going to stay 1.9.4 based.

Pointing my dailymail at a copy of 1.9.4's index.itcl fixed my problem...
Thanks.

alextegg
01-07-2004, 04:19 AM
Stuart,

My dailymail has arrived today, so it looks like there might be a problem in the script that makes it fail sometimes due to database contention or something?

Anyway, I've setup my crontab file as LJ suggested, so that the output of the dailymail goes to a log. Next failure, I'll let you know why?

Alex

sanderton
01-07-2004, 04:45 AM
It is quite sensitive to the db being locked, probably because it access it so much. I should probably get around to it sending a return code so it can be re-run if it fails.

alextegg
01-07-2004, 05:08 AM
Sounds good, meanwhile I might run it twice/three times a day from cron. Would rather delete superflous mails when they all arrive than not get notified of a conflict, I guess...

Alex

ChrisJB
01-07-2004, 06:34 AM
Originally posted by davistw
Pointing my dailymail at a copy of 1.9.4's index.itcl fixed my problem...
Thanks.

And now mine! Thanks everyone for the help

alextegg
01-09-2004, 07:16 AM
Curiously since changing my cronlog to pipe the output of dailymail to a log file, it hasn't failed at all.

It is useful, though as you can then look at the logfile in TiVoWeb

Alex

tivo-onion
01-09-2004, 01:34 PM
Hi,

whilst trying to install dailymail I have hit a problem straight away. Hopfully someone can help.

I have edited dailymail.tcl in UNIX mode to include my relevant details and FTP'ed it into the /var/hack directory. I have CHMOD'ed it 755. Everything goes to plan.

However, when I try to run dailymail.tc from the #bash prompt I get:

bash-2.02#
bash-2.02# chmod -v 755 dailymail.tcl
mode of dailymail.tcl retained as 0755 (rwxr-xr-x)
bash-2.02#
bash-2.02# pwd
/var/hack
bash-2.02# dailymail.tcl
": no such file or directory
bash-2.02#
bash-2.02#
bash-2.02#

hopefully there will be an obvious and quick answer to my problem here!

thanks

Chris

pahunt
01-09-2004, 01:36 PM
It sounds like your PATH does contain /var/hack. Try the following command instead

/var/hack/dailymail.tcl

If this does the trick then it's probably a good idea to set the PATH in rc.sysinit.author. Mine looks like this

PATH=$PATH:/var/hack:/var/hack/bin
export PATH

davistw
01-09-2004, 01:40 PM
./dailymail.tcl

Without the ./ it will search the path for the executable. The ./ will force it to use the current directory....

tivo-onion
01-09-2004, 03:12 PM
Thank for your suggestions, however I am afraid it still does not do the job. My PATH is fine, and the two options offered do not work, see below:

bash-2.02#
bash-2.02# echo $PATH
/bin:/sbin:/tvbin:/devbin:/tivo-bin:/var/hack:/var/hack/bin:/var/hack/tivoweb-tc
l:/var/hack/tivoweb-tcl/modules
bash-2.02#
bash-2.02# /var/hack/dailymail.tcl
": no such file or directory
bash-2.02#
bash-2.02# ./dailymail.tcl
": no such file or directory
bash-2.02#
bash-2.02#

If it is any help, the ": no such file or directory text does not appear straight away, there is a delay of a couple of a seconds or so before it appears, so the script seems to be running, there just seems to be an actual prolem with the script. Could there be references in the scripts that might not exist within my system? It there a log I can look at, or get a better more verbose debugging output somehow?

thanks for any help,

cheers

Chris

BobBlueUK
01-09-2004, 03:31 PM
Did you upload the file in binary FTP mode? Sounds like a prob with the script file if you ask me I'd try reuploading it...

tivo-onion
01-09-2004, 03:45 PM
Yup, that was it ... I had my FTP client set to "AUTO" which was obviously mucking it up, so I set it to "BINARY" and all was resolved. Thanks a lot!

tivo-onion
01-09-2004, 04:22 PM
Hi,

another problem, all was going well, except I get a connection refused message when the RCPT TO connection is attempted. The following extract should give some context:

bash-2.02#
bash-2.02# dailymail.tcl
Got reply: 220 rmta02.mta.everyone.net ESMTP Postfix
Connected
Got reply: 250 rmta02.mta.everyone.net
HELO acknowledged
Got reply: 250 Ok
From acknowledged
Got reply: 554 <my-valid-email@xxxxx.com>: Recipient address rejected: Relay
access denied
Connection rejected
bash-2.02#

I have rename by email id for obvious reasons, but please be assured it is correct. Does anyone have any ideas, I cannot find anything in the thread which covers this!

thanks for any help,

regards

Chris

sanderton
01-09-2004, 04:54 PM
Try changing the TiVo's sending e-mail address to your e-mail address. Some ISPs require the sender to be known to them.

tivo-onion
01-09-2004, 07:31 PM
Unfortunately, whatever email address I put in it comes back with the same response. I have also tried querying the mail server directly via telnet to ensure I have the correct syntax, which I have. I have tried a variety of email addresses including the primary one for the email provider to no avail?

Any other ideas? Would authentication be a problem? When using my email through outlook express I have to specify a password. Would this affect the acceptance of a RCPT TO address, and if so how do I login? Are there any other parameters I might need?


thanks for your help,

cheers

Chris

smokie
01-10-2004, 05:10 AM
1) Tried sending to a different recipient on a different ISP? Whenever a mate of mine mails to one of my addresses it is rejected by his ISP

2) If you post the name of your ISP here, someone else may be successfully using that one and be able to offer more help

tivo-onion
01-10-2004, 05:30 AM
1. I have also tried different recipients on a different ISP, including my work email ... to no avail.

2. My ISP is Easyspace with their Easypost mailing system. It does use Authenticated SMTP...their URL is www.easypost.co.uk

I took a look at this post (http://www.tivocommunity.com/tivo-vb/showthread.php?postid=1547527#post1547527) re: authentication? I know it is unwise, but can you send a plain text password in the same manner? If not, could someone suggest a packet sniffer (I am not familiar with using such a product) to find out the encrypted password etc.? Could anyone who has used this AUTH PLAIN approach let me know if they had the same problem as I before inserting the authentication code. Also, where within the main body of the code should this AUTH PLAIN be positioned?

thanks for your help,

Chris

ccwf
01-10-2004, 06:42 AM
Originally posted by tivo-onion
I have also tried different recipients on a different ISP, including my work email ... to no avail. That would not work without authentication. If it worked without authentication, then Easyspace would be operating an open relay and could be used by spammers to send emails to arbitrary recipients.

The server to which DailyMail should be sending email is the one in the MX record of the hostname in your email address. (nslookup can be used to lookup the MX record if you have it. Or if you don't mind posting the hostname part of your email address, someone could do the lookup for you and tell you the server to which you should be sending.) This is not necessarily the same as the server you normally use for outgoing mail and, if so, could be the cause of your problems.

LJ
01-10-2004, 06:48 AM
Here's a section I just added to DailyMail to be notified of any cachecard messages:puts "Checking for logged cachecard messages..."
if {[catch { exec grep cachecard /var/log/Okernel } ccOmsgs]} {
set ccOmsgs ""
}
if {[catch { exec grep cachecard /var/log/kernel } ccmsgs]} {
set ccmsgs ""
}
if { $ccOmsgs != "" || $ccmsgs != "" } {
lappend message "{{* Logged cachecard messages:<p><pre>}}"
lappend message "{{$ccOmsgs}}"
lappend message "{{$ccmsgs}}"
lappend message "{{</pre>}}"
}

Nihilator
01-10-2004, 12:39 PM
I have a question...

I have installed DailyMail on one of my TiVos (a Philips standalone), and I love what it does, but it seems inconsistent in sending out the e-mails. In the last month (30 days), it's sent out 19 e-mails. I have it scheduled to send at 3:00am, (mostly because I just never got around to changing the cron time), which I would think would be a time when the TiVo isn't doing anything.

Is DailyMail meant to not send out an e-mail if, well, nothing is happening?

If not, where would you all suggest I look?

Thanks!

--Chris

pahunt
01-10-2004, 02:00 PM
The layout of the DailyMail e-mail is something that everyone will have their own personal preferences about but it is obviously not everyone who wants to hack the script themselves to get it how they want.

So I have designed a solution to this problem. The DailyMail Creator.

The DailyMail Creator is a Windows application that allows you to specify what information you want to see in the e-mail and in what order it appears and then generates a DailyMail script which you can then upload to Tivo. I have already split the original DailyMail section into separate modules but new ones can easily be added.

To create new modules you will normally need to create 2 tcl scripts. One script needs to contain a proc that gets the data from the database and it's filename should end with "-proc.tcl" (e.g. "todo-proc.tcl"). The second script should contain the code to output the results to the e-mail and it's filename should end in "-output.tcl" (e.g. "todo-output.tcl"). Both files should then be saved in the Modules directory that the installater creates.

This program should work on any 32 bit version of Windows but I have only actually tested it on XP Professional. Because of it's size (500K) I cannot attach it to this post but you can download from the following link.

http://www.pahunt.co.uk/setup.zip

Hopefully the installation and usage should be fairly self-explanatory :)

EDIT: You will need to alter the dailymail1.tcl script in the Modules directory once you have completed the installation with the correct parameters.

EDIT: Doesn't appear to work on anything earlier than Windows 2000. I will see if I can work out why it doesn't work on Win9x.

pahunt
01-10-2004, 02:10 PM
And here's LJ's Cachecard Log code ready to be copied into the Modules directory

FreeBSD_user
01-10-2004, 11:52 PM
Getting an error when trying to run dailymail.tcl:


bash-2.02# ./dailymail.tcl
invalid attribute: TimeZone
while executing
"dbobj $setup get TimeZone"
("uplevel" body line 9)
invoked from within
"uplevel $body"
invoked from within
"transaction {uplevel $body}"
(procedure "RetryTransaction" line 5)
invoked from within
"RetryTransaction {
if {$::version3} {
set lconfig [db $db open /State/LocationConfig]
set setup [db $db open /State/ServiceConfig]
..."
(file "./dailymail.tcl" line 549)

mognuts
01-11-2004, 05:07 AM
Maybe I'm missing something here, but when I run DailMail Creator I don't get anything in the select modules window, even though there are .tcl files in the modules directory.

Am I doing something wrong?

pahunt
01-11-2004, 05:15 AM
Well you're probably the first person to run it so the only other machine it's been tested on is mine. So we may have to use some trial and error to get it right :)

The first thing to check is the properties of the shortcut and make sure that the "Start In" field has the full path to the program folder in it. Something like

"c:\program files\dailymail creator"

mognuts
01-11-2004, 05:25 AM
Originally posted by pahunt
The first thing to check is the properties of the shortcut and make sure that the "Start In" field has the full path to the program folder in it. Something like

"c:\program files\dailymail creator"

I tried running the .exe file itself (not from the shortcut) and still have the same problem. I've also deleted and reinstalled, still no luck.

pahunt
01-11-2004, 05:26 AM
Which version of Windows are you using?

pahunt
01-11-2004, 05:30 AM
Can you also delete the "layout.txt" file from the exectutable directory if one exists.

alextegg
01-11-2004, 06:50 AM
Originally posted by Nihilator
it seems inconsistent in sending out the e-mails. In the last month (30 days), it's sent out 19 e-mails.

Is DailyMail meant to not send out an e-mail if, well, nothing is happening?


--Chris

Chris,

I've had this problem too, apparently there can be locking issues in the dailymail script due to database conflicts, and if there is an error, no mail is sent. The script could be mod'd to repeat if unsuccessful, but at the moment, no mail will be sent in the case of a conflict

Alex

tivo-onion
01-11-2004, 07:24 AM
Hi all,

managed to get everything working fine by calling the dailymail.tcl script from the #bash prompt. However, I am now trying to set up the CRON - and to test I have setup to run dailymail.tcl every 2 minutes. Unfotunately nothing is happening.My lin in the cron is:

*/2 * * * * /var/hack/dailymail.tcl

(I have tried with and without backgrounding i.e. "&")

I start the cron, and all is well - the log file shows the CRON has started and that dailymail.tcl is running every two minutes as planned:

CRON (01/11-12:02:42-193) STARTUP (fork ok)
cron (01/11-12:04:00-195) CMD (/var/hack/dailymail.tcl)
cron (01/11-12:06:00-198) CMD (/var/hack/dailymail.tcl)
cron (01/11-12:10:00-202) CMD (/var/hack/dailymail.tcl)
cron (01/11-12:12:00-205) CMD (/var/hack/dailymail.tcl)

...however, no email is forthcoming.....

I turned on the debugging for CRON and ran in the foreground, and to my untrained eye the process does seem to start OK. I include an exerpt from my CRON debugging stuff:

load_database is done
[200] TargetTime=1073822940, sec-to-wait=54
[200] sleeping for 54 seconds
[200] load_database()
[200] spool dir mtime unch, no load needed.
[200] tick(9,12,10,0,0)
user [cron:0:0:...] cmd="/var/hack/dailymail.tcl"
[200] TargetTime=1073823000, sec-to-wait=60
[200] sleeping for 60 seconds
[200] load_database()
[200] spool dir mtime unch, no load needed.
[200] tick(10,12,10,0,0)
user [cron:0:0:...] cmd="/var/hack/dailymail.tcl"
[200] TargetTime=1073823060, sec-to-wait=60
[200] do_command(/var/hack/dailymail.tcl, (*system*,0,0))
[200] main process returning to work
[200] TargetTime=1073823060, sec-to-wait=60
[200] sleeping for 60 seconds
[201] child_process('/var/hack/dailymail.tcl')
[201] child continues, closing pipes
[201] child reading output from grandchild
[202] grandchild process Vfork()'ed
log_it: (cron 202) CMD (/var/hack/dailymail.tcl)
[201] got data (57:W) from grandchild
[201] closing pipe to mail
[200] sigchld...pid #201 died, stat=0
[200] sigchld...no children
[200] sleeping for 59 seconds
[200] load_database()
[200] spool dir mtime unch, no load needed.
[200] tick(11,12,10,0,0)
user [cron:0:0:...] cmd="/var/hack/dailymail.tcl"
[200] TargetTime=1073823120, sec-to-wait=59
[200] sleeping for 59 seconds
[200] load_database()
[200] spool dir mtime unch, no load needed.
[200] tick(12,12,10,0,0)

can anyone see anything here that may lead to a conclusion about why no email is generated?

Thanks for any help.....

cheers

Chris

mognuts
01-11-2004, 07:36 AM
Originally posted by pahunt Which version of Windows are you using? Windows XP Prof SP1Originally posted by pahunt Can you also delete the "layout.txt" file from the exectutable directory if one existsYes, file removed.

pahunt
01-11-2004, 07:41 AM
OK well that matches my machine. Try downloading this file and copying it into the same directory as the executable.

mognuts
01-11-2004, 08:07 AM
Originally posted by pahunt
OK well that matches my machine. Try downloading this file and copying it into the same directory as the executable.

Yes, that works! The original layout.txt file was empty, it contained no data at all.

Thank you.

pahunt
01-11-2004, 08:09 AM
Thanks for being my guinea pig!

I'll update the installation with the correct layout.txt file.

LJ
01-11-2004, 08:58 AM
tivo-onion: try using this - it'll capture the console output from Dailymail so you can see if it's reporting any errors:

*/2 * * * * /var/hack/dailymail.tcl > /var/log/dailymail 2>&1

mognuts
01-11-2004, 09:20 AM
Originally posted by Nihilator
I have a question...

I have installed DailyMail on one of my TiVos (a Philips standalone), and I love what it does, but it seems inconsistent in sending out the e-mails. In the last month (30 days), it's sent out 19 e-mails. I have it scheduled to send at 3:00am, (mostly because I just never got around to changing the cron time), which I would think would be a time when the TiVo isn't doing anything.

My crontab looks like this:

MFS_DEVICE=/dev/hda10
TIVO_ROOT=""

# m h dom mon dow command
10 8 * * 0-6 /var/hack/dailymail.tcl > /var/log/dailymail 2>&1
10 9 * * 0-6 /var/hack/endpad.tcl 2 5 -auto >> /dev/null &


I've had it going for several weeks now and it's never misssed an event . A couple of things to note. Firstly, avoid sending mail on the hour as TiVo is sometimes doing stuff during these times, mine is set for 10 minutes past. Secondly, use 0-6 for the days of the week.

Milhouse
01-11-2004, 09:32 AM
This is a section I've added to report the S.M.A.R.T. status of Drive A and Drive B if either one fails to pass the SMART status. It should also work for a single drive machine.


puts "Checking S.M.A.R.T. status..."
if { [catch {exec /var/hack/bin/smartctl --all /dev/hda } smart1msg]} {
set smart1msg ""
} else {
if { [string first "test result: PASSED" $smart1msg] > -1 } {
set smart1msg ""
}
}

if {[catch { exec /var/hack/bin/smartctl --all /dev/hdb } smart2msg]} {
set smart2msg ""
} else {
if { [string first "test result: PASSED" $smart2msg] > -1 } {
set smart2msg ""
}
}
if { $smart1msg != "" || $smart2msg != "" } {
lappend message "{{<span style='color: red;'><b>*** WARNING! S.M.A.R.T. Errors detected ***</b></span><p>}}"

if { $smart1msg != "" } {
lappend message "{{<b>Drive A (/dev/hda):</b><p><pre>}}"
lappend message "{{$smart1msg}}"
lappend message "{{</pre>}}"
}

if { $smart2msg != "" } {
lappend message "{{<b>Drive B (/dev/hdb):</b><p><pre>}}"
lappend message "{{$smart2msg}}"
lappend message "{{</pre>}}"
}
}


Note this is using the SourceForge version of smartctl which can be downloaded from this (http://www.tivocommunity.com/tivo-vb/showthread.php?s=&postid=1642457#post1642457) thread (smartctl.zip, first thread).

gardavis
01-11-2004, 11:16 AM
Originally posted by FreeBSD_user
Getting an error when trying to run dailymail.tcl:


bash-2.02# ./dailymail.tcl
invalid attribute: TimeZone
while executing
"dbobj $setup get TimeZone"
:
:


Probably forgot to edit the variables at the front of the dailymail1.tcl file to set version3 to true.

The dailymail creator should probably allow the user to enter the variables - this is what I used:

#set variables
set mailserver 192.168.0.2 ;# the IP address of your ISP's SMTP server
set domain webguild.dyndns.org ;# your domain
set recipient gary ;# the email address to send to
set sender "tivo@$domain" ;# set to be a vailid e-mail address if your ISP requires it, most don't
set hoursahead 36 ;# number of hours ahead to look for enclosed info
set version3 true ;# change to true if you are on v3
set uktivo false ;# change to false if you are a colonial

pahunt
01-11-2004, 11:19 AM
That's one of things I've got planned for the next version. Along with it FTPing the generated script to Tivo for you rather than saving it on the PC.

tivo-onion
01-11-2004, 11:25 AM
Originally posted by LJ
tivo-onion: try using this - it'll capture the console output from Dailymail so you can see if it's reporting any errors:

*/2 * * * * /var/hack/dailymail.tcl > /var/log/dailymail 2>&1

Thanks LJ!

The output I have got is as follows:

WARNING: couldn't scan startup script /tvlib/tcl/tv/tv.ini
WARNING: eval result : can't read "env(TIVO_ROOT)": no such element in arrayunable to initialize filesystem
while executing
"dbopen"
(file "/var/hack/dailymail.tcl" line 536)

Wierd, I do not get this problem when I run dailymail directly from the #bash prompt. Also, my TiVo is not currently recording anything, so it cannot be that it is being locked out for that reason!

Could it be a path issue?

Any ideas?

thanks

Chris

tivo-onion
01-11-2004, 06:18 PM
Have fixed my CRON problem - seems I had missed a couple of TiVo required lines in my crontab - my crontab is now:

SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/var/hack/bin
MFS_DEVICE=/dev/hda10
TIVO_ROOT=""

# m h dom mon dow command
45 5 * * 0-6 /tvbin/tivosh /var/hack/dailymail.tcl > /var/log/dailymail 2>&1

works like a dream! Excellent module! Thanks for everyones help with this!

cheers

Chris

FreeBSD_user
01-11-2004, 09:27 PM
Thanks for the reply on the time zone problem. I set everything but the version3 var. Works great now.

Nihilator
01-12-2004, 12:03 AM
Originally posted by mognuts
My crontab looks like this:

MFS_DEVICE=/dev/hda10
TIVO_ROOT=""

# m h dom mon dow command
10 8 * * 0-6 /var/hack/dailymail.tcl > /var/log/dailymail 2>&1
10 9 * * 0-6 /var/hack/endpad.tcl 2 5 -auto >> /dev/null &


I've had it going for several weeks now and it's never misssed an event . A couple of things to note. Firstly, avoid sending mail on the hour as TiVo is sometimes doing stuff during these times, mine is set for 10 minutes past. Secondly, use 0-6 for the days of the week.

Thanks much...I was still using the 1-5 for the days. And going over the e-mails that I've received, I see that two are skipped every seven days. I'm still missing one or two beyond those, so I think moving the time to ten minutes past the hour will likely work for me, as well.

--Chris

PS -- The S.M.A.R.T. status code looks cool, and that seems a great idea to help catch a problem before it manifests itself....that's next!

smiffy
01-12-2004, 03:15 AM
Just tried running the DailyMail Creator and get this error....


c:\error.gif


seems to create a tcl file ok though

pahunt
01-12-2004, 03:44 AM
Originally posted by smiffy
Just tried running the DailyMail Creator and get this error....


c:\error.gif


seems to create a tcl file ok though

That's strange because there's no file called error.gif in the program or used by the program. At what point do you get the error?

sanderton
01-12-2004, 06:26 AM
Originally posted by mognuts
My crontab looks like this:

MFS_DEVICE=/dev/hda10
TIVO_ROOT=""

# m h dom mon dow command
10 8 * * 0-6 /var/hack/dailymail.tcl > /var/log/dailymail 2>&1
10 9 * * 0-6 /var/hack/endpad.tcl 2 5 -auto >> /dev/null &




Careful; you will end up with multiple copies of EndPad running - the -auto switch disables the "is EndPad already running" check so every day you'll get a new copy running in parallel!

It you want to force a start every day to make sure it's running, I suggest you put in a

/var/hack/endpad.tcl -stop

to run 5 mins before.

TiVoMango
01-12-2004, 02:11 PM
Originally posted by Milhouse
This is a section I've added to report the S.M.A.R.T. status of Drive A and Drive B if either one fails to pass the SMART status. It should also work for a single drive machine.


Very nice.

Could your script also display the S.M.A.R.T. pass results in the e-mail? (assuming the drive(s) pass each day!)ie: smartctl -c
A bit of peace of mind, and some more bumf to add to the e-mail.

Milhouse
01-12-2004, 03:11 PM
Originally posted by TiVoMango
Very nice.

Could your script also display the S.M.A.R.T. pass results in the e-mail? (assuming the drive(s) pass each day!)ie: smartctl -c
A bit of peace of mind, and some more bumf to add to the e-mail.

I did think about that, but assumed that since the script will only start screaming in panic when it can't find "PASSED" there wasn't any need to state the disk had passed the test each day. Personally I want to keep the "noise" to a minimum and only contain pertinent information in the email. It should be fairly straight forward to add a "grep" for each disk to extract the line containing the phrase "PASSED", however what I've also done is to output the contents of each smart message to the console (using puts), and as this is redirected to /var/log/dailymail.log in my cron job I can view the full details via TiVoWeb->Logs.

borghe
01-12-2004, 04:08 PM
I didn't see a fix a few pages back so I figured I would offer one up for anyone wanting to use TivoWebPlus with dailymail.. it is as simple as opening dailymail.tcl in an editor and replacing all instances of

if($::version3)

with

if($::version >= 3)

there are about 3 or 4 places I believe where this occurs in the file.. doing that will allow dailymail to run beautifully with TivoWebPlus.

sanderton
01-12-2004, 04:15 PM
They fixed that in TiVoWeb Plus a couple of versions ago - they are at the "version a day" stage. :)

alextegg
01-13-2004, 01:38 PM
Stuart,

here's what happens when my Dailymail occasionally fails:

DailyMail starting...
Checking for errors...
Checking for new mail...
Calculating disk usage...
Generating conflicts list...
no such object: {CONFLICT err=errTmActiveLockConflict}
while executing
"dbobj $program gettarget Series"
("uplevel" body line 5)
invoked from within
"uplevel $body"
invoked from within
"ForeachMfsFileTrans fsid name type $nowshowingdir "" 20 {
set rec [db $db openid $fsid]
set showing [dbobj $rec get Showing]
set pro..."
(procedure "init_ns_cache" line 30)
invoked from within
"init_ns_cache"
(procedure "get_programshowings" line 49)
invoked from within
"get_programshowings $tofind_fsid 1"
(procedure "alt_showing" line 4)
invoked from within
"alt_showing $id $id2"
("uplevel" body line 49)
invoked from within
"uplevel $body"
invoked from within
"ForeachMfsFile fsid name type "/Recording/History" "" {

set recdate [split $name ":"]
regsub {^(-?)0+([1-9])} [lindex $recdate 1] {\1\2} the..
."
(procedure "getconflicts" line 8)
invoked from within
"getconflicts $hoursahead"
(file "/var/hack/dailymail.tcl" line 997)


HTH

Alex

LJ
01-13-2004, 01:51 PM
Originally posted by alextegg
here's what happens when my Dailymail occasionally fails:

no such object: {CONFLICT err=errTmActiveLockConflict}
I'm testing some code that should fix those types of crashes. It looks like the transaction retry code checks which particular error was returned from the database read command. If it recognises certain types of non-critical errors it just keeps on retrying. The problem seems to be when the code reading the database is several procs deep - the error detail doesn't seem to be passed back up the levels and the retry code aborts as it doesn't know which particular error occurred...

tivo-onion
01-14-2004, 03:07 AM
I have just installed endpad and it ocurred to me that it may impact on the dailymail content! A couple of things that it may be interesting to consider adding to the daily mail are:

1. an update as to whether endpad is running at the moment.

2. a flag next to any to-do suggestions indicating whether it is likely to be removed due to end-padding being added to a prior recording.


I have no idea how to do number (1). Does anyone have any ideas?

I will have a crack at number (2). It may have additional complications due to series of sequential recordings - but certainly is possible. Has anyone any code snippets that may be useful?

cheers

Chris

tivo-onion
01-14-2004, 04:30 AM
I have had a crack at jazzing up the dailymail with a bit more HTML. A image of what it looks like in Microsoft Outlook is available here (http://deepinthejungle.servehttp.com/Images/jazzed_up_dailymail_image_1.jpg).

It has addded graphics and links back to your tivoweb for further viewing / cancelling etc.

There are two additional variables to set in the .tcl file, which are your urls for tivoweb and your images folder location - "tivourl" and "graphicsurl".

I have only tested this in a Microsoft Outlook client, so I do not know if this works in any other email clients. It does not work very well in the web version of Outlook for some reason, I will be looking into that.

Included in the zip file is the tcl file, to be placed in your /var/hack/ directory, 4 x image files, to be placed in your web server images directory on your pc or elsewhere, and an .itcl file, to be placed in your tivoweb-tcl/modules/ directory.

The .itcl file allows a jazzed or normal daily mail to be sent, and is used by the jazzed up email to resend.

The ZIP file is available here (http://deepinthejungle.servehttp.com/dailymail_jazz.zip) .

The code is rough and ready, html functionality has been added in a shoddy fashion, but it does work very well for me. In essence, it is only minor changes to an already excellent module ..... cheers sanderton.

Hope this might be useful, if not please ignore me!

cheers

Chris

sanderton
01-14-2004, 04:56 AM
Originally posted by tivo-onion
I have just installed endpad and it ocurred to me that it may impact on the dailymail content! A couple of things that it may be interesting to consider adding to the daily mail are:

1. an update as to whether endpad is running at the moment.

2. a flag next to any to-do suggestions indicating whether it is likely to be removed due to end-padding being added to a prior recording.


I have no idea how to do number (1). Does anyone have any ideas?

I will have a crack at number (2). It may have additional complications due to series of sequential recordings - but certainly is possible. Has anyone any code snippets that may be useful?

cheers

Chris

Endpad stores it's PID in the file endpad.pid; you could read that and check that there is a process with thet PID running. Not 100% as it might have crashed and the system by chance reallocated the PID.

Re: the checking, you need to read the Now Playing items two at a time, comapre their start and end adates and their SelectionTypes. It's in EndPad. :)

sanderton
01-14-2004, 04:58 AM
Originally posted by tivo-onion
I have had a crack at jazzing up the dailymail with a bit more HTML. A image of what it looks like in Microsoft Outlook is available here (http://deepinthejungle.servehttp.com/Images/jazzed_up_dailymail_image_1.jpg).

Nice.

I didn't implement links in the original, because the complex way that my TiVos are behind firewalls make it non trivial.

Milhouse
01-14-2004, 06:22 AM
Very nice tivo-onion, but I agree with Sanderton the images should at least be optional (perhaps a simple on/off switch in the script) for us poor soles behind work firewalls/web proxies which make emails linked to external content a pain in the a*se. :)

Crispin
01-14-2004, 06:32 AM
It is possible to embed images inside the email, although I don't actually know the details.

Another thing that would be nice is to encode the plain text and html text inside the same email (using the multipart Content-Type). If I get a spare moment I may have a look at doing that :)

alextegg
01-14-2004, 07:17 AM
So do we need someone to attempt to combine all these various versions?

I'm willing to have a go, but don't have any TCL skills, so would have to learn on the job...

Or is everyone happy with the status quo? I'm confused as I like some of the features from two or three different versions, and think they should be combined with a single set of config vars or a config tivoweb module.

Thoughts?

pahunt
01-14-2004, 07:21 AM
My DailyMail Creator should do the job already.

Crispin
01-14-2004, 07:36 AM
Originally posted by pahunt
My DailyMail Creator should do the job already.
I'm sure that your DailyMail creator is an excellent tool, however some of us don't use windows at all, so its not going to help. Now a TivoWeb module on the other hand ... :)

pahunt
01-14-2004, 07:41 AM
Originally posted by Crispin
I'm sure that your DailyMail creator is an excellent tool, however some of us don't use windows at all, so its not going to help. Now a TivoWeb module on the other hand ... :)

Ah....... I hadn't thought of that :eek:

alextegg
01-14-2004, 07:45 AM
But the dailymail creator only creates a script with the functionality that was in the version you generated it from? Doesn't it? The bells and whistles from all versions need to go into it?

:eek:

sanderton
01-14-2004, 07:50 AM
This has all proved much more popular than I thought. :)

To do this "properly" would I think need three things:

* A modular approach to creating the functionality, eg due to expire, due to record. These modules would return the data in some kind of meta-formatted form.

* A modular approach to formatting, along the lines of stylesheets, which could parse the meta-formattted data from the modules and either send plain text, or some variation on HTML depending on requirements.

* A TivoWeb from end to control all this

All of a sudden it sounds like a much bigger project than my little hacked script. :)

iankb
01-14-2004, 08:04 AM
tivo-onion: A couple of problems with the graphics in dailymail_jazz.tcl ...[list=1] The graphic 'phone.jpg' is referred to with an uppercase P in the script. I changed the script to lowercase.

My FTP client didn't like the space in the 'TiVo LoGo.jpg' filename, so took the space out, rather than work out how to get FTP to accept it.[/list=1]

tivo-onion
01-14-2004, 10:33 AM
Originally posted by iankb
tivo-onion: A couple of problems with the graphics in dailymail_jazz.tcl ...[list=1] The graphic 'phone.jpg' is referred to with an uppercase P in the script. I changed the script to lowercase.

My FTP client didn't like the space in the 'TiVo LoGo.jpg' filename, so took the space out, rather than work out how to get FTP to accept it.[/list=1]

The webserver I was using to vend the graphics was on a windows machine, not my tivo - hence my splitting out of the tivourl and the graphicsurl - so I didn't have any problems with spaces and upper/lowercase text. I shall try to be more aware of UNIX / LINUX oriented programming approaches in future to make it more platform independent.

I am working on a more flexible approach with more global variables etc. at the moment and on/off switches for graphics and links. Will send out when I get home and have a chance to test it on my TiVo,

cheers

Chris

TiVoMango
01-14-2004, 01:24 PM
Originally posted by sanderton
This has all proved much more popular than I thought. :)

To do this "properly" would I think need three things:

* A modular approach to creating the functionality, eg due to expire, due to record. These modules would return the data in some kind of meta-formatted form.

* A modular approach to formatting, along the lines of stylesheets, which could parse the meta-formattted data from the modules and either send plain text, or some variation on HTML depending on requirements.

* A TivoWeb from end to control all this

All of a sudden it sounds like a much bigger project than my little hacked script. :)

:D :up: :D :up: :D :up: :D :up:

mognuts
01-14-2004, 01:41 PM
Originally posted by sanderton
Careful; you will end up with multiple copies of EndPad running - the -auto switch disables the "is EndPad already running" check so every day you'll get a new copy running in parallel!

It you want to force a start every day to make sure it's running, I suggest you put in a

/var/hack/endpad.tcl -stop

to run 5 mins before.

Thanks for this, I've modified my crontab accordingly.

mrtickle
01-14-2004, 02:00 PM
Originally posted by Crispin
Another thing that would be nice is to encode the plain text and html text inside the same email (using the multipart Content-Type). If I get a spare moment I may have a look at doing that :)

Yes please!

An option for plain text only would be nice as well and probably would be easy if you've already written the plain text stuff for the above. But in the absence of that, one that used multipart Content-Type would be cool!

sanderton
01-14-2004, 03:08 PM
The SMTP bit as it stands won't cope with MIME; you get multiline replies when you connect with EHLO rather than HELO, and when I wrote this I hadn't really got sockets sussed, so the code is strictly one line out; one line back. Could be altered, of course.

tivo-onion
01-14-2004, 04:33 PM
I have put together a more flexible version of the Jazzed Up DailyMail. Almost everything is parameterised now, so you can turn graphics / links etc. on and off very easily.

It is available here (http://deepinthejungle.servehttp.com/dailymail_jazz.zip).

Enjoy.....

cheers

Chris

Prof. Yaffle
01-14-2004, 05:20 PM
Hmmm.... Just tried the jazzed up version and this is the output I got -

bash-2.02# dailymail_jazz.tcl
Creating heading..
Calculating uptime & reboot status...
Checking phone & daily call status...
Checking S.M.A.R.T. status...
Compiling to do list...
Compiling expiration list...
Compiling conflicts list...
Got reply: 220 pengo.systems.pipex.net ESMTP Postfix
Connected
Got reply: 250 pengo.systems.pipex.net
HELO acknowledged
Got reply: 250 Ok
From acknowledged
Got reply: 250 Ok
To acknowledged
Got reply: 354 End data with <CR><LF>.<CR><LF>
Sending message...
Building Header...
Building Content....
html starts..
body starts..
<table
width="580"
border="0">
<tr>
<td
width="72"><div
align="left"><img
src="http://members.lycos.co.uk/KarlTracey/tivoimages/tivologo.jpg"
width="57"
height="84"></div></td>
<td
width="508"><font
style="font-size:
18px;
font-weight:
bold;
font-family:
Arial,
Helvetica,
sans-serif;
color
=
#305BB9;"
size=18px
face=Arial>Welcome
To
The
TiVo
Status
Email
For
Wednesday</font></td></tr></table><BR>
<table
width="522"
border="0">
<tr>
<td
width="32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td
width="80"><div
align="left"><a
href="https://*********************/info/"><img
src="http://members.lycos.co.uk/KarlTracey/tivoimages/boot.jpg"
width="68"
height="50"
border="0"></a></div></td><td
width="410">
unmatched open quote in list
while executing
"foreach part $item {
foreach line $part {
puts $chan [strim $line]
puts [strim $line]
}
}"
(procedure "sendmail" line 93)
invoked from within
"sendmail $mailserver $domain $recipient "Daily status e-mail" $message"
(file "/var/hack/dailymail_jazz.tcl" line 1028)
bash-2.02#



Has anyone got any ideas what I've done wrong? (I've masked the address of my TiVo in the above)

Prof. Yaffle
01-14-2004, 05:31 PM
Ok, forget that last question. Not sure what was wrong but I've fixed it by crashing TiVo ;)

Prof. Yaffle
01-14-2004, 06:35 PM
Okay, two more questions and then I'll leave you alone. ;)

1) Does the disk monitoring need me to do anything else before it will work (I've seen the thread on the Underground forum but just wondered if I need to do anything for it to work? Do I need to enable it?)

2) If I try the Plain Text mail from the TiVoweb module I still get a HTML mail? Could be something I've messed up. Just wondered if I was the only one getting this?

tivo-onion
01-14-2004, 06:48 PM
Originally posted by Prof. Yaffle
Okay, two more questions and then I'll leave you alone. ;)

1) Does the disk monitoring need me to do anything else before it will work (I've seen the thread on the Underground forum but just wondered if I need to do anything for it to work? Do I need to enable it?)

2) If I try the Plain Text mail from the TiVoweb module I still get a HTML mail? Could be something I've messed up. Just wondered if I was the only one getting this?


1) There was quite a discussion regarding the SMART monitoring earlier in this thread. I am afraid I am not an expert on this, so best look there. I think the post number is #304 (http://www.tivocommunity.com/tivo-vb/showthread.php?postid=1643934#post1643934). There is a link to SourceForge which should give you some background.

2) Yeah, the Plain Text is the orginal module, which still has minimal HTML tags - it was not as "plain" as I thought initially!

Is your dailymail_jazz.tcl now working? Let me know and will try and help debug! I recognise the previous error you had so could help!

cheers

Chris

Prof. Yaffle
01-14-2004, 06:53 PM
I was just curious really. I'll use the snazzy version anyway but when I tried the plain text one I got an absolutely identical mail. Could well be something I altered though.

I managed to reboot the TiVo accidentally and when it rebooted it worked without any errors so whatever it was is sorted now. Thanks anyway.

tivo-onion
01-14-2004, 07:01 PM
Originally posted by Prof. Yaffle
I was just curious really. I'll use the snazzy version anyway but when I tried the plain text one I got an absolutely identical mail. Could well be something I altered though.

I managed to reboot the TiVo accidentally and when it rebooted it worked without any errors so whatever it was is sorted now. Thanks anyway.

Yeah, maybe... The code in the .itcl module is:


proc action_senddailymail {chan path env} {

puts $chan [html_start "Send Daily Status Email"]
puts $chan [html_table_start "" "Send Daily Status Email" "COLSPAN=2"]
puts $chan [tr "" [td [html_link "/plainmail" "Send Plain Text Email"]]]
puts $chan [tr "" [td [html_link "/extramail" "Send Zazzed! HTML Email"]]]
puts $chan [html_table_end]
puts $chan [html_end]
}

proc action_plainmail {chan path env} {

if {[string index $path 0] == "/"} {
set path [string range $path 1 end]
}

set command "/var/hack/dailymail.tcl";
eval $env;
exec $command;

puts $chan [html_start "Send Daily Status Email"]
puts $chan [html_table_start "" "Plain Text Daily Status Email Sent!" "COLSPAN=2"]
puts $chan [tr "" [td [html_link "/plainmail" "Send Plain Text Email"]]]
puts $chan [tr "" [td [html_link "/extramail" "Send Extra! HTML Email"]]]
puts $chan [html_table_end]
puts $chan [html_end]

}

proc action_extramail {chan path env} {

set command "/var/hack/dailymail_jazz.tcl";
eval $env;
exec $command;

puts $chan [html_start "Send Daily Status Email"]
puts $chan [html_table_start "" "Jazzed! HTML Daily Status Email Sent!" "COLSPAN=2"]
puts $chan [tr "" [td [html_link "/plainmail" "Send Plain Text Email"]]]
puts $chan [tr "" [td [html_link "/extramail" "Send Extra! HTML Email"]]]
puts $chan [html_table_end]
puts $chan [html_end]

}


register_module "senddailymail" "Send Daily Mail" "Send a TiVo Daily Mail"


If you click on the "Send Plain Text Email" it should call the "/var/hack/dailymail.tcl" file and generate the standard email output. You may have edited / renamed something I guess?

cheers

Chris

P.S. if you get that error again let me know!

tivo-onion
01-14-2004, 07:23 PM
Originally posted by sanderton
Endpad stores it's PID in the file endpad.pid; you could read that and check that there is a process with thet PID running. Not 100% as it might have crashed and the system by chance reallocated the PID.

Re: the checking, you need to read the Now Playing items two at a time, comapre their start and end adates and their SelectionTypes. It's in EndPad. :)

Where does the endpad.pid file live - I cannot find it?

thanks Chris

tivo-onion
01-14-2004, 07:26 PM
sorry ... disregard last post ... I found it in /var/run/endpad.pid

clueless .....

thanks

chris

Prof. Yaffle
01-14-2004, 08:22 PM
Another question I'm afraid :( This time to do with Cron I think.

I've got the HTML version working correctly now. I can run it from bash and it works fine. I can run it from TiVoweb and it works fine and I can get the plain text and the html version as well. I assume that I should be able to alter my cron job to send the new html version of the mail by altering the last line of Crontab to

00 08 * * 1-7 /var/hack/dailymail_jazz.tcl &

I've tried and it doesn't work. If I change the name back to the plain mail file it works perfectly.

Has anyone got any ideas what I'm doing wrong?

TIA

AdyJ
01-14-2004, 09:23 PM
dailymail for the hard of thinking... (ie - me :confused:)

I'm getting the following error when I run dailymail.tcl (it's got to be somethiing simple);

bash-2.02# chmod 755 dailymail1.tcl
bash-2.02# ./dailymail1.tcl
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: setpri: command not found
./dailymail1.tcl: catch: command not found
./dailymail1.tcl: proc: command not found
./dailymail1.tcl: return: bad non-numeric arg `[string'

I have made sure I ftp'd in BINARY mode, and have 755'd the file (after updating with my mail details). I unzipped it on Windows and edited it on the tivo. I'm running it from /var/hack, and have tivoweb 1.9.4 up and running. UK Tivo with 2.5.5, and very recent installation of cachecard.

Please break it to me gently... in the meantime, I'll get some shuteye :o

Cheers

Ady

Milhouse
01-14-2004, 11:09 PM
Originally posted by Prof. Yaffle
Okay, two more questions and then I'll leave you alone. ;)

1) Does the disk monitoring need me to do anything else before it will work (I've seen the thread on the Underground forum but just wondered if I need to do anything for it to work? Do I need to enable it?)



Download the smartctl binary referenced in the Underground thread, install it as /var/hack/bin/smartctl and then each time DailyMail.tcl is run it will check the SMART status of each of your hard drives - if any are failing it will alert you in the email.

:)

tivo-onion
01-15-2004, 02:34 AM
Originally posted by Prof. Yaffle
Ok, forget that last question. Not sure what was wrong but I've fixed it by crashing TiVo ;)

No...you were right ... there is a bug there. When you rebooted, the script executed differently becuase you had "rebooted within the last 24 hours", so you did not encounter it! TCL/this module seems very sensitive about hanging quotes i.e. \" and does not like a space in front of them for some reason!

I have uploaded a fixed version in the usual place i.e. here! (http://deepinthejungle.servehttp.com/dailymail_jazz.zip).

I am not sure what the problem is with the CRON job and there are no clues in your message content............

My crontab entry looks like this and works fantastically:

45 5 * * 0-6 /tvbin/tivosh /var/hack/dailymail_jazz.tcl > /var/log/dailymail 2>&1

........note that apparantly we should be using days 0-6 rather that 1-7. This entry also writes a logfile so might give you some clues as to what went wrong! I also execute in the tivosh as was mentioned by someone as a good approach much earlier in this thread - seems to work for me!

Are you sure that you have ftp'ed it binary, chmod'ed it 755 and that it is in the right location - just the usual stupid things so please forgive me for bringing them up - but nearly always the cause of my problems.

I am afraid that I am out of the country until next wednesday, so will not be able to respond to any posts. Will get back to you then if there any more issues - let me know,

cheers

Chris

sanderton
01-15-2004, 05:21 AM
Originally posted by Prof. Yaffle
Another question I'm afraid :( This time to do with Cron I think.

I've got the HTML version working correctly now. I can run it from bash and it works fine. I can run it from TiVoweb and it works fine and I can get the plain text and the html version as well. I assume that I should be able to alter my cron job to send the new html version of the mail by altering the last line of Crontab to

00 08 * * 1-7 /var/hack/dailymail_jazz.tcl &

I've tried and it doesn't work. If I change the name back to the plain mail file it works perfectly.

Has anyone got any ideas what I'm doing wrong?

TIA

Is there a blank line at the end of the crontab? I has trouble with cron if there wasn't. Or was it if there was? Whatever, try whichever one you don't have. :)

sanderton
01-15-2004, 05:22 AM
Originally posted by AdyJ
dailymail for the hard of thinking... (ie - me :confused:)

I'm getting the following error when I run dailymail.tcl (it's got to be somethiing simple);

bash-2.02# chmod 755 dailymail1.tcl
bash-2.02# ./dailymail1.tcl
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: global: command not found
./dailymail1.tcl: setpri: command not found
./dailymail1.tcl: catch: command not found
./dailymail1.tcl: proc: command not found
./dailymail1.tcl: return: bad non-numeric arg `[string'

I have made sure I ftp'd in BINARY mode, and have 755'd the file (after updating with my mail details). I unzipped it on Windows and edited it on the tivo. I'm running it from /var/hack, and have tivoweb 1.9.4 up and running. UK Tivo with 2.5.5, and very recent installation of cachecard.

Please break it to me gently... in the meantime, I'll get some shuteye :o

Cheers

Ady

Looks like you edited it on a PC and didn't "convert" it to a Unix format text file?

Prof. Yaffle
01-15-2004, 06:04 AM
Is there a blank line at the end of the crontab? I has trouble with cron if there wasn't. Or was it if there was? Whatever, try whichever one you don't have.

Now you mention it that rings a bell. I'm pretty sure I removed a couple of blank lines when I altered things last night. I'd completely forgot why they where there. Still seems strange that it'll run the plain version if I alter it back though. I've amended it to be same as Chris' and still no joy. If I look in the log file it creates it's completely empty. I'll have another go tonight.


Download the smartctl binary referenced in the Underground thread, install it as /var/hack/bin/smartctl and then each time DailyMail.tcl is run it will check the SMART status of each of your hard drives - if any are failing it will alert you in the email.

Thanks. I wasn't sure if it needed to have been enabled by me before Dailymail could use it or if Dailymail would just launch it when it needs it.


Also, is it possible to add the Space Used bit from LJ's version to the Jazzy version?

AdyJ
01-15-2004, 07:03 PM
Originally posted by sanderton
Looks like you edited it on a PC and didn't "convert" it to a Unix format text file?

Stuart
Thanks for the quick reply.
This was my first guess too, but I have managed to rule it out - if I run an unedited dailymail.tcl I get the expected 'could not forward you email' error that you would expect. As soon as I add so much as a space to the file, using joe on the tivo, I get the 'command not found' errors I listed. I have used joe to edit other files, including my rc.local.author to tidy up the cachecard install shortly before (eagerly ;) ) trying dailymail. I'll try reinstalling joe.
Cheers

sanderton
01-15-2004, 07:53 PM
The key bit is the very first line which tells bash it's a tivosh script; it seems to be interpreting it directly which suggests that the first line has got corrupted somehow.

Should read:

#!/tvbin/tivosh

Prof. Yaffle
01-15-2004, 08:02 PM
I've had another go tonight to get the jazzy version working from CRON still with no joy. I've tried with an additional blank line at the end of Crontab and without. All the permissions are set. If I run it myself from bash it works fine. If I alter the last line to dailymail.tcl it runs the plain version from Cron but as soon as I change it back, nothing. Something must be wrong somewhere. Oh well, I'll try again tomorrow.

Prof. Yaffle
01-15-2004, 08:30 PM
I've just tried

/tvbin/tivosh /var/hack/dailymail_jazz.tcl > /var/log/dailymail 2>&1

from bash and it worked fine. It created entries in the dailymail log as expected. If I check it after CRON should have ran it has nothing (the log was empty to start with).

Milhouse
01-16-2004, 10:31 AM
This weekend I plan on modifying dailymail_jazz as follows (since it appears to be the most advanced version available!):

1. Seperate the configuration options from dailymail.tcl into dailymail.cfg - this could then be written by a TiVoWeb module and would also mean we don't need to modify dailymail.tcl each time a new version is posted!

2. Add the option to enable/disable the inclusion of Suggestions in the various sections

3. Allow the order of the main data sections (Conflicts, ToDo and Expired Items) to be specified in the config file thus:

listToDo=2
listConflicts=1
listExpired=0

The above would result in Conflicts appearing first, followed by the To Do list and the Expired items would not be shown (ie. disabled).

ddub
01-16-2004, 05:12 PM
Finally got Cron working with dailymail_jazz !!

Conclusion for those that done want to trawl the whole thread:

Files:

dailymail_jazz.tcl put this in: /var/hack/ ( make executable with chmod 755 dailymail.tcl )
senddailymail.itcl put this in: /var/hack/tivoweb-tcl/modules/

edit dailymail_jazz.tcl with JOE unix editor and set the mail delivery parameters and webserver or location of the 4 jpegs that come with the HTML email

the 4 jpg's on your webserver of choice.

the cron files:

cron put this in: /var/hack/bin/ ( make executable with chmod 755 cron )
crontab put this in: /var/hack/etc/ ( also make executable with chmod 755 cron )


use JOE editor to edit the crontab file to include:

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file.

# for TiVo: This file doesn't use a user field like system-wide crontabs
# normally do. Everything runs at uid 0 (not that it matters for TiVo).

SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/var/hack/bin:/var/hack/etc
MFS_DEVICE=/dev/hda10
TIVO_ROOT=""

# m h dom mon dow command
05 05 * * 0-6 /tvbin/tivosh /var/hack/dailymail_jazz.tcl > /var/log/dailymail 2>&1

finaly create a directory called cron in /var/hack/ for the pid file to go in.

now finally run cron: /var/hack/bin/cron &

hopefully that should do it.

- ddub

Milhouse
01-17-2004, 04:01 PM
Attached is an updated dailymail_jazz2.

I took the liberty of converting it to use style sheets - this seems to be OK with Outlook and makes the code easier to work with. :)

dailymail_jazz now uses a seperate configuration file - dailymail.cfg which must be in /var/hack by default. Edit this config file to change email address, tivo address, image addresses etc.

Suggestions can now be disabled (dmailShowSuggestions) and the order of ToDo, Conflcts and Expired can be modified (or even disabled). In the example that is attached Conflicts is followed by ToDo and Expired is disabled.

sanderton
01-17-2004, 04:13 PM
Attached?

Milhouse
01-17-2004, 04:13 PM
Updated with a minor change to the config file - have now removed my details! :rolleyes:

Edit: Sorry, there was a bug with the "Show Suggestions" resulting in no entries appearing at all in the To Do list - jazz2_1 now fixes this bug (attached) - just replace dailymail_jazz.tcl with this updated version.

Prof. Yaffle
01-19-2004, 08:56 AM
Well, with a lot of playing around I finally managed to get the Jazzy version working. It seems to have been a problem with Textpad even though it's the program I've been using for all the TiVo script editing. Thanks for helping everyone.

Milhouse
01-19-2004, 06:47 PM
Another bug fix I'm afraid - the previous version wasn't correctly formatting the From: address when sending the email, this version fixes that bug-ette.

The only change in this version is to dailymail_jazz.tcl.

Sorry about that!

velocitysurfer
01-19-2004, 07:01 PM
Originally posted by davistw
Pointing my dailymail at a copy of 1.9.4's index.itcl fixed my problem...
Thanks.


not quite for me ! I also had to point to 1.9.4's util.itcl (using jazz 2-2)

thanks everybody for your help - this is great - should have got turbonet sooner - now for the 2x120gb upgrade but don't tell the wife!!

FreeBSD_user
01-21-2004, 08:05 AM
I had to change the date format for Version 0.3 to get Spamassassin to let the message thru:
puts $chan "Date: [clock format [clock seconds] -format {%a, %d %b %G %H:%M:%S %z (%Z)} -gmt true]"

I have also made the follow changes to make the message more Spamassassin friendly:

global sender_name
set sender_name "Tivo"

set recipient_name "Michael XXXXXXXX"

proc sendmail {mailserver domain recipient recipient_name subject message} {
global sender_name

puts $chan "From: $sender_name <$sender>"

puts $chan "To: $recipient_name <$recipient>"

sendmail $mailserver $domain $recipient $recipient_name "Daily status e-mail" $message

tivo-onion
01-21-2004, 01:16 PM
Wow, this is looking great now!

i have taken the up-to-date jazz 2-2 and updated it to include some endpad testing and reporting.

The module will look in the endpad.pid file, extract the pid number, and then perform a "ps" command to check that the process is still running. Of course, as sanderton said a while ago this may not be 100% effective, but should be more or less foolproof. I anyone could think of any further checks that would be great.

In order for this to work it is important to have a "ps" command that will work in the bash shell. I found one in the underground that works well, and should be put in the /var/hack/bin directory (which should be in your path). I have included the ps file in my zip file, but I accessed it from this post (http://www.tivocommunity.com/tivo-vb/showthread.php?postid=1626438#post1626438). Make sure you ftp it in binary mode.

I have also bundled a new tivoweb itcl file to turn on / off end padding - you will have to set your values within the file before / after ftp'ing in this version ... prehaps somebody else would like to put together a control panel for tivoweb.

There are a couple of new graphics (animated gifs) for the endpad status report. There are also new variables in the cfg file that allow it to be turned on or off, and configure the "endpad.pid" and "ps" paths.

My current version is 0.3.jazz.0.6 - see posts below......

keep up the good work,

cheers

Chris

sanderton
01-21-2004, 01:23 PM
A better check on Endpad running would be to check the last modified date of /var/log/endpad.log - it should be within the last minute.

tivo-onion
01-21-2004, 01:27 PM
Do you have any idea how I would pull that date out? Any snippets of code that could grab that date and compare it to the current date? Since we do not seem to have an "ls" or "dir" command at the bash prompt, it could be quite tricky! Any ideas?

cheers

Chris

pahunt
01-21-2004, 01:31 PM
You can get ls and load of other useful commands by downloading tbin.tar.gz from http://tivo.stevejenkins.com/downloads/

sanderton
01-21-2004, 03:27 PM
file stat /var/log/endpad.log filestats
if {$filestats(mtime) < [expr [clock seconds] - 120]} {
puts "EndPad has crashed!"
}


should do it. Untested!

tivo-onion
01-22-2004, 05:12 AM
Thanks sanderton & pahunt for your input!

I had a crack before your post arrived sanderton, so I did it a slightly different (and long-winded way) which is a bit of hack but seems to work well. Prehaps if you could take a look and let me know if you think it will last the test of time......would much appreciate it.

I include a new zip for version 0.3.jazz.0.6 - i.e. still a customisation of sandertons base v0.3.

You will need to binary transfer the "ls" command to your /var/hack/bin directory, as the module uses this to capture the current timestamp of the endpad.log file. The endpad.log file should have its timestamp refreshed every minute, so this timestamp is tested to validate the currency of the log file, and therefore identify if endpad is still "up".

There are three checks it makes now, the first is the existance of a endpad.pid file, the second is the existance of a process with the specified pid, and the third is the currency of the log file! This should be foolproof..... ;-)

There are a couple of extra variables in the cfg file to specify location of the ls command and endpad.log files.

Clicking on the "heart" will take you to the end pad control page on tivoweb if installed

FILE HAS BEEN REMOVED - UPDATED VERSION IS 0.3.jazz.0.7 - SEE POSTS BELOW FOR THE LINK TO THIS FILE

enjoy, and let me know if you have any issues,

cheers

Chris

Prof. Yaffle
01-22-2004, 06:15 AM
Chris, is it possible to add the space used bit from LJ's plain text version? I found it handy to have that on the email as a quick reference and that's the one bit I'm missing on the excellent jazzy version.

tivo-onion
01-22-2004, 08:53 AM
I'll have a crack at it tonight Prof. ! What about the "new mail" section in LJ's module - was that usefuly to you?

Prof. Yaffle
01-22-2004, 09:02 AM
Thanks, you're a star ;) The new mail section might be useful but to be honest I've not had a new mail for a while because I've only got Freeview so they're few and far between.

ddub
01-22-2004, 11:50 AM
Seems good so far.

Ive never really used S.M.A.R.T., so installed smartctl in /var/hack/bin 755'd it.

I get this message in the dailymail....

WARNING! S.M.A.R.T. errors detected!
TiVo drive A (/dev/hda):

smartctl version 5.1-9 Copyright (C) 2002-3 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Device Model: QUANTUM FIREBALLlct20 40
Serial Number: 354027822091
Firmware Version: APL.0800
ATA Version is: 5
ATA Standard is: ATA/ATAPI-5 T13 1321D revision 1
Local Time is: Thu Jan 22 16:39:30 2004 localtime
SMART support is: Available - device has SMART capability.
SMART support is: Disabled

SMART Disabled. Use option -s with argument 'on' to enable it.



- where do I 'use option -s' as mentioned above?

- ddub:confused:

sanderton
01-22-2004, 11:54 AM
My guess - with smartctl?

ddub
01-22-2004, 12:08 PM
Doh... hmm been on night shift... still asleep !

started S.M.A.R.T with (and included in startup script)

/var/hack/bin/smartctl -s on /dev/hda

cheers 4 quick reply
ddub

tivo-onion
01-22-2004, 04:11 PM
Originally posted by Prof. Yaffle
Thanks, you're a star ;) The new mail section might be useful but to be honest I've not had a new mail for a while because I've only got Freeview so they're few and far between.

OK - here it is......

The % usage should appear with the SMART info, if you use it, otherwise it will appear by itself in next to the disk graphic etc.

If you have new mail, a new mail row will appear, that will allow you to launch the relevant page in tivoweb to view the mail(s).

There is a new graphic for the "new mail" item in the zip file. There are changes to the mail dailymail_jazz.tcl and dailymail.cfg files, with some extra variables to control the new mail preferences. I have also restructured the .cfg file to make it easier to read.

VERSION UPDATED - SEE LATER POSTS......

This is alpha and probably buggy, so let me know if there are any problems,

enjoy,

cheers

Chris

Prof. Yaffle
01-22-2004, 05:17 PM
Thanks Chris, just tried it and it looks superb to me.

derekbuck
01-24-2004, 02:41 AM
I'm getting the same errors as AdyJ:

/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: setpri: command not found
/var/hack/dailymail.tcl: catch: command not found
/var/hack/dailymail.tcl: proc: command not found
/var/hack/dailymail.tcl: return: bad non-numeric arg `[string'

Unzipped on Windows, BIN ftpd to tivo, chmod'd then edited using joe.

Can anyone see anything wrong with this process?

First line is #!/tvbin/tivosh

Del.

AdyJ
01-24-2004, 08:01 AM
Originally posted by derekbuck
I'm getting the same errors as AdyJ:

/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: global: command not found
/var/hack/dailymail.tcl: setpri: command not found
/var/hack/dailymail.tcl: catch: command not found
/var/hack/dailymail.tcl: proc: command not found
/var/hack/dailymail.tcl: return: bad non-numeric arg `[string'

Unzipped on Windows, BIN ftpd to tivo, chmod'd then edited using joe.

Can anyone see anything wrong with this process?

First line is #!/tvbin/tivosh

Del.

Del

I can't tell you what's wrong, but at least I can tell you of my work-around. Don't use Joe.
I know that seems a bit harsh, but no matter how I download joe and install it onto the Tivo - getting the latest version, using only Linux machines - joe causes this problem for me.
I added a single space to the dailymail file with joe, tried it (it didn't work), ftp'ed the broken file back to a linux box and diff'ed with the original - and the only difference between the two files was the space I had added. :confused: :confused:
I resorted to editing it on the Linux box, then ftping it to the Tivo... and got so bored with ftp that I've installed rsync. And cron. And I got the wap pages onto TivoWeb so I can record from my mobile. But still no luck with joe.
If you haven't got a linux box, try using a windows text editor that preserves unix line endings (I've used textpad in the past).
Hopefully someone else will be able to point out what I've/We've done wrong (with me its normally something stooopid) but I hope the above helps.

AdyJ
01-24-2004, 08:02 AM
BTW - the space was added to one of the comment lines, not the hash-bash-bin-bash line...;)

derekbuck
01-24-2004, 09:06 AM
Thanks Ady,

Edited in Wordpad (is this ok?) Now I get ": No such file or directory

Sorry if I'm making silly mistakes.

Del.

Milhouse
01-24-2004, 09:12 AM
Did you FTP it to your TiVo in binary or text mode? It look like the file now has DOS line terminations which TiVo/TCL doesn't seem to like. I'd suggest downloading TextPad (http://www.textpad.com/) and save the file in UNIX format, then binary FTP it your TiVo.

derekbuck
01-24-2004, 09:42 AM
I did FTP in Binary mode but looks like I needed textpad...have done it now and have the "network is unreachable" error...

Where do you set the def gateway? Is it in /etc/rc.d/rc.net? If so what is the change I need to make?

Many thanks,

Del.

Fozzie
01-25-2004, 07:16 AM
Finally got around this morning to setting this all up. What can I say - fantastic :) Great work sanderton, tivo-onion, Milhouse and everyone else involved!

Fozzie
01-25-2004, 05:37 PM
tivo-onion - just noticed that the log file doesn't get written to if generating a dailymail from tivoweb. Any chance you can modify the .itcl so it writes to the log file, in the same way that running from the crontab does (i.e. overwrites the log file each time it is written to)?

Many thanks.

tivo-onion
01-25-2004, 05:56 PM
Originally posted by Fozzie
tivo-onion - just noticed that the log file doesn't get written to if generating a dailymail from tivoweb. Any chance you can modify the .itcl so it writes to the log file, in the same way that running from the crontab does (i.e. overwrites the log file each time it is written to)?

Many thanks.

FILE REMOVED - SEE LATER POSTS FOR UPDATED VERSIONS

Here you go:

cheers

Chris

tivo-onion
01-25-2004, 06:23 PM
Hi,

I have had another little play with this baby and created version 0.3.jazz.0.8.

FILE REMOVED - SEE LATER POSTS FOR UPDATED VERSION

Additional functionality includes:

- a graphical view of the space remaining with extra hover over info with percentages and gig measures.
- a monitor for "no red dot" - if you run it - indicates whether it is an active process.
- a new .itcl to start the "no red dot" process from tivoweb - if you run it.
- a general tidy up and smarten up of clickable links and hover-over information.
- logging of dailymail creation when executed from tivoweb .itcl file (suggested by Fozzie - thanks for that)

I have tested most scenarios, but I am sure there are a few bugs in there! Let me know if you encounter them if and I will try to fix. I make no excuses for the quality of the code - I am ashamed of some of the work arounds I have made - what can I say - it's a hack!

There are some extra graphics and some extra configuration variables in the .cfg file. Also the new .itcl files.

enjoy,

cheers

Chris

Nihilator
01-26-2004, 01:06 PM
Hep me!

I have dailymail_jazz (the most recent version ... v0.3.jazz.0.8) running successfully on one of my TiVos, and now I'm trying to put it on a second one. They're both Philips SAs, and they're both running smartctl, autospace and endpad. And, of course, TiVoWeb 1.9.4. I just replaced the b4 version with the non-beta version.

I haven't tried to make it a cron job on the second Philips yet, because I still can't get it to run from the command line without crashing and rebooting the TiVo. The last time I ran it, I had it dump to a crash.log, which shows the following:

Creating heading..
Calculating uptime & reboot status...
Checking phone & daily call status...
Checking S.M.A.R.T. status...
Drive A:
smartctl version 5.1-9 Copyright (C) 2002-3 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Device Model: WDC WD600AB-00BVA0
Serial Number: WD-WMA7E1020288
Firmware Version: 21.01H21
ATA Version is: 5
ATA Standard is: Unrecognized. Minor revision code: 0x00
Local Time is: Mon Jan 26 17:20:04 2004 localtime
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Off-line data collection status: (0x84) Offline data collection activity was
suspended by an interrupting command from host.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete off-line
data collection: (3168) seconds.
Offline data collection
capabilities: (0x3b) SMART execute Offline immediate.
Automatic timer ON/OFF support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 56) minutes.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000b 200 192 051 Old_age - 0
3 Spin_Up_Time 0x0007 125 100 021 Old_age - 2800
4 Start_Stop_Count 0x0032 100 100 040 Old_age - 348
5 Reallocated_Sector_Ct 0x0032 155 155 112 Old_age - 177
7 Seek_Error_Rate 0x000b 200 200 051 Old_age - 0
9 Power_On_Hours 0x0032 076 076 000 Old_age - 17996
10 Spin_Retry_Count 0x0013 100 100 051 Old_age - 0
11 Calibration_Retry_Count 0x0013 100 100 051 Old_age - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age - 240
196 Reallocated_Event_Count 0x0032 161 161 000 Old_age - 39
197 Current_Pending_Sector 0x0012 200 192 000 Old_age - 0
198 Offline_Uncorrectable 0x0012 200 192 000 Old_age - 0
199 UDMA_CRC_Error_Count 0x000a 200 253 000 Old_age - 1
200 Multi_Zone_Error_Rate 0x0009 200 196 051 Old_age - 7

************************************************************ ********************
Drive B:
smartctl version 5.1-9 Copyright (C) 2002-3 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Device Model: WDC WD800JB-00CRA1
Serial Number: WD-WMA8E3491913
Firmware Version: 17.07W17
ATA Version is: 5
ATA Standard is: Unrecognized. Minor revision code: 0x00
Local Time is: Mon Jan 26 17:20:06 2004 localtime
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Off-line data collection status: (0x82) Offline data collection activity
completed without error.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete off-line
data collection: (3120) seconds.
Offline data collection
capabilities: (0x3b) SMART execute Offline immediate.
Automatic timer ON/OFF support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 58) minutes.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000b 200 200 051 Old_age - 0
3 Spin_Up_Time 0x0007 128 096 021 Old_age - 2658
4 Start_Stop_Count 0x0032 100 100 040 Old_age - 220
5 Reallocated_Sector_Ct 0x0033 200 200 140 Old_age - 0
7 Seek_Error_Rate 0x000b 200 200 051 Old_age - 0
9 Power_On_Hours 0x0032 086 086 000 Old_age - 10740
10 Spin_Retry_Count 0x0013 100 100 051 Old_age - 0
11 Calibration_Retry_Count 0x0013 100 100 051 Old_age - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age - 112
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age - 0
197 Current_Pending_Sector 0x0012 200 200 000 Old_age - 0
198 Offline_Uncorrectable 0x0012 200 200 000 Old_age - 0
199 UDMA_CRC_Error_Count 0x000a 200 253 000 Old_age - 0
200 Multi_Zone_Error_Rate 0x0009 200 200 051 Old_age - 0

************************************************************ ********************
Calculating disk usage...
Building usage diagram...
Checking endpad process currency...
Checking for new messages in tivo central...
Compiling to do list...
Compiling expiration list...
Compiling conflicts list...
Got reply: 220 comcast.net - Maillennium ESMTP/MULTIBOX rwcrmhc13 #88
Connected
Got reply: 250 comcast.net
HELO acknowledged
Got reply: 250 ok
From acknowledged
Got reply: 250 ok; forward to <cspanglr@comcast.net>
To acknowledged
Got reply: 354 ok
Sending message...
Building Header...
Building Content....
html starts..
body starts..

At that point, it falls apart. A few more lines are written in my telnet window, but they don't show up in the log. Here's what I see:
Dumping mempool to /tmp/BlockFailure.180

To view the blocks, run:
<snip obscure instructions about running poolview.tcl>

Common causes for leaks:
- Circular refs. Redefine ownership without circular dependency
- Explicit Malloc or GetChunk without Free or ReturnChunk
- Use of non-TmkCore objects, without using delete operator (TmkLock for example)

Tmk Assertion Failure:
BlockFailure, line 2073 ()
Tmk Fatal Error: Thread tivosh <180> died due to signal -2


The kernel log doesn't show anything immediately preceding the reboot. /var/log/tverr, however, does show this:

Jan 26 17:37:43 (none) TmkAssertionFailure[180]: (BlockFailure, line 2073 ())
Jan 26 17:37:43 (none) tivosh[180]: Tmk Fatal Error: Thread tivosh <180> died due to signal -2
Jan 26 17:37:43 (none) tivosh[180]: Tmk Thread Backtrace: 1aa90ac 1aa79c8 1aa2290 1cda374 1ce64ec 1d37004
1d53f1c 1d53c08 1d4b9cc 1d363d8 1d5b184 1d48968 1d363d8 1d53470 1d5457c 1ce648c 1ce61d4 1800134
Jan 26 17:37:43 (none) tivosh[180]: Tmk Fatal Error: Thread died due to signal -2
Jan 26 17:37:43 (none) tivosh[180]: Invoking rule 834: rebooting system


I'm sure that I'm forgetting to give some vital piece of information...just let me know what it is.

Thanks in advance, everyone, and I apologize for the length of the post.

--Chris

mognuts
01-26-2004, 01:36 PM
I get something very similar ...

Got reply: 354 Ok Send data ending with <CRLF>.<CRLF>
Sending message...
Building Header...
Building Content....
html starts..
body starts..
Dumping mempool to /tmp/BlockFailure.8966
Tmk Assertion Failure:
BlockFailure, line 1771 ()
Tmk Fatal Error: Thread tivosh <8966> died due to signal -2
1a344ec 1a32a44 1a2ed70 1b95e0c 1c4d5e8 1c85868 1c85158 1c7aee0 1c61a10 1c8e4e0
1c77e7c 1c61a10 1c849c0 1c85ec8 1c4d248 1c28cac 1800134

tivo-onion
01-26-2004, 02:01 PM
I have a copy of dailymail_tcl.jazz with some extra debugging in it when the body is generated. Please run this outputting to a log file and then send back to me. There may be a lot of stuff that comes out as it outputs all the html generates, but this will help me work out what is wrong and where it is falling over. You will need to take the ".txt" off the attached file and FTP binary down to your /var/hack/ directory.

use :

/var/hack/dailymail_jazz.tcl > /var/log/dailymail 2>&1

to get a log file.......after chmod 755'ing it.

if you can get them back to me (put in a text file in a post back) then I will have a look tonite and see what I can do,

SEE THE NEXT POST FOR THE FILE.....

cheers

Chris

tivo-onion
01-26-2004, 02:05 PM
The file.....

FILE REMOVED ... SEE LATER POSTS...

mognuts
01-26-2004, 02:33 PM
Here's the log file. I've replaced some sensitive data with hash symbols for security reasons, but apart from that it's exactly as it was generated.

Mognuts

mognuts
01-26-2004, 02:35 PM
Here it is ...

ddub
01-26-2004, 02:38 PM
Hi,

Thanks for the updated version. v0.3.jazz.0.8

Got it working on UK tivo no problems at all. Just a couple of questions...

What's the legend for the space used graph colours?

GREEN
YELLOW
RED
WHITE

- What is the light bulb graphic for? Ive uploaded it to server, but its not used anywhere in the email.

- Is it possible to separate the suggested recordings from the Planned (requested) recordings in the to-do list?

thanks,
Darren

Prof. Yaffle
01-26-2004, 03:15 PM
I might be wrong but I think the light bulb is flashing if the Sky Red Dot killer is running and off if it's not (but only if you've got the check enabled in dailymail.cfg).

Nihilator
01-26-2004, 04:24 PM
The first time, it actually crashed without rebooting the machine, and the log file indicated:
retrying after errTmActiveLockConflict ...
no such object: {CONFLICT err=errTmActiveLockConflict}
while executing
"dbobj $program gettarget Series"

but that wasn't the same as the problem I spoke of earlier. The log file for that one is attached, scrubbed of my.ip.add.ress: port information.

It looks like it crashed as it's nearing the end of creating the status bar. Is it supposed to "build" this bar by placing 200 single-width colored gifs one next to the other?

By the way, just for giggles I put the same verison of dailymail_jazz.tcl in the one that works, and it still works just fine.

Thanks for looking at it.

--Chris

tivo-onion
01-26-2004, 04:48 PM
Originally posted by ddub
Hi,

Thanks for the updated version. v0.3.jazz.0.8

Got it working on UK tivo no problems at all. Just a couple of questions...

What's the legend for the space used graph colours?

GREEN
YELLOW
RED
WHITE

- What is the light bulb graphic for? Ive uploaded it to server, but its not used anywhere in the email.

- Is it possible to separate the suggested recordings from the Planned (requested) recordings in the to-do list?

thanks,
Darren

Yes, the lightbulb is for the "no red dot" process monitoring, you can turn it on and off in the .cfg file.

The space bar goes from Green (low) to Yellow (warning) to Red (almost full / full). You can edit the graphics to other colours if you want - just a basic "full-ness" guage - nothing too complex.

The code does not allow you to seperate suggestions from requested recordings at present. I may look at it at some point but cannot promise anything.

cheers

Chris

tivo-onion
01-26-2004, 04:57 PM
Originally posted by Nihilator
The first time, it actually crashed without rebooting the machine, and the log file indicated:
retrying after errTmActiveLockConflict ...
no such object: {CONFLICT err=errTmActiveLockConflict}
while executing
"dbobj $program gettarget Series"

but that wasn't the same as the problem I spoke of earlier.
I have not hit this problem before ... are you using a modified version of util.itcl or prehaps tivowebplus? The module usually just continues trying until there is no lock conflict....

Stuart (sanderton) ... could you help on this one?

Originally posted by Nihilator
It looks like it crashed as it's nearing the end of creating the status bar. Is it supposed to "build" this bar by placing 200 single-width colored gifs one next to the other?
Actually, since the majority of gifs are the same, there is only ever a maximum of 6 gifs as the email client or browser will cache them. There will be no problem with this

cheers

Chris

Nihilator
01-26-2004, 05:17 PM
Originally posted by tivo-onion
I have not hit this problem before ... are you using a modified version of util.itcl or prehaps tivowebplus? The module usually just continues trying until there is no lock conflict....
Um, nope. Not that I'm aware of, at least. The TiVoWeb package that I'm using was downloaded just yesterday, and it's the 1.9.4 version (no beta). I *did* need to download it because the version I was using did not include get_space, and it's required for your dailymail_jazz.tcl.

Actually, since the majority of gifs are the same, there is only ever a maximum of 6 gifs as the email client or browser will cache them. There will be no problem with this.
It's not really the gifs that I was really talking about...there are two hundred snippets of code in there that are basically just repeats of the same snippet, which adds a half-percent to the length of the status bar. I was wondering if that was the way it was designed, or if it was actually supposed to append, say, a single 75% wide green gif, then a 15% wide amber gif, etc.

Awesome version of the Stuart's utility, by the way. It looks great in Outlook.

--Chris

tivo-onion
01-26-2004, 05:26 PM
Hmmmm!

I think this one is outside of my sphere of knowledge. The error information is :

Mognuts :::

Tmk Assertion Failure:
BlockFailure, line 1771 ()
Tmk Fatal Error: Thread tivosh <241> died due to signal -2
1a344ec 1a32a44 1a2ed70 1b95e0c 1c4d5e8 1c891d0 1c89170 1c834ec 1c77e7c 1c61a10 1c8e4e0 1c77e7c 1c61a10 1c849c0 1c85ec8 1c4d248 1c28cac 1800134

Nihilator :::

Tmk Assertion Failure:
BlockFailure, line 2073 ()
Tmk Fatal Error: Thread tivosh <179> died due to signal -2
1aa90ac 1aa79c8 1aa2290 1cda374 1ce64ec 1d37004 1d5b63c 1d3b7a4 1d48968 1d363d8 1d5b184 1d48968 1d363d8 1d5b184 1d48968 1d363d8 1d53470 1d5457c 1ce648c 1ce61d4 1800134

Both happen at the same place i.e. when the module is dumping out the contents of the $message variable to the mailserver chunk be chunk - but both are after a different quantity of text and both have different memory block dump numbers.

It could be a memory pool error, but to honest I am a bit puzzelled here. Prehaps Stuart (sanderton) could help as he wrote this bit, but obviously with less of a volume of data in mind!

You know, I ran my module this afternoon a couple of time and it was fine .... I have just run it now and it errors with the same problem as you guys. What has changed since this afternoon??? A software upgrade?

HELP......

cojonesdetoro
01-26-2004, 06:45 PM
Hi,

I wrote a stripped down mail sender that will send a text file as the body of the message. Some non-tcl programers who find editing dailymail.tcl to suite their needs a daunting task may find this useful. It is, of course, just the important bits of dailymail stripped out. So the smartctl feature could have been added with:

smartctl -H -i /dev/hda >> message.out
df -vh >> message.out
mailfile.tcl message.out "Here's the file" joe@blow.com

My real hope is that we can take the various parts of dailymail.tcl and make them into seperate modules. You can then take the bits that you like and leave the others out like this:

#!/bin/sh
(
echo "-----[ conflicts ]--------------"
showconflicts.tcl
echo "-----[ FS Usage ]-------------"
df -vh
echo "----[ Other Messages ]--------"
if tivorebootedlast24hours.tcl
then
echo "Alert! tivo has recently rebooted"
fi
) > message.out
mailfile.tcl message.out "Tivo Messages for $( date )" joe@blow.com

I posted this in that other site and thought I'd post here too

regards.

tivo-onion
01-26-2004, 07:07 PM
Originally posted by tivo-onion
I think this one is outside of my sphere of knowledge. The error information is :


Figured it out....

It is a size thing, so my strategy for creating the graphic (200 x image references) blew the memory permitted to store the email content. I do not know how to expand the memory pool allocated, so I re-evaluated my strategy where the graphic is concerned and now just use a maximum of 6 image references rather than 200.

This should not be a problem any more, but it is an interesting warning - if you have a lot of entries in the to-do, expiry and conflicts list it could blow the memory again - unlikely but possible!

Does anyone have any idea what this maximum size would be, so I can put a safeguard in the module? Also, does anyone have any idea how I could increase the allocated memory pool for this module?

The updated module has some changes in the .cfg file, providing variables for the graphics used and the thresholds between low-medium-high for the space available used graph! The graphics have also changed - you will need to replace them. Obviously the dailymail_jazz.tcl has also changed.

MODULE UPDATED - SEE LATER POST (http://www.tivocommunity.com/tivo-vb/showthread.php?postid=1698748#post1698748) FOR UPDATE VERSION....

Sorry for any incovenience - it is a learning curve for me :-)

cheers

Chris

mognuts
01-26-2004, 10:21 PM
Originally posted by tivo-onion
Sorry for any incovenience - it is a learning curve for me :-)No worries, its a great hack!

I can confirm that this latest version (0.9) works on my machine.

Thanks for all your hard work Mr Onion.

Mognuts

Nihilator
01-26-2004, 11:26 PM
I can't try it myself, yet, because I've really screwed up my TiVoWeb with the non-beta version, and I want to work that out first. Will probably give it a run tomorrow.

--Chris

sanderton
01-27-2004, 04:33 AM
If the reference is to "mempool" I think these are the inter-process communications system which TiVo TCL uses. You can allocate a larger one on the script start, but I'm not clear why it would be used at all if you are not explicitly using it?

mognuts
01-27-2004, 05:50 AM
I've just discovered a minor problem with the red dot blast indicator.

If you try to start startrd from rc.sysinit.author (which doesnt't work) the red dot blast indicator says 'red dot blast is active', even though it isn't.

Not a major problem - just starting it manually from telnet is the answer -but I thought I would mention it.

tivo-onion
01-27-2004, 12:07 PM
Originally posted by mognuts
I've just discovered a minor problem with the red dot blast indicator.

If you try to start startrd from rc.sysinit.author (which doesnt't work) the red dot blast indicator says 'red dot blast is active', even though it isn't.

Not a major problem - just starting it manually from telnet is the answer -but I thought I would mention it.

Yep, the only way at the moment to see if the "no red dot" blaster is active is to check for the process existance in "ps ax" output. My next project is to hack the no red blaster to have a log etc. like endpad, and then it should be able to identify whether or not it is actually running with better accuracy.

It is a known bug that the "no red dot" modules do not run if you start from rc.sysinit.author. I would remove that entry if I were you and start it manually using the tivoweb .itcl file bundles with the dailymail_jazz zip file,

cheers

Chris

Nihilator
01-27-2004, 01:48 PM
tivo-onion:
Well, to the best of my knowledge, I've got everything up and running again, on all three machines. I freshly re-installed the non-beta version of TiVoWeb 1.9.4, overwriting the ui.itcl files (which I didn't know to do from the TiVoWeb readme!) and adding senddailymail.itcl and controlpadding.itcl. I've also got cron running (for dailymail_jazz.tcl), as well as endpad.tcl and autospace.tcl. And on top of that, I've also finally gotten around to configuring each TiVoWeb for access through the router (odd port, plus username/password).

Dailymail_jazz 0.9 seems to work just fine from the command line. I'll post again in a couple of days after its had the opportunity to be cron'd a few times (8:10, 8:15, and 8:20 each morning...I spread the three machines apart by 5 minutes each so the smtp server doesn't get three outgoing mails simultaneously.)

Thanks again for a great makeover for an already great utility!

--Chris

MonTheFish
01-27-2004, 03:24 PM
any chance of a read me on this...I've just downloaded the current version dailymail_jazz v0.3.jazz.0.9.zip and I have no idea where the 21 files go :o

Nihilator
01-27-2004, 03:58 PM
Originally posted by MonTheFish
any chance of a read me on this...I've just downloaded the current version dailymail_jazz v0.3.jazz.0.9.zip and I have no idea where the 21 files go :o

Dailymail_jazz.tcl and dailymail.cfg go in /var/hack. Don't forget to chmod 755 dailymail_jazz.tcl.

The three .itcl files go in the modules directory of TiVoWeb. If you did a standard installation, that would be /var/hack/tivoweb-tcl/modules.

ls and ps go in /var/hack/bin. chmod 755 them, too.

The whole TivoDailyMail folder goes in the external http server of your choice. I guess some people could set it up so that the TiVo could serve the graphics, too, but I'm okay with just sticking it in the graphics directory of a domain that I've got hosted elsewhere. It just needs to be somewhere where your mail program can access it any time you want to view your Dailymail.

--Chris

MonTheFish
01-27-2004, 05:01 PM
cheers for that

AdyJ
01-27-2004, 05:26 PM
Can anyone explain how to serve the graphics from TivoWeb please?

Milhouse
01-27-2004, 06:06 PM
It would appear that if you put the images in /var/hack/tivoweb-tcl/images then the external URL to access the images will be:

With "tivo" prefix: http://<ip address>/tivo/img/<imagename>
Without prefix: http://<ip address>/img/<imagename>

e.g. http://217.155.xxx.xxx/tivo/img/boot.jpg

This method works for me and I'm using a reverse proxied TiVo behind a Linux/Apache server. It should work similarly for a port-forwarded connection direct to the TiVo.

mognuts
01-28-2004, 08:19 AM
Originally posted by tivo-onion
I would remove that entry if I were you and start it manually using the tivoweb .itcl file bundles with the dailymail_jazz zip file. I tried this and it doesn't appear to work (even though the daily mail report says that it's active). Can somebody else confirm this? The only way I can get red dot blast to work is from the bash prompt under telnet.

DJBlack
01-30-2004, 02:56 PM
Chaps

Sorry for being thick here...

I have changed my tivoweb listening port and need to use tivo as my webserver for the graphics...

Assuming I put the images in /var/hack/tivoweb-tcl/images, how in the URL do I specifiy the port?

http://<ip address>/tivo/img/<imagename>

Any thoughts much appreciated!

One last idea... given the now 21 page thread length, has anyone writted an FAQ for all the bits? Also, one place to find all the bits would be good too!!

Sorry if this apprears lazy - I just dont get time to visit daily and keep up to speed.

Thanks chaps

David

ccwf
01-30-2004, 03:02 PM
Originally posted by DJBlack
I have changed my tivoweb listening port and need to use tivo as my webserver for the graphics...

Assuming I put the images in /var/hack/tivoweb-tcl/images, how in the URL do I specifiy the port?

http://<ip address>/tivo/img/<imagename> More generally, it's http(s)://username:password@hostname:port/tivo/img/….

MikeMcr
01-30-2004, 04:28 PM
Originally posted by ccwf
More generally, it's http(s)://username:password@hostname:port/tivo/img/…. You can forget about the username/password syntax if you are using Microsoft Internet Explorer:

http://news.netcraft.com/archives/2004/01/28/microsoft_to_remove_support_for_usernames_in_http_urls.html

Michael

DJBlack
01-30-2004, 05:08 PM
Thanks People... I will give it a go.....

Interesting to see the @ is being removed....

D

LJ
02-01-2004, 08:54 AM
Originally posted by tivo-onion
Yep, the only way at the moment to see if the "no red dot" blaster is active is to check for the process existance in "ps ax" output. My next project is to hack the no red blaster to have a log etc. like endpad, and then it should be able to identify whether or not it is actually running with better accuracy.

Yup, ps is the only way to reliably tell if noreddot is running. It creates /tmp/blastir when it's sending the backup key, but there's nothing around to check when it's not blasting.

Not sure I agree with the logic for having a log file for reddot - ps shows you what's running as you run ps, a log file is only as up to date as the last time it was updated. A 'ps | grep noreddot' once a day when dailymail runs will take less CPU time than to update a status log every few minutes.

thepatrician
02-01-2004, 09:21 AM
tivo-onion - I just noticed that in todays dailymail_jazz it was telling me that endpad wasn't running.

I checked and everything looked okay on the endpad front (the logfile was being updated every minute) so I did a bit of digging in the dailymail_jazz script. When the script is checking the date/time the log file was changed it looks like the date/time returned by 'ls' doesn't have a leading zero if the day is < 10 and thus the comparison with the times generated by dailymail would always fail as they do have a leading zero.

To fix this, I changed the %d to %e on the lines where the variables twominbefore, oneminbefore, now, and oneminafter are set (lines 1558 to 1561) in the endpad checking section to suppress the leading zero for the day no.

Cheers to yourself, sanderton and everyone else involved for a great hack by the way,
thepatrician.

Prof. Yaffle
02-01-2004, 10:23 AM
Originally posted by thepatrician
tivo-onion - I just noticed that in todays dailymail_jazz it was telling me that endpad wasn't running.


Had exactly the same problem myself today. I'll try those alterations myself when I get chance.

alextegg
02-01-2004, 10:23 AM
Checking my Tivo from Pocket PC over GPRS whilst skiing :D :cool: I get the same dailyMail report that endpad isn't running but the logs are visible in Tivoweb :eek:
HTH

Alex

tivo-onion
02-01-2004, 11:41 AM
Originally posted by alextegg
Checking my Tivo from Pocket PC over GPRS whilst skiing :D :cool: I get the same dailyMail report that endpad isn't running but the logs are visible in Tivoweb :eek:
HTH

Alex

No worries, I will get a fix out soon! I had the problem myself but was ignorant about the %d -> %e problem. I have now switched and am testing.

There are a number of new functions in my current version, so I will release in next day or two after some testing,

cheers

Chris

tivo-onion
02-01-2004, 01:03 PM
Here we go:

I have a new augmented and bug fixed version of dailymail_jazz. New features include:

- bug fix of the endpad running function - which started saying that it was not running on 1st Feb.
- Display of thumb graphics next to "to-do" items.
- Clickable link from thumb graphics to lj's update thumbs tivoweb script
- highlighting of those "to-do" items that will most likely not record due to endpad padding functionality / criteria.
- display of "unlikely to record" grapic next to those items that will most likely not record due to endpad - including reason information.
- attach links so that an email can be-resent with a longer hours ahead period - so you can check a longer period ahead if you are vacationing etc - up to 168 hour (1 week).
- added link from conflicts to lj's version of tivoweb "series" module with slotfree functionality.
- added link to sanderton's tivoweb re-order passes module.


The following files have been updated and included with all other in the zip files available:

- dailymail_jazz.tcl - many many changes
- dailymail.cfg - new and updated variables.
- senddailymail.itcl - minor changes - but must have to create dailymail from emial / tivoweb.

There are new graphics also.


Files should be placed into the following locations:

/var/hack
- dailymail_jazz.tcl
- dailymail.cfg

/var/hack/bin
- ps
- ls

/var/hack/tivoweb-tcl/modules
- senddailymail.itcl
- noreddotcontrol.itcl
- controlpadding.itcl

your images directory available on your webserver/tivodailymail
- all images


make sure everything is FTP'ed binary and then chmod'ed 755. You will also need to do a quick reload in tivoweb to register the .itcl modules.


You can find the "partner" tivoweb modules that add the extra functionality to the email from the following locations if you don't already know / have them installed:

endpad
- sanderton module - http://www.beaconhill.plus.com/TiVo/tivohacks.htm
noreddot
- lj module - http://www.ljay.org.uk/tivoweb/
slotfree / conflict
- lj module - http://www.ljay.org.uk/tivoweb/
re-order season passes
- sanderton module - http://www.beaconhill.plus.com/TiVo/tivohacks.htm
smartctl
- http://www.tivocommunity.com/tivo-vb/showthread.php?postid=1675350#post1675350


I have hacked pieces from many other people modules - probably too many to mention here - so apologies if you see your code.

Let me know if there any bugs,

FILE LINK REMOVED - SEE LATER POST FOR VERSION 0.21

cheers

Chris

Prof. Yaffle
02-01-2004, 03:54 PM
Chris, is there anything I need to do for the hours ahead link at the bottom of the mail to work? If I click it at present I get 36 hours ahead no matter what. I've replaced all the files with the newest versions.

tivo-onion
02-01-2004, 04:23 PM
Originally posted by Prof. Yaffle
Chris, is there anything I need to do for the hours ahead link at the bottom of the mail to work? If I click it at present I get 36 hours ahead no matter what. I've replaced all the files with the newest versions.

Prof.....it sounds like you did not do a reload of modules in tivoweb. Try that, also do a command line invocation of dailymail_jazz with a parameter and see if that works:

/var/hack/dailymail_jazz.tcl 72

if that does not work, take a look at your dailymail.log in /var/log and look at the first couple of lines, after trying a 72 or something big from tivoweb.... You can also try typing straight into the url box - www.yourtivodomain.com/extramail/72 in your browser.

let me know,

cheers

Chris

Prof. Yaffle
02-01-2004, 04:53 PM
Whoops, I feel stupid now :o You're right, I hadn't restarted TiVoweb. Working perfectly now and looking excellent. Thanks Chris.

fysmd
02-02-2004, 05:07 PM
I think I've set everything up OK but I get the following:

bash-2.02# ./dailymail_jazz.tcl
hours ahead value is now : 36
can't read "::version": no such variable
while executing
"if {$::version >= 3} {
set guideindexdir "/GuideIndexV2"
} else {
set guideindexdir "/GuideIndex"
}"
(file "/var/hack/tivoweb-tcl/modules/index.itcl" line 642)
invoked from within
"source /var/hack/tivoweb-tcl/modules/index.itcl"
(file "./dailymail_jazz.tcl" line 1467)

LJ
02-02-2004, 05:26 PM
can't read "::version": no such variable

I'll take a stab at ...load a later version of TiVoWeb Plus? ;)

tivo-onion
02-02-2004, 06:25 PM
Originally posted by LJ
can't read "::version": no such variable

I'll take a stab at ...load a later version of TiVoWeb Plus? ;)

There should be no need to use TivoWeb Plus for dailymail_jazz! Not seen the version problem before.... ... or ... do you mean fysmd need to load a later version of TivoWeb Plus ... or not at all?

fysmd: have you tried the plain version of dailymail? does that work - if the plain version works then the jazzed version should work....let me know,

cheers

Chris

sanderton
02-02-2004, 06:36 PM
Very early versions of TiVoWeb Plus removed the $version3 variable and replaced it with $version. They very soon made it backwards compatible.

smiffy
02-02-2004, 06:37 PM
Just a couple of questions.....

Do I need PS? I cant ftp into the BIN folder by default?

I can send/receive a HTML email, but if I go for standard I get this error:-

INTERNAL SERVER ERROR
--cut here--
action_plainmail '' ''
can't read "objectid": no such variable
while executing
"string index $objectid 0"
(procedure "::action_plainmail" line 5)
invoked from within
"::action_$action $chan $part $env"
("eval" body line 1)
invoked from within
"eval {::action_$action $chan $part $env}"
--cut here--


I also cant start soft padding - which I was running previously:-

INTERNAL SERVER ERROR
--cut here--
action_startpadding '' ''
EndPad is already running
while executing
"exec $command 2 3 "
(procedure "::action_startpadding" line 11)
invoked from within
"::action_$action $chan $part $env"
("eval" body line 1)
invoked from within
"eval {::action_$action $chan $part $env}"
--cut here--


Any help would be much appreciated!!!

sanderton
02-02-2004, 06:44 PM
Originally posted by smiffy
Just a couple of questions.....
I also cant start soft padding - which I was running previously:-

INTERNAL SERVER ERROR
--cut here--
action_startpadding '' ''
EndPad is already running
while executing
"exec $command 2 3 "
(procedure "::action_startpadding" line 11)
invoked from within
"::action_$action $chan $part $env"
("eval" body line 1)
invoked from within
"eval {::action_$action $chan $part $env}"
--cut here--


The answer is in the question!

smiffy
02-03-2004, 03:08 AM
OK, but the email says thats it's not running!!

I've done a full reset and the new menu item lets me start it so I'll see how it goes.

Another thing I've noticeed is that my Cron job is still generating the original style email. Do I need to change this command line (if so how) or is it just easiest to use the menu options?

tivo-onion
02-03-2004, 03:23 AM
Originally posted by smiffy
OK, but the email says thats it's not running!!

I've done a full reset and the new menu item lets me start it so I'll see how it goes.

Another thing I've noticeed is that my Cron job is still generating the original style email. Do I need to change this command line (if so how) or is it just easiest to use the menu options?

1. check your dailymail.cfg file and make sure that the "endpadexecfilename" variable is set to "endpad.tcl" and not "endpadplus.tcl" ... or make sure that it is set to the name of the endpad program you are using.

2. Change your cron line to something like:

45 5 * * 0-6 /tvbin/tivosh /var/hack/dailymail_jazz.tcl > /var/log/dailymail_jazz.log 2>&1

This one starts runs dailymail_jazz at 5.45am daily.

3. yes you need "ps" and "ls" in your /var/hack/bin file. Alternatively, you could put them in /var/hack and change the settings in the dailymail.cfg file to correspond to the new locations of "ps" and "ls".

4. i find that the best way to edit UNIX files is do it on the PC using textpad (can be found at www.textpad.com), make sure when you save you save in "UNIX" format and then FTP binary to the relevant location on your tivo.

5. The "plain HTML email" option on the tivoweb module uses the original dailymail.tcl module - this is usually available at the top of this tread ... this just gives a couple of different options if required. If you don't want this, then edit the senddailymail.itcl file to remove this option.

6. There are lots of switch on / off options available in the dailymail.cfg file, - have a quick spin through and make sure everything corresponds to your system setup and has the right preferences set!

cheers

Chris

tivo-onion
02-03-2004, 03:31 AM
My fault on the "send plain html email" error - there was a small bug in the senddailymail.itcl file - shows how often i use it. Here is an update that should work just fine.....

Remember to remove the ".txt" from the file before using!

MonTheFish
02-03-2004, 01:56 PM
installed the new version last night and mail was sent fine. When I try and send one now from tivo web I get the following error

INTERNAL SERVER ERROR
--cut here--
action_extramail '' ''
child process exited abnormally
while executing
"exec $preshell $command > $postcommand 2>&1"
(procedure "::action_extramail" line 19)
invoked from within
"::action_$action $chan $part $env"
("eval" body line 1)
invoked from within
"eval {::action_$action $chan $part $env}"
--cut here--


any ideas?

Fozzie
02-03-2004, 02:57 PM
Exactly the same here too. Also the cron job one failed too. From the dailymail log:

Got reply: 220 mta04-svc.ntlworld.com ESMTP server (InterMail vM.4.01.03.37 201-229-121-137-20020806) ready Tue, 3 Feb 2004 18:51:14 +0000
Connected
Got reply: 250 mta04-svc.ntlworld.com
HELO acknowledged
Got reply: 250 Sender <xxxxx@ntlworld.com> Ok
From acknowledged
Got reply: 550 Invalid recipient: <xxxxx@ntlworld>
Connection rejected

Notice the missing '.com' on the end of the invalid recipient line.

tivo-onion
02-03-2004, 03:08 PM
MonTheFish,

it looks like you have not uploaded the new version of senddailymail.itcl to the /var/hack/tivoweb-tcl/modules folders, chmod'ed 755 * or done a reload in tivoweb - use the version of senddailymail.itcl in the post above...

cheers

Chris

dialanothernumb
02-03-2004, 05:25 PM
Is anyone happily running dailymail or the jazzed version with Tivoweb plus?

fysmd
02-03-2004, 06:00 PM
Originally posted by sanderton
Very early versions of TiVoWeb Plus removed the $version3 variable and replaced it with $version. They very soon made it backwards compatible.

Umm, I have RC4 installed - I've even removed the whole tivoweb-tcl directory, reinstalled RC4 and tried again - same error :(

Not tried vanila DailyMai - can't DL it at the moment for some reason??

Fozzie
02-03-2004, 06:37 PM
Originally posted by tivo-onion
MonTheFish,

it looks like you have not uploaded the new version of senddailymail.itcl to the /var/hack/tivoweb-tcl/modules folders, chmod'ed 755 * or done a reload in tivoweb - use the version of senddailymail.itcl in the post above...

cheers

Chris

I'm getting the same error & am running all the right versions.

tivo-onion
02-04-2004, 02:37 AM
Originally posted by Fozzie
I'm getting the same error & am running all the right versions.

have you tried running dailymail_jazz.tcl from the UNIX command prompt.

try:

/var/hack/dailymail_jazz.tcl

also try:

/var/hack/dailymail_jazz.tcl 72

let me know what the responses are....

Also, take a look at the contents of /var/logs/dailymail_jazz.log after you have attempted to run the tivoweb senddailymail module and tell me / attach the contents.

What version of tivoweb are you running?

If you can pm me a copy of the senddailymail.itcl file you are using I will inspect that also...

cheers

Chris

MonTheFish
02-04-2004, 07:30 AM
email worked for me after 5 goes of trying to run it from tivi web...who knows

Fozzie
02-05-2004, 05:10 PM
ok, fixed my probs. Did a full (instead of quick) reload of TivoWeb modules and put the right email address in dailymail.cfg! All been working fine for 2 days now.

alextegg
02-06-2004, 05:21 AM
Got the jazzed version working fine now, it's cool :D

tivo-onion - a previous version of this had the programme titles and episode titles as links directly into tivoweb which I liked, any chance? ;-)

Also, I use orenosp with two forwarded ports both secured on high port numbers via SSL certificate etc but don't have an unsecured web server anywhere to put the pictures on, so currently use dailymail w/o the images. Anyone any suggestions for free picture hosting sites I could use, or better still, anyone able to point me somewhere where they are already hosting the pics that those of us without the facilities could use ? ;)

TIA

Alex

sanderton
02-06-2004, 05:34 AM
You should be able to host the images on the TiVo itself - TivoWeb can serve graphics.

alextegg
02-06-2004, 05:47 AM
Yes, but my Tivoweb is accessed via certificate and username/password authentication over SSL.

How do you do configure dailymail to do that?

Or am I missing something obvious? :eek:



Alex

sanderton
02-06-2004, 05:51 AM
DaiyMail doesn't send the images; your e-mail client loads them when you open the e-mail. If your PC where you read the mail can access TiVoweb, then it should be able to read the pics. You might need to hack the code to use https, I'm not sure.

alextegg
02-06-2004, 06:05 AM
I realise that, but dailymail forms the email with the urls to the images in it?

They would normally say something like http://server/directory/image.jpg for each one, I can change to https://server/directory/image.jpg but the email client won't cope with the secure authentication?

sanderton
02-06-2004, 06:26 AM
Originally posted by alextegg
the email client won't cope with the secure authentication?

Should just throw up the log-in. Mine does.

alextegg
02-06-2004, 06:29 AM
ok, will try it, thanks

Alex

Milhouse
02-06-2004, 07:24 AM
I have the images on my personal web space (hosted by Zen) and will make it available over weekend once I've uploaded the latest images - use if you have no other alternative. :)

smiffy
02-06-2004, 03:28 PM
Hmmm.... it worked for a couple of days and now i get this when I launch a Jazz email

INTERNAL SERVER ERROR
--cut here--
action_extramail '' ''
child process exited abnormally
while executing
"exec $preshell $command > $postcommand 2>&1"
(procedure "::action_extramail" line 19)
invoked from within
"::action_$action $chan $part $env"
("eval" body line 1)
invoked from within
"eval {::action_$action $chan $part $env}"
--cut here--

tivo-onion
02-06-2004, 06:13 PM
Take a look in the log file and see what the module error was? The .itcl file has no error handling in it so it is not too helpful! Let us know what is in the logfile....

ookami85
02-06-2004, 06:54 PM
I'm getting the same error as fysmd:

I get the following at Bash:
bash-2.02# ./dailymail_jazz.tcl
hours ahead value is now : 36
can't read "::version": no such variable
while executing
"if {$::version >= 3} {
set guideindexdir "/GuideIndexV2"
} else {
set guideindexdir "/GuideIndex"
}"
(file "/var/hack/tivoweb-tcl/modules/index.itcl" line 642)
invoked from within
"source /var/hack/tivoweb-tcl/modules/index.itcl"
(file "./dailymail_jazz.tcl" line 1467)

And the following at tivoweb:
INTERNAL SERVER ERROR
--cut here--
action_extramail '' ''
child process exited abnormally
while executing
"exec $preshell $command > $postcommand 2>&1"
(procedure "::action_extramail" line 19)
invoked from within
"::action_$action $chan $part $env"
("eval" body line 1)
invoked from within
"eval {::action_$action $chan $part $env}"
--cut here--

I am also running the newest version tivowebplus. Any help will be appriciated. If any other info is needed post a reply, Thanks.

jwarren1234
02-07-2004, 12:32 AM
Thanks everyone for all the work on this, great addition to my TiVo!!

So I have a suggestion, I am not sure if it is even possible but thought I would throw it out!

I personally do not use cron to have the report sent to me automatically but use TiVo web to send it manually, would it be possible to have a box added to the interface so you can choose what e-mail address you want the report sent to?

Just curious.

Jeremy

tivo-onion
02-07-2004, 05:12 AM
Originally posted by ookami85
I'm getting the same error as fysmd:

I get the following at Bash:
bash-2.02# ./dailymail_jazz.tcl
hours ahead value is now : 36
can't read "::version": no such variable
while executing
"if {$::version >= 3} {
set guideindexdir "/GuideIndexV2"
} else {
set guideindexdir "/GuideIndex"
}"
(file "/var/hack/tivoweb-tcl/modules/index.itcl" line 642)
invoked from within
"source /var/hack/tivoweb-tcl/modules/index.itcl"
(file "./dailymail_jazz.tcl" line 1467)

And the following at tivoweb:
INTERNAL SERVER ERROR
--cut here--
action_extramail '' ''
child process exited abnormally
while executing
"exec $preshell $command > $postcommand 2>&1"
(procedure "::action_extramail" line 19)
invoked from within
"::action_$action $chan $part $env"
("eval" body line 1)
invoked from within
"eval {::action_$action $chan $part $env}"
--cut here--

I am also running the newest version tivowebplus. Any help will be appriciated. If any other info is needed post a reply, Thanks.

The dailymail_jazz module only uses the "version3" variable which it sets in the code itself. It does not use a "version" variable, which is in the "index.itcl" module. See sanderton's post from earlier - here (http://www.tivocommunity.com/tivo-vb/showthread.php?postid=1702228#post1702228). & LJ's suggestion - here (http://www.tivocommunity.com/tivo-vb/showthread.php?postid=1702037#post1702037)

cheers

Chris

Milhouse
02-07-2004, 06:38 AM
All the images from the latest Daily Mail (all 27 of them!) are available here if you don't have your own hosting:

http://www.nmacleod.com/public/tivo

tivo-onion
02-07-2004, 07:16 AM
Anyone,

if I am to support the "version" variable, could somebody please let me know the array of value options for the range of tivo options out there?

I am assuming that: version = 2.5 for uk tivos
and version = 3 for direct tivos

could anyone correct me if I am incorrect please

cheers

Chris

LJ
02-07-2004, 10:53 AM
Originally posted by tivo-onion
if I am to support the "version" variable, could somebody please let me know the array of value options for the range of tivo options out there?

Personally I wouldn't spend any time on it Chris. As far as I understand it TiVoWeb Plus inadvertently broke a number of exisiting TiVoWeb modules by trying to roll the version number checking into a new "version" variable. The more recent versions (several weeks worth at least) put back support for the TiVoWeb "version3" variable.

If it's still broken then the people who're running TiVoWeb Plus should post bug reports over on the other place's forums* so the authors of TiVoWeb Plus are made aware and can fix it. Falcontx seems to be the guy to report errors to.

*: The Database of Deals ;)

Edit: ...though ookami85 says they're running the latest version, so maybe it got broken again...

sanderton
02-07-2004, 02:37 PM
I think the current TWP has BOTH variables in it; the fix they put in repaired the damage to modules which expected to be able to read the version3 variable, but DailyMail is different; it pretends to be http-d.tcl (or whatever the main TiVowWeb core is called) and calls index.itcl. Index.itcl expects the version variable to be initialised, but DailyMail in its current form hasn't done that.

All the code I've seen is along the lines of testing if version is >= 3, so a

global version
set version 2

should be fine for a UK machine.

fysmd
02-09-2004, 04:36 PM
Yes, this fixes my ::version problem but now I get a get_space problem :(

bash-2.02# ./dailymail_jazz.tcl
hours ahead value is now : 36
couldn't execute "/var/hack/tivoweb-tcl/get_space": no such file or directory
while executing
"error $error"
(procedure "get_totalsizes" line 9)
invoked from within
"get_totalsizes "
(file "./dailymail_jazz.tcl" line 1488)

sanderton
02-10-2004, 05:08 AM
Sounds like you haven't got "getspace" installed in that directory, judging by the error messgae saying that. :)

ChrisJB
02-10-2004, 06:52 AM
Look thru the jazz script for get_space... it defaults to the tivoweb-tcl directory. You need to change it to /tivoweb-tcl/bin_ppc or something like that

FWIW, my entire solution to the TWP compatibility issue was (as well as amending the above, to lift the old index.itcl and util.itcl files from TW 1.9.4 and place them in the /var/hack directory. You then amend the dailymail_jazz script to point to those files.

Hackety hack and makes upgrading a bit messy but it works.

PortlandPaw
02-11-2004, 05:38 PM
I really love this little hack -- maybe I just like getting e-mail that doesn't imply that I'm deficient in some physical way.

So I thought it would be fun to add information about the running temperature, uptime and the TiVo hacks currently running on the machine. One note: The file specifies that the config file is in the /var/hack/dailymail directory, which is where I keep all this stuff.

Just for the record, here's the cron job I've created to send me mail in the morning:
# Five after eight a.m., Maine time, every weekday, push dailymail
5 13 * * 1-5 /tvbin/tivosh /var/hack/dailymail/dailymail_jazz.tcl > /var/hack/log/dailymail_jazz 2>&1

My thanks to sanderton and tivo-onion for this contribution.

managerxxx
02-13-2004, 03:53 PM
All looks good from the dailymail front but for some reason the cron process doesn't start up from the rc.sysinit.author file (or from rc.sysinit for that matter). I'm running it as /var/hack/bin/cron &. If I start the process manually I get the mails without any issue - it's just the fact that it won't start at boot. (Note: I'm using tivosh and ps to check for the process running).

Has anyone got any suggestions please???

Cheers

PortlandPaw
02-13-2004, 04:13 PM
I found that you have to be sure that cron isn't running in multiple instances. You get an error if you try. So make sure that cron is only started by one of your startup scripts.

Also, I had a problem with cron that wasn't really cron at all -- I was trying to run rsync from cron with no success. I finally got rsync to output some error messages and determined that rsync was sick. I installed a fresh copy of rsync and everything has run fine ever since.

Maybe you have a similar problem -- try reinstalling the cron executable.

Finally, be sure that cron is executable by doing chmod 777 cron in the cirectory where it lives.

Something should work...good luck.

managerxxx
02-13-2004, 04:19 PM
Thanks Portland - I could understand where you're coming from if cron didn't work from the cmd line but it does......(or am I missing something)

Cheers

smiffy
02-14-2004, 05:20 PM
Hmmm minews work... but now is stopped.... with these error messages...

INTERNAL SERVER ERROR
--cut here--
action_extramail '' ''
child process exited abnormally
while executing
"exec $preshell $command > $postcommand 2>&1"
(procedure "::action_extramail" line 19)
invoked from within
"::action_$action $chan $part $env"
("eval" body line 1)
invoked from within
"eval {::action_$action $chan $part $env}"
--cut here--



INTERNAL SERVER ERROR
--cut here--
action_plainmail '' ''
can't read "objectid": no such variable
while executing
"string index $objectid 0"
(procedure "::action_plainmail" line 5)
invoked from within
"::action_$action $chan $part $env"
("eval" body line 1)
invoked from within
"eval {::action_$action $chan $part $env}"
--cut here--


I've tried a reboot and that makes no different

PortlandPaw
02-14-2004, 05:42 PM
Smiffy, that may be the same error I saw when I tried to send mail from TivoWeb. But the jazzed version worked fine, so my simple solution was to clip the offending option from sendmail.itcl and ignore the problem. And, sure enough, it went away!

And, managerxxx, oddly enough rsync worked from the command line but not from cron. So I'd still try swapping out your cron file.

managerxxx
02-15-2004, 09:20 AM
Portland et al

Could you post the size of your cron file please - I'm using the one linked from Sandertons website but still have the issues starting it automatically at boot (see previous post).

Cheers

PortlandPaw
02-15-2004, 09:46 AM
My cron file is dated July 30, 2002 with a size of 131312.

Go get 'em!

managerxxx
02-15-2004, 02:13 PM
Ditto - my cron is exactly the same size so I don't think my problems are anything to do with having the wrong cron....

Mmmmmmmm

PortlandPaw
02-15-2004, 02:23 PM
Still could be corrupted...

managerxxx
02-15-2004, 03:17 PM
Thanks for your patience on this one Portland....

.....I uploaded a new copy of the file and had the same problems and then thought I'd change the order in which my hacks load at startup - voila!! Loading cron first fixes the problem.

Thanks again for your help/suggestions.

tivo-onion
02-15-2004, 03:58 PM
Here we are, an updated and shiny version 0.23 of dailymail_jazz plus associated files. The new changes are as follows:

-----------------------------
1. Added in support for suggestion equalisation i.e. all suggestions are equal - but are still second class citizens when compared to scheduled recordings.

As far as I can figure, this is not endpadplus which makes all suggestions + scheduled recordings equal - HOWEVER I MAY BE WRONG HERE - APOLOGIES IF I AM!

In order to update your standard version of endpad.tcl to make all suggestion equal:

find the following code lines in the endpad.tcl file:

if {$gap < $endpadding && $nselectiontype == 6} {

DeleteSuggestion "$nextrecfsid"

set endpadtoset $endpadding

} else {

and update them to the following line:

if {$gap < $endpadding && $nselectiontype == 6 && $cselectiontype != 6} {

DeleteSuggestion "$nextrecfsid"

set endpadtoset $endpadding

} else {

you will need to set the relevant variable in the dailymail.cfg file to true as here:

set suggestioneq true

or alternatively set it to false if you do not want to make the updates to endpad.tcl.

PLEASE BE AWARE, I TAKE NO RESPONSIBILITY FOR YOU TRASHING YOUR COPY OF ENDPAD.TCL!

-----------------------------
2. Added in support for recording equalisation for endpadplus users, where everything is equal - AGAIN, I MAY BE WRONG HERE ABOUT WHAT ENDPADPLUS DOES - APOLOGIES IF I AM!

you will need to set the relevant variable in the dailymail.cfg file to true as here:

set everythingeq true

or alternatively set it to false if you do not use endpadplus.

-----------------------------
3. Modified the code so that back to back suggestions are recorded - the true behaviour of endpad.

-----------------------------
4. Added experimental support for tivowebplus users and the "version" variable.

-----------------------------
5. Added capability to pass in an alternate email recipient on the commandline and through tivoweb with a new updated version of the senddailymail.itcl module, also provided in the attached zip file.

on the command line two arguments are now allowed, the override "hours ahead" value and the override "recipient email", for example.....

dailymail_jazz.tcl 72 jim@beans.com

......will send a jazz dailymail to "jim@beans.com" looking ahead for the next 72 hours.

the new senddailymail.tcl file is self explanatory.

------------------------------
6. Added the general heathcheck functionality provided by PortlandPaw with some presentation tidyups. You will need to set the order of your display modules, including this one in the updated dailymail.cfg file.

There is also a new emergency temperature guage with a new graphic "thermometer.gif" that you should place in the normal images directory along with all other images. You should set the warning termperature in the .cfg file.

set emergencytempcentigrade 50

------------------------------

I HAVE MODIFIED THIS POST TO POINT TO A BUG FIX WITH TIVOWEB EMAIL RECIPIENT OVERRIDE.

I have been running it for a few days so it seems fairly stable. See earlier posts here (http://www.tivocommunity.com/tivo-vb/showthread.php?postid=1698748#post1698748) if you are new to this module and don't know where the files go.

DOWNLOAD REMOVED - SEE LATER POSTS

The actual updated files are:

- dailymail_jazz.tcl
- senddailymail.itcl
- dailymail.cfg
- thermometer.gif

enjoy, and please send me info on any bugs you find,

cheers

Chris

jwarren1234
02-15-2004, 04:56 PM
works great!

Thanks for adding the alternate e-mail address :)

tivo-onion
02-15-2004, 05:05 PM
Originally posted by jwarren1234
works great!

Thanks for adding the alternate e-mail address :)

No problem....however, be aware that your email server must be able to accept the email id you use! If you get a crash it may be for that reason! My email server is very sensitive that way!

cheers

Chris

PortlandPaw
02-15-2004, 08:43 PM
Nicely done! I put it through its paces and it worked perfectly, both via cron and from TivoWeb. Thank you for standardizing the format - I was bit too lazy to do that. This has evolved into a great little hack with true utility. I like the concept of group software development! What fun!

Fozzie
02-16-2004, 02:20 AM
Great stuff. However, mine didn't send to the override email address from Tivoweb - it sent to the dailymail.cfg address. From the log:

dEbUg ChEcKpOiNt : Global variable definition complete.
dEbUg ChEcKpOiNt : Configuration file usage complete.
dEbUg ChEcKpOiNt : Completed other preperation.
argument 1 passed in ::: >><<
argument 2 passed in ::: >>(tivoweb entered email)@ntlworld.com<<
a new recipient email found in argument 2
recipient email value is now : (dailymail.cfg email)@ntlworld.com

tivo-onion
02-16-2004, 04:07 AM
Originally posted by Fozzie
Great stuff. However, mine didn't send to the override email address from Tivoweb - it sent to the dailymail.cfg address. From the log:

dEbUg ChEcKpOiNt : Global variable definition complete.
dEbUg ChEcKpOiNt : Configuration file usage complete.
dEbUg ChEcKpOiNt : Completed other preperation.
argument 1 passed in ::: >><<
argument 2 passed in ::: >>(tivoweb entered email)@ntlworld.com<<
a new recipient email found in argument 2
recipient email value is now : (dailymail.cfg email)@ntlworld.com

Yes, my fault - there is a feature of the tivoweb senddailymail.itcl module that even when you don't send a hours ahead argument, it still thinks you have, with a value of 'space'. Wierd.....

Anyway, it is fixed now. The new version DOWNLOAD REMOVED - SEE LATER POSTS

If you can be bothered to refresh your .cfg file and add the new "thermometer.gif" graphic, there is also an emergency temperature feature in the modules now. If you cannot be bothered then there should be no problem and it should work anyway.

I have updated the version in the my previous posting also,

cheers

Chris

PortlandPaw
02-16-2004, 08:52 AM
Thanks for the quick fix!

It may have been me, but when I sent e-mail from TivoWeb (which worked fine) and then selected "send another daily mail" it sent another e-mail without waiting for a change (if desired) in the override address or dispatching with the Send e-mail button.

And here's an idea for what I think would be a neat feature. How hard would it be to add an "extra text" field to the senddailymail.itcl module (and, I guess, to senddailymail_jazz.itcl, as well, to accomodate the TivoWeb entries)?

That would provide a way to tell yourself why you're sending the extra e-mail or, if it's going somewhere else, to tell the person what it's about. What sparked the idea is that I'd like to send an e-mail to my nephew and say, "hey, look what my TiVo can do!"

As usual, onion, nice work!

tivo-onion
02-16-2004, 12:13 PM
Originally posted by PortlandPaw
Thanks for the quick fix!

It may have been me, but when I sent e-mail from TivoWeb (which worked fine) and then selected "send another daily mail" it sent another e-mail without waiting for a change (if desired) in the override address or dispatching with the Send e-mail button.

And here's an idea for what I think would be a neat feature. How hard would it be to add an "extra text" field to the senddailymail.itcl module (and, I guess, to senddailymail_jazz.itcl, as well, to accomodate the TivoWeb entries)?

That would provide a way to tell yourself why you're sending the extra e-mail or, if it's going somewhere else, to tell the person what it's about. What sparked the idea is that I'd like to send an e-mail to my nephew and say, "hey, look what my TiVo can do!"

As usual, onion, nice work!

Here you go Portland - just for you.........

changes:

1. the ability to view the latest generated email via tivoweb as well as via email.

2. the ability to add a message from tivoweb - only from tivoweb. This does not use arguments so you cannot send the message from the commandline!

3. a quick utility to view text or html through tivoweb.

updated files:
- dailymail_jazz.tcl
- dailymail.cfg
- senddailymail.itcl

new files:
- viewdailymail.itcl
- viewhtml.itcl
- message.gif

all files go in the usual places - if you are a newbie see earlier release posts for information:

The new file can be found here:
DOWNLOAD REMOVED - SEE LATER POSTS

enjoy,

Chris

Fozzie
02-16-2004, 05:21 PM
Looking good so far. I like the comments bit on the email :)

(When using the email override, I still get a copy of the email (less comments) to the .cfg email address too - was this planned?)

tivo-onion
02-16-2004, 06:04 PM
Originally posted by Fozzie
Looking good so far. I like the comments bit on the email :)

(When using the email override, I still get a copy of the email (less comments) to the .cfg email address too - was this planned?)

Fozzie,

I am confused by your problem here. I had not seen it myself, and have just done 3 or 4 checks and still cannot replicate it. It must be a problem specific to your setup...or does anyone else have the problem? Do you have multiple instances of one of the modules running? It seems really strange that you get two different emails sent? If you override the hours ahead, then do you get two mails also, one with override and one with .cfg original? Are you pressing the refresh/reload button on your browser, or clicking the back button? These may do it!

cheers

Chris

PortlandPaw
02-16-2004, 06:48 PM
Wow, you've been busy! Thank you!

smiffy
02-17-2004, 03:02 AM
How about including the Jazz version number at the bottom of the email??? I'm not sure which version I currently on!

Fozzie
02-17-2004, 05:23 AM
Originally posted by tivo-onion
Fozzie,

I am confused by your problem here. I had not seen it myself, and have just done 3 or 4 checks and still cannot replicate it.........

Neither can I now - everything works as expected?!?! (I must have either used back on my browser/refreshed a page or it was something to do with my server based anti-spam app).

Sorry for the false alarm.:o

ddub
02-17-2004, 01:29 PM
Hi,

Ok what have I done wrong.
Just upgraded to the latest version 0.25 i believe.

Put all the right files in the right places, and Chmod'd them.
edited config file using joe no so old values are identical to older config file.

When I run it I get to this stage: (only latter part here for space saving)

Check start time overlap for back-to-back suggestions
There is no overlap.
Record
Item: 13
Check start time overlap for back-to-back suggestions
There is an overlap -> this programme will probably not be recorded.
NoRecord
Item: 14
Record
Compiling expiration list...

at this stage I loose my network connection to the tivo, telnet FTP and HTTP. Huh? any Ideas?

Darren

ddub
02-17-2004, 01:33 PM
Just seen why Im loosing the net connection, its crashing the tivo at that point and rebooting it.

Does anyone have the old version 0.20 zip file, thats the last one I had fully working ( the first one with the thumbs)

cheers,
Darren

tivo-onion
02-17-2004, 06:41 PM
Originally posted by ddub
Just seen why Im loosing the net connection, its crashing the tivo at that point and rebooting it.

Does anyone have the old version 0.20 zip file, thats the last one I had fully working ( the first one with the thumbs)

cheers,
Darren

Darren,

I have never had the problem you have here, but I have put a load more debugging into the v0.25 version and some error catching. It should not now crash your tivo, but you should still check the log and see if you can itentify any errors where it creates the expiry or conflict list. Let me know what the errors are if you find them!

DOWNLOAD REMOVED - SEE LATER POSTS

cheers

Chris

ddub
02-18-2004, 05:36 AM
Thanks for that Chris,

I get this far this time (only bottom part of output pasted here)

within time period
showing : >>dbobj382<<
showingfsid : >>646031/11<<
startdate : >>12461<<
starttime : >>73678<<
rectime : >>1076704078<<
station : >>dbobj383<<
callsign : >>ITV1YOR<<
title : >>Learner Drivers<<
program:: >>dbobj384<<
series : >>dbobj385<<
dEbUg ChEcKpOiNt : Checkpoint EXPIRE-003
dEbUg ChEcKpOiNt : Checkpoint EXPIRE-004
dEbUg ChEcKpOiNt : Checkpoint EXPIRE-005
dEbUg ChEcKpOiNt : Checkpoint EXPIRE-006
dEbUg ChEcKpOiNt : Checkpoint EXPIRE-007
dEbUg ChEcKpOiNt Expiry Item Success!
---------------------------------------------------------------------
dEbUg ChEcKpOiNt : Checkpoint EXPIRE-000
dEbUg ChEcKpOiNt : Checkpoint EXPIRE-001
dEbUg ChEcKpOiNt Expiry Item Success!
---------------------------------------------------------------------
dEbUg ChEcKpOiNt : Checkpoint EXPIRE-000
dEbUg ChEcKpOiNt : Checkpoint EXPIRE-001
dEbUg ChEcKpOiNt Expiry Item Success!
---------------------------------------------------------------------
dEbUg ChEcKpOiNt : Checkpoint EXPIRE-000
dEbUg ChEcKpOiNt : Checkpoint EXPIRE-001
dEbUg ChEcKpOiNt Expiry Item Success!
---------------------------------------------------------------------
dEbUg ChEcKpOiNt : Checkpoint EXPIRE-000
dEbUg ChEcKpOiNt : Checkpoint EXPIRE-001
dEbUg ChEcKpOiNt Expiry Item Success!
---------------------------------------------------------------------
============================================================ =========
Email required.
dEbUg ChEcKpOiNt : About to send mail.

about 1 minute wait here....

couldn't open socket: connection timed out
while executing
"socket $mailserver 25"
(procedure "sendmail" line 6)
invoked from within
"sendmail $mailserver $domain $recipient "TiVo status e-mail for [clock format [
clock seconds] -format {%A %B %d, %Y} -gmt true]" $message"
(file "./dailymail_jazz.tcl" line 2567)
bash-2.02#.


It didnt create a log file.

The mail server and address settings in the confing file are identical to my old settings that worked fine.

hope this helps...

Darren

sanderton
02-18-2004, 05:39 AM
Try telnetting to the mailserver address on port 25; that looks like network/internet/remote end problem.

ddub
02-18-2004, 05:42 AM
Sorted it,

In a bazarre twist of fate, Zen have changed the IP address of their mail server for the first time in , well since ever, on the same day I upgrade the daily mail software.

Just before, it was crashing the tivo before writing a log file.

Is with worth sticking with this debug version now, or going with a new 'complete' version?

thanks for Ur help,

Darren :D

tivo-onion
02-18-2004, 06:22 AM
Originally posted by ddub
Sorted it,

In a bazarre twist of fate, Zen have changed the IP address of their mail server for the first time in , well since ever, on the same day I upgrade the daily mail software.

Just before, it was crashing the tivo before writing a log file.

Is with worth sticking with this debug version now, or going with a new 'complete' version?

thanks for Ur help,

Darren :D

go with this version : I added some extra debugging around sockets - may help identify problems in the future. I think I will make debugging turn on/offable at some point soon, as it is pretty useful for when these types of problem crop up!

DOWNLOAD REMOVED - SEE LATER POSTS

cheers

Chris

ddub
02-18-2004, 06:43 AM
Thanks Chris,
Works fine.

can I make a suggestion?
In the next complete zip package, could you include a txt file that lists all the locations of the files?
I know you do this on the web page, but sometimes you have to trawl through the 100's of pages in this thread, and can me out of date anyway.

cheers
Darren