# html Remote



## telemark

I have a few devices that can't run a Tivo remote, so I made a basic remote that runs from a cgi web server, and is controllable by most web browsers.

The codebase is really small and simple so anyone should be able to customize.

Requires:
Perl
CGI webserver on home network
Backend tested on OS X and BSD
Frontend tested on Chrome, Safari, iOS

TODO:
Build in web server
FrontEnd:
- Redo Image
- Keyboard shortcuts

v2:
- Multi Tivo Support (up to 2 units)
- TV passthru Support (up to 2 models) 
- Add ABCD keys
- Closed Captioning
- Optional debugging

The frontend UI would be at:
http://webserver/htmlremote/ or
http://webserver/htmlRemote/index.html

The backend API calls are:
http://webserver/htmlRemote/trTIVO.cgi?ircode=NUM2
http://webserver/htmlRemote/trTV.cgi?ircode=MUTE

trTIVO defaults to localhost, either edit it with a hostname/ip. 
Or to utilize autodiscovery, leave as is and install wmcbrine's rproxy.

To enable TV control, grab the scripts for your TV model. http://www.tivocommunity.com/tivo-vb/showthread.php?t=518917
Edit trTV.cgi with the path to the scripts.
Edit trTIVO.cgi to enable.


----------



## wmcbrine

TV Power, Input, Vol +/- and Mute are good places to reclaim space -- although it's possible to send these codes to the TiVo, they don't actually do anything, except get logged. (A real peanut just sends them as IR codes directly to the TV.)


----------



## telemark

Yeah, I was debating about that.

The IR and BT Tivo remotes I have still trigger the Tivo's orange light when using Volume. I was wondering if it resets some activity indicator, which might not be used, or is this used on the Mini timeout?

In any case, I'm thinking of adding pass-thru support for IP controllable TV's. I think I'll try a couple brands and if it works well, I'll leave it in. And if it's problematic, I'll take it out and reclaim the pixels.


----------



## nooneuknow

telemark said:


> Yeah, I was debating about that.
> 
> The IR and BT Tivo remotes I have still trigger the Tivo's orange light when using Volume. I was wondering if it resets some activity indicator, which might not be used, or is this used on the Mini timeout?
> 
> In any case, I'm thinking of adding pass-thru support for IP controllable TV's. I think I'll try a couple brands and if it works well, I'll leave it in. And if it's problematic, I'll take it out and reclaim the pixels.


TiVos do use inactivity sensing to tell when it should be safe to do things without prompting the user. This is done by a timer on last remote activity, which is precisely why TV control commands are also sent to the TiVo.


----------



## telemark

I've been running with TV control for a week so it's stable enough to release:

v2 added:
- Multi Tivo Support (up to 2 units)
- TV control pass-through support (up to 2 models) 
- ABCD buttons
- Closed Captioning buttons
- Optional debugging

Release is in first post.


----------



## qlude

Awesome! Looking forward to trying this out.


----------



## mjbok

This is awesome work. Exactly what I'm looking for, I think....


----------



## mjbok

If the remote image had a clear background it could be easily implemented into other pages seemlessly.


----------



## mjbok

Or are both the same, but 2 has the additional options?


----------



## mjbok

Is there something that needs to be added for the API calls? You list a path for it.


----------



## mjbok

I edited the cgi file and put in my ip address for my Tivo, but am getting no response after hosting it on my webserver.


----------



## wmcbrine

mjbok said:


> I edited the cgi file and put in my ip address for my Tivo, but am getting no response after hosting it on my webserver.


Did you enable network remote control on the TiVo? It's off by default.


----------



## mjbok

wmcbrine said:


> Did you enable network remote control on the TiVo? It's off by default.


I checked and network control is indeed on and I can send telnet commands from my PC so I know that part works.


----------



## mjbok

I put the files (attached below) into my var/www folder. I did a sudo chmod +x trIRCODE.cgi command.

The webpage comes up with the remote image, but the buttons trigger no actions

The IP address is correct.

Any help would be greatly appreciated

//I had to zip the files because it would not allow me to attach a CGI or HTML file


----------



## stealthdave

I actually built a page once that used standard http calls to send the IR codes to the TiVo directly from Javascript rather than going through an external cgi script to translate to a telnet call. Had it working on my TiVoHD and a hacked Series 1. Unfortunately, this project was lost in the Great Data Loss of '14. (2 drives in a RAID simultaneously! ARGH!!!) Of course, I never got around to publishing it publicly, and I can't find any docs for HTML access online, so I can 't reproduce it.

If you can find the HTML commands, you can eliminate the need for a web server and cgi entirely by using a JSONP call instead of AJAX. You don't even need a full JSONP implementation since you don't require a response back:



Code:


var irSend = document.createElement('script');
irSend.src = tivoLink + '/some?key=' + irCommand;
irSend = null; // cleanup

Makes the whole thing very compact, but I can't for the life of me find the original references.

- Dave


----------



## gonzotek

stealthdave said:


> I actually built a page once that used standard http calls to send the IR codes to the TiVo directly from Javascript rather than going through an external cgi script to translate to a telnet call. Had it working on my TiVoHD and a hacked Series 1. Unfortunately, this project was lost in the Great Data Loss of '14. (2 drives in a RAID simultaneously! ARGH!!!) Of course, I never got around to publishing it publicly, and I can't find any docs for HTML access online, so I can 't reproduce it.
> 
> If you can find the HTML commands, you can eliminate the need for a web server and cgi entirely by using a JSONP call instead of AJAX. You don't even need a full JSONP implementation since you don't require a response back:
> 
> 
> 
> Code:
> 
> 
> var irSend = document.createElement('script');
> irSend.src = tivoLink + '/some?key=' + irCommand;
> irSend = null; // cleanup
> 
> Makes the whole thing very compact, but I can't for the life of me find the original references.
> 
> - Dave


Are you sure this was possible on a TiVoHD? I *thought* the html command interface was a function of TiVoWeb (or TiVoWebPlus), which never made it to Series3 and above machines (and only some S2s). I'd love to be wrong!


----------



## stealthdave

gonzotek said:


> Are you sure this was possible on a TiVoHD? I *thought* the html command interface was a function of TiVoWeb (or TiVoWebPlus), which never made it to Series3 and above machines (and only some S2s). I'd love to be wrong!


On the Series 1 it _was_ absolutely a function of TiVoWebPlus. (I miss that app!) The more I search, though, I think I may be misremembering it working on the TiVoHD. Which is too bad; that would be pretty darned convenient.


----------



## telemark

Sorry I missed this question, it got buried behind other threads.

I think mjbok's problem might have stemmed from running the code on a public web server. This means the back-end can't reach a Tivo through a NAT router without port forwarding. It's best to run the back-end on a home server.

I thought about rewriting this with WebSockets but it seemed less common than cgi.


----------



## solutionsetc

telemark said:


> I made a basic remote that runs from a cgi web server, and is controllable by most web browsers.
> 
> v2:
> - Add ABCD keys


What are the IRCodes for these keys? I am also looking for 'Back' and 'Zoom' keys as well.

Thanks!


----------



## wmcbrine

solutionsetc said:


> What are the IRCodes for these keys? I am also looking for 'Back' and 'Zoom' keys as well.


Hint: My Network Remote is open source...


----------

