Sunday, October 17, 2010

TiVo Serial Null-Modem Networking on Windows Vista and 7

The original series 1 TiVo used a built-in modem to connect to the internet to download program guide and channel listings. A few years ago, I wanted to use my cell exclusively and get rid of my home phone service. To do this, and keep my TiVo, I would have to find another way for it to connect to the internet.

Fortunately, with version 3.0 of the TiVo software (the last update for the original series 1 TiVos), they added a feature that would allow you to use the serial port to connect either to an external modem, or use a null modem cable and bypass a modem entirely.

Connecting the TiVo to your computer to use its internet isn't difficult, but the process depends upon which operating system you run. This post will focus on the setup for Windows Vista/7. For Ubuntu Linux directions, you can read this post I wrote on the ubuntu forums. If you are on Windows XP, follow the directions listed here.

Windows 7 is very similar to the Windows XP setup, but there are some important differences which I want to talk about here.

So, before you begin, you will need four things.
  1. The TiVo serial cable. It should have been included with your TiVo. One end will have a 9-pin serial connector and the other end will have a stereo jack connector.
  2. A Null Modem cable. I think you need female->female, but you should check the ends and make sure they fit. I bought mine at a local electronics supply shop.
  3. A NAT router (any wireless router should work).
  4. A computer with a serial port (a lot of newer computers don't have them anymore - mine did). A usb->serial port should work, but I haven't tried this.
 Connect the TiVo serial cable to the Null modem cable. Plug the stereo jack into the TiVo in the serial port (NOT the I/R port) and plug the null modem cable into the serial port on your computer.

Start a command prompt with Administrator privileges. Change to the C:\windows\system32\DriverStore\FileRepository directory. Inside there, there is a directory that starts with mdmhayes.inf, and the rest will depend on which version of Windows 7 you have, so just use tab completion to switch into that directory.

We need to take ownership of this directory and the files inside it.

takeown /F mdmhayes.inf /A
takeown /F mdmhayes.PNF /A
takeown /F . /A

Note the dot (period) in the last one indicating the current directory.

Next we need to open this directory in Windows Explorer. Select the mdmhayes.inf directory inside C:\Windows\System32\DriverStore\FileRepository and edit the properties. You need to add Full Control permissions, either to Everybody or to Administrator.

Do the same thing for the two files mdmhayes.inf and mdmhayes.PNF inside this directory. Once you have done that, delete both files. I know that's a long process just to delete two files, so if you can figure out a better way, please let me know.

Now open the C:\Windows\Inf directory in Windows explorer. Delete the files mdmhayes.inf and mdmhayes.PNF from there as well. These files aren't guarded by Windows SYSTEM, so they're easier to get rid of.

Download the file mdmhayes.zip and unzip it to find a new mdmhayes.inf file. Copy this file into both directories (C:\Windows\inf and C:\Windows\System32\DriverStore\FileRepository\mdmhayes.inf_something).

Edit: DO NOT USE THE MDMHAYES.ZIP FILE ON 32-BIT WINDOWS 7. IT IS NOT THE RIGHT DRIVER AND WILL MAKE IT VERY DIFFICULT TO GO BACK TO THE RIGHT ONE. I WILL PUBLISH BETTER DIRECTIONS FOR 32-BIT WINDOWS 7 LATER (soon I hope).

Empty the recycle bin (we must purge the old copies or they will haunt us) and reboot Windows.

Now we can add our incoming connection. Open Control Panel and search for modem. Click on the Phone and Modem panel. Enter an area code if it asks for one. On the control panel, click the modems tab and click add modem. Check "Don't detect my modem; I will select it from a list". When it brings up the list, choose the "Communications cable between two computers". Select the appropriate COM port if more than one is available (COM1 is likely).

Click on Properties for the modem and set the max port speed to 115200. In the advanced tab, select Default Properties and set Flow Control to NONE.

Now we are ready to setup the incoming connection. Go back to Control Panel and search for Network. Open the Network and Sharing Center and click on Change Adapter Settings. Press Alt-F to open the file menu and select "New Incoming Connection". Select the communications cable between two computers as the connection medium and when you get to IPv4 settings hit properties and setup your IP addresses. I have never had it work by it trying to use DHCP, so ymmv. Try it if you like. On the Users page, make sure the Guest account is selected.

Now click on Properties for the Incoming Connection and click on the Users tab. Make sure Allows Allow Directly Connected Devices is checked. That's it on the computer side. Now let's go setup the TiVo to use the Null Modem connection.

On TiVo, go to Phone Settings, and under Dial Prefix, select ,#211 (that's COMMA, POUND, TWO, ONE, ONE). The rest of the settings shouldn't matter, as this prefix is used to tell TiVo we're using a Null Modem and therefore phone settings are irrelevant. Test out the new settings and see what happens. If a test call works, then try a daily call. If you followed the directions, it should all be up and working now.

One piece of troubleshooting advice: I've had some routers that wouldn't route addresses that are in the DHCP range if the DHCP server didn't give them out. You may need to use an IP range inside your subnet that's not part of the DHCP set. You'll have to look elsewhere for how to do this.

Most of this information was culled from two sources
http://www.b-lan.com/otto/tivo3xp/
http://www.sems.org/entry.asp?ENTRY_ID=187

The first are the directions for Windows XP. It also has screenshots and more information than I have listed here, so check if out if you need more information. The second page told me how to modify the process for Windows Vista/7. The idea about takeown to get access to the Windows DriverStore SYSTEM protected files came from google. Specifically, I forget. Sorry. Thanks whoever you were who suggested that.

Saturday, January 30, 2010

SSH is a versatile tool

I had no idea SSH was so versatile. I moved to a new apartment a few months back. It comes with shared internet service for the complex. The speed is decent; not what I was getting, but you get what you pay for, so I was more or less satisfied.

My first big problem was that I no longer had access to the router. This meant I couldn't forward ports to give me remote access to my machine. I'd read about VoIP services that had a failsafe for machines that couldn't directly connect. They would connect them both to a central server, and connect them together from there.

This is when I first learned about reverse SSH tunnels. I already knew about normal tunneling. I'd been using that for years to connect to VNC servers. Now I found out you could also use SSH to setup a reverse tunnel. You connect to a ssh server and create a tunnel back to your own machine. I tested it for awhile and it worked great. There's even a simple program to monitor the tunnel to ensure connectivity: autossh. Works great in tandem with gentoo keychain.

More recently, I stopped being able to go to my website from my apartment. I thought at first it was the server, so I contacted my provider. They said it was running the daily backup and they were planning to move to a newer machine soon. Over the next couple weeks, I noticed the problem never went away. Moreover, this problem only manifested from inside my apartment. Not from my work, or my parents, or any wifi hotspot I tried. When I talked to my web host about this, he suggested the problem may be reverse DNS lookup trouble. I think he's right, and I've sent this information to my apartment's internet support people. I hope they can fix it.

Coinciding with this problem, my laptop had an issue with the power supply and I had to deliver it to Best Buy for a replacement. During this time, I had to use a machine at work on a very restricted network. So I started looking into setting up a proxy server to get around the restrictions. I tried to install dante, but something in the configuration was never right, and I never got it to work. I was about to give up when I learned of another neat thing SSH can do. It can act as a SOCKS5 proxy. With the right configuration, all my web requests from firefox now went through my SSH proxy.

I got my laptop back from Best Buy, but I thought about the proxy idea again when I got home. This could be (at least temporarily) a solution to my networking troubles at home. Again, it worked perfectly. Until they solve the reverse DNS issue, I can at least connect through the proxy and have full access to my web server.

Hooray for SSH.