1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

TiVo UI Control via Telnet - No Hacking Required!

Discussion in 'TiVo Underground' started by Omikron, Apr 30, 2008.

  1. Nov 2, 2010 #501 of 692
    PacinoScar

    PacinoScar New Member

    7
    0
    Nov 2, 2010
    is there a program where i can run a remote control on my laptop? pls forgive me i just just found this thread today and only got through 7 pages so far so if someone could help that would be great
     
  2. Nov 2, 2010 #502 of 692
    PacinoScar

    PacinoScar New Member

    7
    0
    Nov 2, 2010
  3. Nov 2, 2010 #503 of 692
    ThAbtO

    ThAbtO TiVoholic by the bay

    6,738
    8
    Apr 6, 2000
    SF Bay Area

    Try reading back up a few replies to post #496, at the bottom is 'Tivo Remote' click on it.

    but, I see you only have 4 posts, and you need 10 to be able to see links.

    Note: This only works on Series 3/HD/HDXL/premiere and not on any Series 2 or earlier.
     
  4. Nov 2, 2010 #504 of 692
    wmcbrine

    wmcbrine Ziphead

    10,368
    22
    Aug 2, 2003
    http://github.com/wmcbrine/tivoremote

    It's covered in the first seven pages (although not that URL).

    BTW, thinking that the thread is too long is a poor reason to make it longer.
     
  5. Nov 8, 2010 #505 of 692
    uspino

    uspino New Member

    7
    0
    Oct 13, 2008
    I'm trying to set up my Hauppauge HD-PVR to send a command line channel change to the TiVo. The HD-PVR can start an external application or command line bat file, and adds the channel number as a command line parameter to trigger the channel change.

    Is there a way I can get this to work? I've tried a simple bat script to telnet into the TiVo, but my programming skills are not good enough. Basically I need something like this:

    telnet 192.168.0.181 31339 SETCH %%%, whereas the %%% number is manually set as a command line parameter.

    Help please!
     
  6. Dec 9, 2010 #506 of 692
    uspino

    uspino New Member

    7
    0
    Oct 13, 2008
    OK I'm answering myself here. For anybody interested, I created a small vbs script that can be run with the channel number as argument. Just run "tivo.vbs 602" from a command prompt, or a shortcut in windows, and it will telnet into your Tivo and change channel to 602. You only need to modify the script with your Tivo's internal address.

    I'm new to this, so the script is not very elegant (it quickly opens and closes a DOS window). If anybody can make it a little better or less intrusive, it would be greatly appreciated.

    I've also made myself a simple but effective Windows Gadget using Launch Control (you can find version 1.6 in Windows Live Gadget Gallery). You can just add shortcuts to the tivo.vbs script with the channel number as argument, change the icon to that of a channel, and you have a nice Windows 7 Gadget remote. You can also add shortcuts to buttons (Live TV, et.) by editing the script accordingly.

    Here's the script (copy and paste into Notebook and save as "tivo.vbs"):


    '********************************************
    ' Name: Batch Telnet Script for TiVo & HD-PVR
    ' Description: Change channels in TiVo via command line
    ' by executing this tivo.vbs followed by the channel number
    ' as command line argument.
    ' By: uspino
    ' (c) 2010
    '**************************************
    '
    'Use argument parameter as channel number
    '
    Dim ArgObj, var1
    Set ArgObj = WScript.Arguments
    Set WshShell = WScript.CreateObject("WScript.Shell")
    var1 = ArgObj(0)
    '
    '
    'Create the shell object
    set oShell = CreateObject("WScript.Shell")
    '
    'Start up command prompt
    oShell.run"cmd.exe"
    WScript.Sleep 50
    '
    'Send keys to active window; change the IP address to that of your TiVo. Keep the port number.
    oShell.SendKeys"telnet 192.168.1.153 31339"
    'Emulate the enter key
    oShell.SendKeys ("{Enter}")
    WScript.Sleep 50
    '
    'Send the channel number to TiVo
    oShell.SendKeys"SETCH "
    oShell.SendKeys var1
    oShell.SendKeys("{Enter}")
    WScript.Sleep 50
    '
    'Exit and close window
    Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}")
    Set objProcess = objWMI.InstancesOf("Win32_process")
    For each Process in objProcess
    If (instr(1,lcase(Process.name),lcase("telnet.exe")) > 0) then
    Process.terminate 0
    End If
    Next
    oShell.SendKeys"exit{ENTER}"
    oShell.SendKeys("{Enter}")
    oShell.SendKeys"% "
     
  7. uspino

    uspino New Member

    7
    0
    Oct 13, 2008
    The script ended up being complicated and unreliable, and I never liked the fact that it opend and closed a DOS window. So with the invaluable help of some nice folks at the AutoIt forums, I wrote an extremely simple application that does exactly what I wanted. This is the code:

    TCPStartup()
    $fp = TCPConnect($CmdLine[1], $CmdLine[2])
    Sleep(300)
    TCPSend($fp, "SETCH " & $CmdLine[3] & @CRLF)
    Sleep(300)
    $ack = TCPRecv($fp, 40)
    TrayTip("TiVo Channel Change", $ack, 10, 0)
    Sleep(2000)
    TCPShutdown()

    I compiled it into an exe (both 32 & 64bit) that can be downloaded here:

    megaupload.com/?d=FEIJBUXC

    To make sure that anybody else with a TiVo can use it, I used command line arguments for all the variables:


    Usage:
    EXE + Yout TiVo LAN IP address + Telnet Port Number (usually 31339) + Channel Number

    Example:
    C:\TivoChannelChanger.exe 192.168.1.153 31339 689

    Your TiVo (located at 192.168.1.153 and accessed through port 31339) will change to channel 689 and you will see a small and short confirmation bubble on the Windows tray.

    If you happen to have an HD-PVR for Media Center recording, here's how the Regsitry looks like:

    [HKEY_LOCAL_MACHINE\SYSTEM\PSWTuner\HCW49SWT\Blaster]
    "ActiveBlaster"=dword:00000002
    "ExtAppArgs"="192.168.1.153 31339 %c"
    "ExtAppName"="C:\\TiVoChannelChanger.exe"
    "FlushOnChannelChange"=dword:00000000
    "IntOpenMode"=dword:00000001
    "PauseOnChannelChange"=dword:00000000
     
  8. ThAbtO

    ThAbtO TiVoholic by the bay

    6,738
    8
    Apr 6, 2000
    SF Bay Area
    This is quite limited to just changing channels when there is a lot more commands available.
     
  9. uspino

    uspino New Member

    7
    0
    Oct 13, 2008
    I know, but it's all I needed. AutoIt is an outstanding freeware programming tool. If you look at the code in my post, it's so simple that there's plenty of things that can be done with just a few changes or additions. I encourage everybody to modify it to their needs.

    I've created myself a small TiVo Remote Gadget for Windows 7 using Launch Control v1.6 gadget. It gives me access to my 5 news channels (with station logos) and basic playback/guide functions.


    [​IMG]
    upload image
     

    Attached Files:

  10. uspino

    uspino New Member

    7
    0
    Oct 13, 2008
    Here's a slightly different version. It reads the IP address and Port Number from an INI file (the INI file has to be in the same directory). Once you modify the INI file with your IP and Port (31339), you can use it with 2 line arguments, like this:

    C:\TivoRemote.exe SETCH 689 (Changes TiVo to Channel 689)
    C:\TivoRemote.exe IRCODE PAUSE (Pause button on TiVo remote)
    C:\TivoRemote.exe IRCODE FORWARD (Forward button on TiVo remote)
    C:\TivoRemote.exe IRCODE LIVETV (LiveTV button on TiVo remote)

    ...and so on. The application is as small as it can be. It provides a 2-second bubble with feedback on the Windows tray only when the SETCH command is used, so you can visually verify the change. Again, anybody can now build a TiVo Remote Gadget in Windows 7 using the Gallery Gadget I mentioned in the previous post, with shortcut to channels and/or buttons.

    For anybody interested, here's also the AutoIt source code:

    $WORKINGDIR = @ScriptDir ; Reads INI file from same directory as EXE file
    $var1 = IniRead($WORKINGDIR & "\TiVoRemote.ini", "TiVo LAN IP and Port Number", "IP", "IP Address Not Found in INI file") ; Reads IP from INI file
    $var2 = IniRead($WORKINGDIR & "\TiVoRemote.ini", "TiVo LAN IP and Port Number", "Port", "Port Number NotFound in INI file") ; ; Reads Port from INI file

    TCPStartup() ; Opens Telnet Connection
    $fp = TCPConnect($var1, $var2) ; Telnets TiVo at provided IP and Port Number

    TCPSend($fp, $CmdLine[1] & " " & $CmdLine[2] & @CRLF) ; Sends Commands to TiVo
    Sleep(390) ; Allows time to TiVo to return Local and Remote Channel Status
    $ack = TCPRecv($fp, 40)

    If $CmdLine[1] = "SETCH" Then ; Provides Windows Tray Bubble Feedback only on channel change
    TrayTip("TiVo Channel Change", $ack, 10, 1)
    Sleep(2000) ; Gives tray bubble 2 seconds to disappear
    TCPShutdown()
    Else
    TCPShutdown()
    EndIf
    Exit


    And here's the 32 and 64-bit EXE files, the necessary INI file and TiVo's PDF with the full list of commands.

    http://www.megaupload.com/?d=GAX49JNB
     
  11. wmcbrine

    wmcbrine Ziphead

    10,368
    22
    Aug 2, 2003
    OK, I'm now back to using KEYBOARD for direct text on the Premiere (only), IRCODE elsewhere. Also, for those who haven't followed the discussions in the HME board: It turns out that KEYBOARD does return a KEY_PRESS event to HME apps, but only if the app reports that it implements version 0.49 or later of the HME protocol. These events are very different from the IRCODE kind, and allow conveying mixed case and all symbols, just like a real keyboard. You have to send a shift key code first to get uppercase or the top-row symbols. An uppercase "A" would look like this:

    Code:
    KEYBOARD LSHIFT\r
    KEYBOARD A\r
    while a lowercase "a" would just omit the shift -- KEYBOARD itself still only takes uppercase letters.

    In addition to A-Z and NUM0-9, the accepted key names for KEYBOARD are (I think) as follows:

    Code:
    MINUS
    EQUALS
    LBRACKET
    RBRACKET
    BACKSLASH
    SEMICOLON
    QUOTE
    COMMA
    PERIOD
    SLASH
    BACKQUOTE
    SPACE
    CAPS
    LSHIFT
    RSHIFT
    LCONTROL
    RCONTROL
    LMETA
    RMETA
    KBDUP
    KBDDOWN
    KBDLEFT
    KBDRIGHT
    PAGEUP
    PAGEDOWN
    HOME
    INSERT
    BACKSPACE
    DELETE
    KBDENTER
    ESCAPE
    LSHIFT applies only to the next character; CAPS will shift into that mode until called again. Some of the codes are redundant with regular TiVo keys. Only about half of the symbols are defined -- the lower half. So, to send a question mark, you'd send LSHIFT, SLASH. For a plus sign, LSHIFT, EQUALS. CAPS does not modify symbols.

    The lower-half symbols also work with IRCODE (and I've incorporated them into the direct text support for S3 and HD). I've had some mixed results while trying to use shift with IRCODE, but the bottom line is that it's not usable right now. (I'm still hoping that KEYBOARD will make its way to the S3 and HD.)

    Version 0.24 of my remote program also fixes an issue where tabbing once to get to the text entry field no longer worked in Tk (since 0.20) -- reported by "MelSmith" -- and turns the "macro" keys from hardwired functions into a tuple, "MACROS".
     
  12. wmcbrine

    wmcbrine Ziphead

    10,368
    22
    Aug 2, 2003
    Now in addition to the symbols listed above, I'm finding all kinds of interesting new IRCODEs. I'm not sure when these were introduced, but they're available at least as far back as 11.0b:

    Code:
    CC_ON
    CC_OFF
    Direct closed-caption toggling! No more pulling up the Info screen to do it.

    Code:
    ASPECT_CORRECTION_FULL
    ASPECT_CORRECTION_PANEL
    ASPECT_CORRECTION_ZOOM
    ASPECT_CORRECTION_WIDE_ZOOM
    Direct Zoom mode setting. This is the only way to change the aspect from within the YouTube viewer, for example. (Finally! Yes, it works.) Also of note is "WIDE_ZOOM" -- available only via this code, AFAIK. It's an irregular stretch mode, where the sides of the picture are more distorted than the center.

    There are a bunch more that are less interesting to me, like "VIDEO_MODE_FIXED_480i" (etc.), and "TUNER_SWITCH", but I haven't tested them yet.
     
  13. StanSimmons

    StanSimmons Senior Moment Member

    4,717
    0
    Jun 10, 2000
    Flower...
    "VIDEO_MODE_FIXED_720p" would sure fix the problem I've been having where my crappy HDMI switch keeps knocking my TiVo's back to 480p.

    I tried modifying an existing 'macro' of yours, but never could get the timing to be consistent when going thru 4 or 5 menu screens to get to the Video Output Format screen.
     
  14. dswallow

    dswallow Save the ModeratŠ¾r TCF Club

    50,977
    31
    Dec 3, 2000
    Long...
    I swear I'm just about to lost it completely with the morons running TiVo. To implement this feature which was requested since day 1 of the HD DirecTV units appearance, and to not even provide a way for the user to access it is just, well, maddening.
     
  15. mjh

    mjh Re: Member

    613
    0
    Dec 19, 2002
    Thank you so much for tivoremote. It's working fantastically except for a couple of things related to keyboard shortcuts - which I have become addicted to.

    Questions:
    1. Space doesn't seem to be pausing for me. What I press the pause button in the GUI, it works as expected. But I've come accross some odd behavior when I'm watching live TV. Spacebar should just pause the program but it doesn't. Instead it does two things:
      1. The TiVo will pause the current program
      2. The TiVo will go to the prev channel displayed (unpaused)
      It does this consistently, and I can't figure out anyway to just pause Live TV using a keyboard shortcut.
    2. When I'm looking at the guide using the standard remote, if I press (for example) 2enter, the guide will take me to channel 2 (or whatever's closest to it, like 2-1) in the guide w/o actually changing the channel. But in tivoremote, that will change the channel to channel 2 (or whatever's closest to it) and the guide will disappear. Is there some way to mimic the "2enter" behavior that the standard remote does in tivoremote?

    Thanks.
     
  16. wmcbrine

    wmcbrine Ziphead

    10,368
    22
    Aug 2, 2003
    Is that mine you're talking about, or Jeepguy's, or something else? You should also mention what kind of TiVo(s) you have. Oh, and what OS you're using.

    Assuming it's mine: I can't reproduce your issues. However, I'll just remind you that the keyboard shortcut for the remote's "Enter" key is not, as one might expect, "Enter" (because that's mapped to "Select"), but rather "." (because that was available). If you entered a channel number in the guide and then pressed Select (Enter) instead of Enter (.), you might see what you're seeing.

    But I have no explanation for what you're seeing with the space bar.
     
  17. wmcbrine

    wmcbrine Ziphead

    10,368
    22
    Aug 2, 2003
    The WIDE_ZOOM mode is actually kind of awful, so I can see why they'd leave it out. The interesting thing is that they did make it available via the network interface.

    My guess is that, with the one-button interface to the Zoom modes, having to cycle through as many as three modes to get to where you wanted was just too much, and WIDE_ZOOM was easily the most expendable, to bring the Zoom button down to a reasonable level of inconvenience to use.

    As for why they included it at all, I suspect it's a feature of the chipset.
     
  18. Jan 1, 2011 #518 of 692
    wmcbrine

    wmcbrine Ziphead

    10,368
    22
    Aug 2, 2003
    I wanted to highlight this, because I didn't really notice it until last night, when I finally looked at uspino's archive. TiVo has released official documentation! Did anyone else know this? The PDF is here:

    http://www.tivo.com/assets/images/a...CP_Network_Remote_Control_Protocol_073108.pdf

    I'm not sure when this happened -- the file itself is dated 2008, but this page, which links to it, seems to date it July 2010.

    It doesn't cover anything we didn't already know (although it would have, if I hadn't just found CC_ON etc. by looking for strings in tivoapp -- after uspino posted this, but before I noticed it), nor does it cover direct text input. But still, it's nice to see it officially.
     
  19. Jan 1, 2011 #519 of 692
    wmcbrine

    wmcbrine Ziphead

    10,368
    22
    Aug 2, 2003
    I did find one inaccuracy in the PDF:

    Well, yes, that's how it should work. But I think it would be more correct to say:

     
  20. Jan 2, 2011 #520 of 692
    mjh

    mjh Re: Member

    613
    0
    Dec 19, 2002
    Yes sorry. Didn't realize there were forks. As far as the other things you requested:

    TiVo HDXL (stock)
    Windows 7 Professional (running as non-admin)

    Also, I'm using Python 2.7.1 as availble here: http://python.org/download/

    The Readme says that this is tested on 2.3 through 2.6. I suppose I could backup to 2.6.x and see if this makes a difference.
     

Share This Page