PDA

View Full Version : Tivo PHP! Tivo Web Module! So Much More!


Enigma
09-29-2002, 01:50 PM
Greetings.
I have been making great strides in my quest to enable PHP scripting on the TiVo. I am happy to announce the first public release of the project. The Full package includes the following:

Installer
The full package includes an installer script to install the individual packages on your TiVo. Individual packages are also available for download, in which case the packages would have to be manually installed.

PHP
Includes a PHP binary and all the required libraries. This package provides full PHP command line support and MySQL support. This package includes everything you need to run PHP scripts on your TiVo.

WebPHP
This is a module for Tivo Web that allows you to build PHP web applications using Tivo Web as the Web Server. It basically just sets up the PHP envrironment and loads your PHP script.

Sample Applications
I have included some sample applications for WebPHP. Most are quite simple and will be installed by default. I have also built an application to store and retrieve now showing data from a remote MySQL database. It will also export TyStreams and keep track of the show data. You can then re-import the streams at a later date, or import them into a different TiVo. I have tried to make this as painless as possible, but for now you must have a MySQL (http://www.mysql.com) server and remote storage (nfs/smbfs) available to the TiVo.


For more information on individual applications and for installation instructions, read the README file included in the archive.

To download the archive:
For the Full package:
Download
EDIT: Just go to the page and get the latest package
decompress and follow the directions in the readme.

For individual packages or other distributions:
Go to the project page (http://www.corruptdb.com/) and choose the files you wish to download.


Any questions/comments/bug reports/feature requests please contact me or post to this thread.

mrblack51
09-30-2002, 12:17 PM
i am having the same problem. i looked at the code for SqlConfiguration.php, and noted the following.


$cont = readline("Do you have a MySQL Server available? (y/N) ");
if(($cont == 'n') || ($cont == 'N') || ($cont == '')) {
print "Exiting\n\n";
exit;
}


while I am not big into PHP, it appears to be exiting right away if you answer N to 'do you have a MySQL server available?' All the config file creation stuff occurs afterword.

Enigma
09-30-2002, 02:29 PM
it appears to be exiting right away if you answer N to 'do you have a MySQL server available?' All the config file creation stuff occurs afterword.

You are certainly correct. The nowShowing.php application requires a MySQL server (see the readme). If you do not have one available you cannot use the module. In future releases, I plan on giving the option to use the DB or a text file (and perhaps server software to serve up the Ty Streams), but for now you must have a DB server (and an NFS or smbfs server) to use the module.

Edit:

Check out http://www.tivocommunity.com/tivo-vb/showthread.php?s=&postid=727874#post727874 (http://www.tivocommunity.com/tivo-vb/showthread.php?s=&postid=727874#post727874)
for some workarounds to this problem.

mrblack51
09-30-2002, 02:55 PM
i understand that, but trying to open any of the .php links from tivoweb gives


INTERNAL SERVER ERROR
action_php '/modload' 'set "script" "/var/hack/php/tivoweb/viewpage.php";'

Fatal error: Failed opening required 'config' (include_path='.:/var/hack/php/tivoweb:/var/hack/php/include') in /var/hack/php/include/commonFunctions.php on line 5
child process exited abnormally
while executing
"exec $source_dir/runphp $script "$env""
(procedure "::action_php" line 8)
invoked from within
"::action_$action $chan $part $env"
("eval" body line 1)
invoked from within
"eval {::action_$action $chan $part $env}"


the only difference is that the first line has whichever .php file i tried to run. basically, it looks like all the included .php files require a MySQL server, is that correct?

Enigma
09-30-2002, 03:02 PM
Check out the edit I just made to my above post. I misunderstood your problem-rc3105 reported a problem in opening nowShowing.php without a config file, it is normal behavior to have it exit in those circumstances and your post said you were having the same problem. nowShowing.php requires a SQL server but the other sample scripts do not. Once Steve reported the problem with not being able to open ANY of the scripts without the config file, I realized why and posted some fixes. The problem is a result of a mistaken assumption on my part and there are workarounds posted to the AVS thread linked above. I am fixing the problem in the package right now and will have the new packages posted soon.

mpauley
10-03-2002, 08:24 PM
Engima,

Great set of tools you brought together here. I have a few questions about the "MFS Export Recording" module though.

I click the Episode Title, click Export program and I get this error:


Export has been started or queued.
Queued Exports
INTERNAL SERVER ERROR
action_mfsexport '/175671' ''
couldn't execute "ls": no such file or directory
while executing
"exec ls /tmp/mfs_export_queue/"
(procedure "::action_mfsexport" line 52)
invoked from within
"::action_$action $chan $part $env"
("eval" body line 1)
invoked from within
"eval {::action_$action $chan $part $env}"



I have made sure to chmod 777 the "mfs" files and now Im stumped. Your help is appreciated!

Thanks

Mike
MPauley73@Hotmail.Com

Enigma
10-04-2002, 02:42 PM
action_mfsexport '/175671' ''
couldn't execute "ls": no such file or directory
while executing
"exec ls /tmp/mfs_export_queue/"
(procedure "::action_mfsexport" line 52)
invoked from within
"::action_$action $chan $part $env"
("eval" body line 1)
invoked from within
"eval {::action_$action $chan $part $env}"


The ls command is required for exporting and importing. It is usually found in /devbin. If /devbin (or what ever directory you have the file in) is not in your path, you can either:
1. Edit /var/hack/bin/mfs_queue_export and mfs_queue_import to give it the full path to ls
or:
2. Put the directory ls is in into the system PATH (i.e., don't put it in your profile, put it in a boot file like rc.sysinit BEFORE Tivo Web is loaded). You can check the phpinfo.php or showenv.php scripts to see what path PHP is currently using.

export PATH=$PATH:<new directory to add to path>

or:
3. Move, copy or link ls into a directory that is in your path.

ls and cut are required for imports, cut is included with the package because I don't know if it is a standard /devbin binary, but I know ls is and pretty much anyone who has a hacked Tivo should have it somewhere on their system. Just find out where yours is and perform one of the steps above and all should be well.

mpauley
10-06-2002, 04:19 PM
Enigma ,

Thanks for the help here and on TiVoComm, everything is looking good except for importing back to the TiVo. I go to External Shows, click the episode name, them import. It tells me that the show has been queued, but nothing ever happens. Any secrets I need to look for?

Mike

Enigma
10-07-2002, 04:48 PM
Originally posted by mpauley
Enigma ,

Thanks for the help here and on TiVoComm, everything is looking good except for importing back to the TiVo. I go to External Shows, click the episode name, them import. It tells me that the show has been queued, but nothing ever happens. Any secrets I need to look for?

Mike

Check /var/log/import.log to see if it sheds any light on the situation. What does the import queue page say?

mpauley
10-07-2002, 05:51 PM
Enigma,

It worked perfect! I checked my log and it said touch and tee was missing. I corrected that and everything worked. Have u looked into the process of transfering mpg files on to the TiVo at all?

Thanks again for all your help!

Mike

Enigma
10-07-2002, 06:47 PM
Have u looked into the process of transfering mpg files on to the TiVo at all?

IIRC, ele2pestriple would import (demultiplexed) mpeg files onto the Tivo, but it does not work under 3.0. I know from personal experience that it will totally hose MFS under 3.0, but several people have reported success with it under 2.5. I believe this is the reason why TivoDvlpr started work on mfs_import.

It is easy to throw away the stuff you can't identify and make an mpeg stream out of a Ty stream, but making a Ty stream out of a mpeg and ADDING the stuff you can't identify is a wee bit harder.

OskiBear
10-09-2002, 06:21 PM
Enigma,

I finally got WebPHP (SA running 2.5.1) as well as a mySQL server installed on my computer (XP box). It took a while to get all of the modules working to the point where they wouldn't output error messages when I ran the scripts from TivoWeb.

In fact, in order to get the NowShowing module to work, I ended up putting a different version of the showlist.tcl on the Tivo (old version for 2.5.1 vs new version for 3.0). Now, however, even though the databases "update" without errors, there is no listing in the NowShowing screen.

Do you think I'll need to switch back to the showlist.tcl that came with your package in order for NowShowing to work?

Thanks,
Kirk

Enigma
10-09-2002, 06:38 PM
Originally posted by OskiBear
Enigma,

I finally got WebPHP (SA running 2.5.1) as well as a mySQL server installed on my computer (XP box). It took a while to get all of the modules working to the point where they wouldn't output error messages when I ran the scripts from TivoWeb.

In fact, in order to get the NowShowing module to work, I ended up putting a different version of the showlist.tcl on the Tivo (old version for 2.5.1 vs new version for 3.0). Now, however, even though the databases "update" without errors, there is no listing in the NowShowing screen.

Do you think I'll need to switch back to the showlist.tcl that came with your package in order for NowShowing to work?

Thanks,
Kirk

The showlist.tcl included with my package was written entirely by me and outputs the information in a vastly different format than anything else. It will most assuredly not work with other showlists.

Precisely, what errors are you getting? Can you run my showlist.tcl from the command line? As the README states, I developed this under 3.0 and is most likely will not work at all under 2.x.

If someone would like to supply a 2.5 image for an hdr312 then it probably would not be too difficult to port the current code to 2.5. I tried to get one from Tivo, but they upgraded my 1.3 install directly to 3.0 and I have no intermediate backups. There are changes to MFS between the versions but not too drastic. It is just that I have no platform on which I can develop a 2.5 version.

I have already completely rewritten my showlist in the development tree (greatly expanding the information stored and changing the way the DBs are structured) in preperation for making the MySQL server optional, please do not put any effort into porting the version in the current release.

Errors by default are logged to /var/log/php.log, you may be able to see exactly what is happening when you try to use the supplied showlist.tcl.

FredThompson
10-09-2002, 06:47 PM
ftp.abs.net/tivo/Backups has the hdr312 at version 2.01 but no 2.5x

Perhaps that will help somewhat

Enigma
10-09-2002, 06:59 PM
Yesh, I tried that backup but could not get it to boot in the Tivo. I have a dd copy of my drive when it was virgin, and I have a 3.0 baclup, but no versions in between.

OskiBear
10-09-2002, 11:43 PM
Thanks for the replies...

I figured that I would need to run the showlist that came with the package. I have since switched back and receive the following messages when I run NowShowing/Refresh Database in tivoweb...


INTERNAL SERVER ERROR
action_php '/modload' 'set "script" "/var/hack/php/tivoweb/nowShowing.php";set "pageType" "nowShowing";set "refreshFromDb" "yes";set "submitBut" "Refresh Database";'


ERROR: Either you have no shows, or TCL was unable to get any shows. If your system is exceptionally busy, try again in a few minutes


can't scan path (errNmNameNotFound)

while executing
"mfs scan /Recording/NowShowingByClassic "
("uplevel" body line 2)
invoked from within
"uplevel $body"
invoked from within
"transaction {uplevel $body}"
(procedure "RetryTransaction" line 5)
invoked from within
"RetryTransaction {
set all2 [mfs scan /Recording/NowShowingByClassic ]
#set all2 [mfs scan /Recording/Active ]
set sptmp [split $all2 " "]
}"
(procedure "getShows" line 2)
invoked from within
"getShows $db"
(file "/var/hack/php/bin/showlist.tcl" line 112)
while executing
"exec $source_dir/runphp $script "$env""
(procedure "::action_php" line 8)
invoked from within
"::action_$action $chan $part $env"
("eval" body line 1)
invoked from within
"eval {::action_$action $chan $part $env}"


I get the same "can't scan path..." error running showlist.tcl from the command line.

No errors in php.log since I got the server running...there were a bunch of can't connect errors before that...


Maybe I'll just register the machine with Tivo so I can get updated software...(I just got the machine off eBay and haven't registered it yet...just hacked it like a madman).

I've got the backup I made of this machine prior to installing all of these hacks. ver 2.5.1-01-1-000 I can send it to you if it would help....but then again, the easiest fix would probably be for me just to get the 3.0 software and be done with it.

Thanks again,
Kirk

chrsturbo
10-15-2002, 12:43 PM
Here's my diff to showlist for a directivo running
2.5.2


Its mainly just 3.0 to 2.5 stuff. My real problem is finding a dependable way to get a share onto a 2.5.2 box. SMB crashes all the time so now I am delving into NFS.
-Chris

ralphboone
10-19-2002, 10:26 PM
Hi. I have installed your PHP app and it works great. I have it on 2 different tivos that are both talking to a common Mysql DB on my NFS server. I am able to export shows without any problem. It creates the stream file on the nfs share.
I just have had no luck importing the program to the other tivo. I dont know where it is looking for the stream file to import. It just bombs and says it is unable to locate the file. The filename it is looking for is just a number and that doesnt seem to match the format the export program saves it in. I have browsed all of the import code but I am unsure where I need to copy the stream. Any help would be greatly appreciated.

mrblack51
10-20-2002, 02:47 AM
chrsturbo: thanks for posting that patch file...unfortunately, it didnt seem to work with the current version of showlist.tcl from enigma's site. If you could post a new diff against that version, it would be greatly appreciated. Thanks

Oh, attached is a copy of patch compiled for the tivo, works great from what i can tell. remove the .txt extension, then untar/gunzip to get the files

Enigma
10-20-2002, 06:53 PM
Hi. I have installed your PHP app and it works great. I have it on 2 different tivos that are both talking to a common Mysql DB on my NFS server. I am able to export shows without any problem. It creates the stream file on the nfs share.
I just have had no luck importing the program to the other tivo. I dont know where it is looking for the stream file to import. It just bombs and says it is unable to locate the file. The filename it is looking for is just a number and that doesnt seem to match the format the export program saves it in. I have browsed all of the import code but I am unsure where I need to copy the stream. Any help would be greatly appreciated.


After the application exports the show, it calls a script to move the information in the local table to the remote table. I assume this is working because you say the export is working. When the info gets moved to the remote table, it should replace the value of Mfsids with a space seperated list of file paths for the stream, first part first and last part last. When you go to the episode detail page on a remote show, what does the Mfsids attribute show? If it is showing numbers, then for some reason it did not replace it with the file names. You should be able to edit the remote episode and add the file names if they are not there.

Enigma
10-20-2002, 11:00 PM
Here is a new showlist.tcl using the latest source and incorporating chrsturbo's patch. Let me know if it works properly on 2.x Tivos. The full package at the site has this version now, if you download that after you read this you do not need to download this attachment.

chrsturbo
10-21-2002, 12:21 AM
Thanks for bundling it up will test. NFS and export are working great. Now I need to create a TY from mpegs and I'd love to be able to convert a SA TY to a directivo TY and vice versa. Anyione know where those projects are going on? thanks

dr4j2
10-27-2002, 01:25 AM
I have installed the php code and have it working on extreme25.

What i could not figure out is why the mfs_queue_export only runs if it is in the /var/hack/bin

I tried to relocate it to /tivoweb-tcl/php/bin without sucess.

Is the path hard coded in the mfs_export executable?

dr4j2
10-27-2002, 08:52 AM
How should I hook up multiple tivos?

I have 2 dtivo's with network cards, one windows mysql server

Do I install and configure both tivos exactly the same? Pointing both towards the same MSQL Server, using the same MSQL userid?

Do I do the same with the mount for the external storage?

Hi8
10-28-2002, 07:31 AM
Originally posted by dr4j2
I have installed the php code and have it working on extreme25.

What i could not figure out is why the mfs_queue_export only runs if it is in the /var/hack/bin

I tried to relocate it to /tivoweb-tcl/php/bin without sucess.

Is the path hard coded in the mfs_export executable?

I believe you will find path is read-only. The path under /var is not.

Enigma
10-28-2002, 10:34 AM
How should I hook up multiple tivos?

I have 2 dtivo's with network cards, one windows mysql server

Do I install and configure both tivos exactly the same? Pointing both towards the same MSQL Server, using the same MSQL userid?

You want near the same configuration, but not exactly the same. You want the same user, password, database, and remote table, but different local tables. The default for the local table is nowShowing, so on your second tivo you set the table to something different, like nowShowing2.

Do I do the same with the mount for the external storage?

Yes, the mount for the external storage should be the same for both machines. The paths to the TY files are stored in the DB, if you mount your remote storage on a different path on the second machine the import scripts will not be able to find the TY files (unless you change the DB values as well, which you can do when editing an episode).

Enigma
10-28-2002, 10:38 AM
Is the path hard coded in the mfs_export executable?

No, but it is hard-coded into the mfs_queue_export script. You can edit the script and change it to what you like. By default it is set to extract shows to /mnt/playback/export. The development version allows you to change this path in the configuration settings (or not use a file server at all) but for now you will need to either change the path in /var/hack/bin/mfs_queue_export or mount your remote storage on /mnt/playback/export

Enigma
10-28-2002, 11:09 AM
did you ever track down the bug in the old insert code that was rebooting / corrupting mfs? I didn't even think about it until sombody mentioned the possible reboot on insert you were having. I don't know what rev the code was at when you grabbed it but I do remember you said you went to fsid based extract/insert because of some insert problems. I'm on the dtivo side of the fence but the latest rev can still corrupt mfs under certain circumstances.

No, I haven't determined what was causing this. Occasionally I will import a program that will reboot the tivo at the end of the recording, but usually it gives the normal "Delete this recording now?" screen. I haven't had any problems with MFS inconsistencies, if they are happening on the reboot then mfsfix is cleaning them up and MFS comes back up every time <crosses fingers>. If I am watching a recording that is currently importing and hit the end of it, more often than not the machine reboots, but will sometimes give the delete screen and return to Now Playing.

The main reason I went to extracting individual IDs was because it makes more sense to me to just export the individual files to start with rather than extracting one big stream and having to to a byte compare on a 1-2 GB file to locate the stream boundaries. I will probably end up using TivoDvlpr's tar extract for operations using the dedicated server (just got nonblocking sockets working-woohoo multiple connections!) since I can offload any archiving/compression operations to it, but still use raw ty file for the file server and SQL server options. I am a little leery about using tar for operations that must happen on the Tivo, my poor SA works so hard it is a wonder it has not gone up in flames and having to untar the archive in addition to the load of the MFS operations and import may send it over the edge. Also, if I did not reimplement tar in an executable I would most likely have to extract the archive to a FIFO and import from there (since most Tivos do not have the free disk space to buffer a ~512 MB stream).

Speaking of importing from FIFOs, has anyone had success using mfs_import with a FIFO? It does not seem to work well, it may be that it wants to know the file size of the stream it is importing. I will have to check out the code to see what I can find. I will probably either add a command line option for filesize and/or get it to read the data from STDIN rather than a file so I can skip the FIFO step.

dr4j2
10-28-2002, 08:38 PM
Originally posted by Enigma
No, but it is hard-coded into the mfs_queue_export script. You can edit the script and change it to what you like. By default it is set to extract shows to /mnt/playback/export. The development version allows you to change this path in the configuration settings (or not use a file server at all) but for now you will need to either change the path in /var/hack/bin/mfs_queue_export or mount your remote storage on /mnt/playback/export

with the mfs_export and mfs_export_queue(edited for the right path) in in the /tivoweb-tcl/php/bin

I get

INTERNAL SERVER ERROR
action_mfsexport '/867719' ''
couldn't execute "/var/hack/bin/mfs_queue_export": no such file or directory
while executing
"exec -- /var/hack/bin/mfs_queue_export $recfsid $mfsids &"
(procedure "::action_mfsexport" line 46)
invoked from within
"::action_$action $chan $part $env"
("eval" body line 1)
invoked from within
"eval {::action_$action $chan $part $env}"

on the console it reports
INTERNAL SERVER ERROR
action_mfsexport '/867719' ''
couldn't execute "/var/hack/bin/mfs_queue_export": no such file or directory
while executing
"exec -- /var/hack/bin/mfs_queue_export $recfsid $mfsids &"
(procedure "::action_mfsexport" line 46)
invoked from within
"::action_$action $chan $part $env"
("eval" body line 1)
invoked from within
"eval {::action_$action $chan $part $env}"


simply copying mfs_export to /var/hack/bin resolves the issue.

mfs_queue_export has paths for output to the /mnt/playback/export and references to the /tivoweb-tcl/php/bin

also the host name is hard coded into the delete imported show page, that comfirms the imported show deletion.

Enigma
10-28-2002, 08:47 PM
couldn't execute "/var/hack/bin/mfs_queue_export": no such file or directory
while executing
"exec -- /var/hack/bin/mfs_queue_export $recfsid $mfsids &"


Ah, I see what you are talking about. The code in question is in $TIVOWEB_ROOT/modules/mfs_export.itcl on line 50. You should be able to just change it to mfs_queue_export if you have it in the $PATH that is in Tivo Web's environment.

Enigma
10-28-2002, 09:00 PM
also the host name is hard coded into the delete imported show page, that comfirms the imported show deletion.


Could you be more specific on this one? Which page is the imported shows page? There is a page that lists shows on your Tivo, who's delete function is handled by the native Tivo Web delete. I have delete functions for exported episodes, and I seem to remember a problem like this, but I thought I fixed it. What build number are you using? I can check my archives and see if the fix is in the version you have.

dr4j2
10-28-2002, 09:12 PM
Originally posted by Enigma
Could you be more specific on this one? Which page is the imported shows page? There is a page that lists shows on your Tivo, who's delete function is handled by the native Tivo Web delete. I have delete functions for exported episodes, and I seem to remember a problem like this, but I thought I fixed it. What build number are you using? I can check my archives and see if the fix is in the version you have.

Installed Tivoweb Beta 1.9.4 without the anti-extreme code

downloaded the individual modules from the web site. used the show list from the OCT21st package.

Would have used the package to install but the install.sh doesn't work on extremed Dtivo's.

Did a manual install of individual components to
/tivoweb-tcl/php

libraries in /hack/bin with links


export a show
goto nowshowing
display external shows
click episode title
actions - delete program

then ya get page not found

look at the address line and find http://tivo/...yadda..yadda..

alter the address to be http://correctedipORhostName/...yadda..yadda..
and ya get the show deletion confirmed.

Enigma
10-28-2002, 09:47 PM
Yeah, I already fixed this in the Full Package and dev, looks like I just don't update the individual packages enough. The code in question is in nowShowingFunctions.php on line 316. What happened when you ran the install script on your Tivo? It is just a basic shell script, I can't see why it would fail on that platform.

dr4j2
10-29-2002, 12:44 AM
Originally posted by Enigma
Yeah, I already fixed this in the Full Package and dev, looks like I just don't update the individual packages enough. The code in question is in nowShowingFunctions.php on line 316. What happened when you ran the install script on your Tivo? It is just a basic shell script, I can't see why it would fail on that platform.

script crashed non existent directorys on extreme /var/hack does not exist

installed the PHP in the tivoweb root
/tivoweb-tcl
/tivoweb-tcl/modules
/tivoweb-tcl/bin
/tivoweb-tcl/include
/tivoweb-tcl/tivoweb
and the libaries to be installed in the LDLibrary path
ie in extreme is /hack/lib

Enigma
10-29-2002, 01:02 AM
Hmm, I thought I had it create the directory if it did not exist. When it untars the packages it should create it. Is /var/ read-only for some reason? Anyway, glad you got it installed there but there are many things that have static paths (mfs_queue_*, php/bin putlist-run.php, php/bin/showlist.tcl, php/bin/importsql.tcl) and I'm sure a shitload of things I can't think of right now. I originally built the application for my own use and didn't bother making the install location variable. Perhaps in the next version I will make a new installer that will allow you to select the install location, but as I said there are quite a few different places that would need to be changed. I will probably at least be moving everything to be under the php directory, except the libraries. This will make upgrades go smoothly.

brianw
11-04-2002, 01:06 PM
First, just like to say thanks for the work you've done, the idea of centralized storage for recorded shows is exactly what I've wanted from the Tivo from the beginning.

I'm currently using my SA Tivo for this effort, it's now wireless, Tivoweb, and your PHP package.

Got yor stuff all installed and a MySql database setup on one of my other liunx serves. Everything seems to be working fine, here comes the but...

Maybe I've missinterprted the usage. In additon to sharing between multiple Tivos, I assumed I could use this method for saving off recorded shows to the MySql DB as an alternative storage mechanism and then retrieve at will. I can't get this to work, here is what I've done as a test.

Exported to remote DB, everything appears fine from your PHP stuff (as in the exported shows appear in the external tables). I then delete the saved show on my Tivo, refresh the local table on the remote DB and then try to import the recently exported show. The import fails with a "failed to find file ......ty", even though it still appears in the remote table.

Ideas? or did I missunderstand the intended usage and it is only for sharing and not as an extension of storage space?

Thanks for any help you can provide.

brian

Enigma
11-04-2002, 02:16 PM
Originally posted by brianw
First, just like to say thanks for the work you've done, the idea of centralized storage for recorded shows is exactly what I've wanted from the Tivo from the beginning.

I'm currently using my SA Tivo for this effort, it's now wireless, Tivoweb, and your PHP package.

Got yor stuff all installed and a MySql database setup on one of my other liunx serves. Everything seems to be working fine, here comes the but...

Maybe I've missinterprted the usage. In additon to sharing between multiple Tivos, I assumed I could use this method for saving off recorded shows to the MySql DB as an alternative storage mechanism and then retrieve at will. I can't get this to work, here is what I've done as a test.

Actually, this is exactly what I developed it for. I only have 1 Tivo, but it always full and there are many shows that I would like to archive on a long term basis. Since I have 300 GB of RAID 5 on my file server, I decided to use this method rather than adding additional space to my Tivo. Transferring between Tivos is just a side effect of the intent of the original package.

Exported to remote DB, everything appears fine from your PHP stuff (as in the exported shows appear in the external tables). I then delete the saved show on my Tivo, refresh the local table on the remote DB and then try to import the recently exported show. The import fails with a "failed to find file ......ty", even though it still appears in the remote table.

Ideas? or did I missunderstand the intended usage and it is only for sharing and not as an extension of storage space?

Click the episode name on the remote shows page and it will bring up the episode detail page. The value of Mfsids on this page should be a space-delimited list of the paths to the TY files. If it is not, you can edit the episode to fix it. It seems like somebody else reported this problem as well, I may be having problems pushing the shows to the remote table. You can check /var/log/php.log (default) and /var/log/import.log to if there was a problem moving the show to the remote table when it is exported. On a local show, the Mfsids attribute is set to the mfsids of the show, and on a remote show it is set to the file paths. If for some reason the script that moves the shows between the tables (putlist-run.php) isn't getting the list of files from mfsqueue_export it could cause the behavior you are seeing.


Thanks for any help you can provide.

brian

brianw
11-04-2002, 03:35 PM
Thanks for the info, I'll check it out this evening and let you know the results. Just for clarifications sake, deleteting a recording from the Tivo and then refreshing the local table to reflect the deletion should have no negative impact on importing the previously exported show correct? i.e. the MFSids stored in the local table are not needed for import, they get recreated via the import process, yes?

Enigma
11-04-2002, 03:46 PM
Originally posted by brianw
Thanks for the info, I'll check it out this evening and let you know the results. Just for clarifications sake, deleteting a recording from the Tivo and then refreshing the local table to reflect the deletion should have no negative impact on importing the previously exported show correct? i.e. the MFSids stored in the local table are not needed for import, they get recreated via the import process, yes?

Yes, that's correct. You don't even need to delete the previous show to test it, you will just have 2 shows that look pretty close to the same (hopefully). The dev version stores even more info, to the point where it can be difficult to tell the shows apart without looking directly at MFS.

brianw
11-06-2002, 09:08 PM
Still no joy, log files don't enlighten much other that to say "File not found......"

I believe that the problem is the remote mount. Where do you actually mount the remote file system. The /mnt/playback/export directory did not exist on the Tivo, I created it. Tried to manually mount the exported dir on the remote system but without NFS on the Tivo I don't know how to do it. I am correct in assuming that you use MySql to store show info and that you write the files to the remotely mounted disk right?

I think the problem is the remote mount but I'm currently stuck.

Any ideas would be greatly appreciated.

Thanks

Enigma
11-08-2002, 01:11 AM
Unless you have some big-ass partitions on your Tivo, you are going to need to have a remote disk mounted somehow. I use NFS, it's fairly easy to set up and it seems pretty stable. I have tried SMB for the Tivo in the past, but never had good results with it, YMMV.

brianw
11-08-2002, 10:23 AM
Ok, I've found NFS 2.0.1.o for TiVo. My system is running kernel 2.1.24-TiVo-2.5 and TiVO Software 3.0-01-1-010. Is this the setup your are running and do I need anything else to get NFS up and running on the TiVo. (Like Portmap, lockd, statd - I haven't been able to find them anywhere and I think I need then to do NFS as a client). Sorry if this is easy stuff, I don't get an opportunity to do a lot with Linux.

Enigma
11-08-2002, 11:20 AM
Is this the setup your are running and do I need anything else to get NFS up and running on the TiVo. (Like Portmap, lockd, statd - I haven't been able to find them anywhere and I think I need then to do NFS as a client).

AFAIK, all you need on the Tivo is the module. If you have a known working NFS server, just do the following:

insmod -f nfs-2.0.1.o
mount -t nfs <server ip address>:/path/to/your/files /mnt/playback/export

and you should be good to go.

pythag
04-23-2003, 12:38 PM
As corruptdb's site seems to have been down for a while (I think he's busy doing other things at the moment) I've posted a snapshot of his page + files at:

http://www.whitakernet.com/corruptdb/

...just incase anybody has been trying to get hold of these recently.

Once the main site is back up this will probably be removed so don't bookmark it!!!

M.

kalex
04-30-2003, 08:59 PM
Nevermind i figured out this problem. had to change nowShowingFunctions.php line to point to /tivoweb-tcl instead of /var/hack/php/tivoweb-tcl


Question i have now is there anyway to increase the speed of export from tivo to nfs mount? its not going as fast as it should.



thanks


alex

Just installed all the components with nfs and mysql. Little problem. I think i just got a brain fart but i can't figure out how to export the shows to the nfs mount. I clicked on PHP Module, I can display tivo shows as well as external shows (which are empty cause i haven't moved anything over yet. If i click on Display Import Queue I get WARNING: could not open import queue file. If i click on Export status i get:

INTERNAL SERVER ERROR
--cut here--
action_mfsexportstatus '/' ''
cat: /tmp/mfs_queue_last: No such file or directory
while executing
"exec cat /tmp/mfs_queue_last"
(procedure "::action_mfsexportstatus" line 30)
invoked from within
"::action_$action $chan $part $env"
("eval" body line 1)
invoked from within
"eval {::action_$action $chan $part $env}"
--cut here--


Am i missing something? Can somebody point me in the right direction?

thanks


alex

kalex
05-02-2003, 08:42 AM
Hi,

i finally got everything working. problem i'm having is its very slow to extract. When i use mfsstream from tivoweb i get 1.5 megs a second transfer speed. however when i run export from WebPHP my speed seems to be around 300Kb per second alot slower than 1.5 megs that i get otherwise. is there any way to improve this? What speeds do others see on this? btw i have sony t-60 dtivo with turbonet card.



thanks


alex

mpauley
05-02-2003, 08:52 AM
Your best bet is to use Mfs_FTP.

mickey

kalex
05-02-2003, 09:12 AM
mpauley,

thanks will try that. webphp is pretty cool though so i wanted to get it working right and fast.


alex

Enigma
05-02-2003, 09:15 AM
WebPHP just uses Tridge's mfs_export, it should not be any slower than any other method. Try doing the nfs mount with options rsize=8192,wsize=8192,noatime

kalex
05-02-2003, 09:26 AM
Enigma,

thanks for reply. do u mind giving me the full command with options? rightnow i'm mounting

mount motherload:/tivo_nfs /mnt/playback/export how would i put in the options? Also does it matter if i run nfs 2.0.1 or should i be running nfs 2.5 for dtivo?


thanks


alex

mpauley
05-02-2003, 09:27 AM
Enigma is correct (BTW, where have you been hiding?), but your using a NFS mount which is slower than an FTP transfer in my opinion.

mavrcksd
05-10-2003, 11:57 PM
Originally posted by Enigma
AFAIK, all you need on the Tivo is the module. If you have a known working NFS server, just do the following:

insmod -f nfs-2.0.1.o
mount -t nfs <server ip address>:/path/to/your/files /mnt/playback/export

and you should be good to go.

________________________________________

First I do the insmod -f nfs-2.0.1.o
then I'm trying to do the mount command like above, however i'm getting the following

mount: RPC: port mapper failure - RPC: unable to receive

vexorg
05-26-2003, 09:08 PM
i see this thread is a little old but i've not found the answer yet. and i'm no good at php yet.

got webphp installed and working with the mysql database. The locomation.php gave me an error but a simple change to the config file and got past that. now i get this error:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/hack/php/include/locomotion-mysql.php on line 212

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/hack/php/include/locomotion-mysql.php on line 214

far as i can tell $handle is not being defined so these two lines are failing. i'm not sure if this is the right place to ask. is there a home page for either webphp or LocoMotion?

EvilJack
08-18-2003, 08:22 PM
Has anyone done anything with WebPHP lateley?

I installed this version ( I think it's the latest )
WebPHP-0.94-0-BETA-1044248958.tar.gz
and found some major problems right off the
bat.

I had to add the lines
$config['logfile'] = '/var/log/WebPHP';
$config['exportTy'] = 'file';

to the config file
and
had to rename a table/column from RecordingBehavior.BehaviorId to
RecordingBehavior.RecordingBehaviorId
before the php stuff would run at all.

Now, it kind runs and I exported a show to
several .ty files....

Now I'm not sure what to do.

Before I pull any more hair out... has anyone
else had better luck with this. Maybe a different
version or some other site that talks about this.

I hope to be able to export a show to a
remote PC for off-Tivo Storage and then
either put the files back on the same tivo or
my other tivo ( both are SA 1 type boxes )
I think that's what this stuff is supposed to do...
I think that is....

Thanks - EvilJack