• Aucun résultat trouvé

Hack 48 Accept a PPP Connection from TiVo on Your PC

Just getting the TiVo to run PPP over its serial port is not quite enough—you need your PC to accept the call and route it to the Internet.

PPP requires two computers for the communication to work, hence the Point-to-Point moniker. We've already set TiVo up [Hack #47] as the initiating end. Now we need to get the PC to answer the call, as it were, on the receiving end and route data between TiVo and the Internet.

Assuming you already have a PC with Internet access over some sort of broadband connection (cable modem, DSL, dedicated connection, etc.), and that computer has a free serial port, you're just about there. All that's left is a little configuration.

Configuring Windows

Windows XP already has all the software it needs to make this magic happen. We are, however, going to have to coerce it to interoperate properly with TiVo.

These instructions are close, but not identical, to those necessary for Windows 2000.

Reading through these Windows XP instructions should provide enough insight into how it's done to extrapolate to Windows 2000.

Just hooking the two machines—your TiVo and PC—together doesn't magically set up a PPP connection between the two. The base question is, how are these two computers going to know when to start talking to each other?

Windows egotistically assumes that anybody connecting to it is going to say CLIENT over the serial line to get its attention. TiVo has no intention of doing so, instead preferring to send a ~ (tilde) to announce itself. One of the two is going to have to alter its expectations, and Windows is the pushover, so we'll make the appropriate adjustments there.

Launch Notepad, the simple Windows text editor, and open c:\windows\inf\mdmhayers.inf for editing. Scroll down (quite a way) until you run into a section that looks something like this:

[M2700Reg] ; Null-Modem

HKR,, Properties, 1, 00,00,00,00, 00,00,00,00, 00,00,00,00, 00,00,00,00,00,00,00,00, 30,00,00,00, 00,c2,01,00, 00,c2,01,00

HKR, Responses, "CLIENT", 1, 08, 00, 00, 00, 00, 00, 00,00,00,00 ; Server side - the client is requesting a connection

HKR, Responses, "<h00>CLIENT", 1, 08, 00, 00, 00, 00, 00, 00,00,00,00 ;

Server side - the client is requesting a connection

HKR, Responses, "CLIENTSERVER", 1, 02, 00, 00, 00, 00, 00, 00,00,00,00 ; Client side - the server has acknowledged

Slip the following between the last two lines in the block:

HKR, Responses, "~", 1, 08, 00, 00, 00, 00, 00, 00,00,00,00 ; Server side - the client is requesting a connection

HKR, Responses, "<h00>~", 1, 08, 00, 00, 00, 00, 00, 00,00,00,00 ; Server side - the client is requesting a connection

It should now look like this (inserted lines are called out in bold):

[M2700Reg] ; Null-Modem

HKR,, Properties, 1, 00,00,00,00, 00,00,00,00, 00,00,00,00, 00,00,00,00,00,00,00,00, 30,00,00,00, 00,c2,01,00, 00,c2,01,00

HKR, Responses, "CLIENT", 1, 08, 00, 00, 00, 00, 00, 00,00,00,00 ; Server side - the client is requesting a connection

HKR, Responses, "<h00>CLIENT", 1, 08, 00, 00, 00, 00, 00, 00,00,00,00 ; Server side - the client is requesting a connection

HKR, Responses, "~", 1, 08, 00, 00, 00, 00, 00, 00,00,00,00 ; Server side - the client is requesting a connection

HKR, Responses, "<h00>~", 1, 08, 00, 00, 00, 00, 00, 00,00,00,00 ; Server side - the client is requesting a connection

HKR, Responses, "CLIENTSERVER", 1, 02, 00, 00, 00, 00, 00, 00,00,00,00 ; Client side - the server has acknowledged

Save the changed file, and you have convinced your Windows machine to expect the ~ (tilde) character TiVo is planning to send.

Next, launch Windows XP's Control Panel, and from there the Phone and Modem Options. Select the Modems tab and click the Add button to launch the Add Hardware Wizard. You'll be asked whether you wish the Wizard to detect your modem, as shown in Figure 4-1.

Figure 4-1. The Add Hardware Wizard asking whether or not it should detect your modem

Since we're not actually using a modem, check the "Don't detect my modem; I will select it from a list" checkbox and click the Next button to move on.

Your computer should chug away awhile as it compiles a list of modems from which to make your selection. When it's good and ready, the wizard will show you a list of all the modems it knows (see Figure 4-2). Under

Manufacturer, select "Standard Modem Types," and select "Communications cable between two computers"—that's our null modem connection—under Models. Click Next.

Figure 4-2. Selecting a "Communication cable between two computers"

You'll be prompted for a COM (read: serial) port, as shown in Figure 4-3. To the question "On which ports do you want to install it?," choose "Selected ports." Then highlight the COM port to which you wired your TiVo. Click Next, and Windows will set up the connection. It should report that all went well, leaving you to click the Finish button to leave the Wizard.

Figure 4-3. Making sure that you have the right COM port setup

The Wizard's only capable of taking care of the broad strokes; you still need to tweak and fine-tune the connection a little. Back at Phone and Modem Options, select the new "Communications cable between two computers"

connection the Wizard created and click Properties to get to all its fine-tuning knobs. Select the Modem (see Figure

4-4) tab, where you'll need to make sure that the Maximum Port Speed matches the baud rate at which TiVo is set to talk [Hack #47], then click OK.

Figure 4-4. Confirming the connection's baud rate

The modem is now set up, so you can go ahead and click the OK button back at Phone and Modem Options.

With the physical connection configured, you'll now create a network connection. From the Control Panel, select Network Connections. Up comes the Network Connections window, shown in Figure 4-5. In the Network Tasks box in the left column, click "Create a new connection" to bring up the New Connection Wizard. Click Next to begin creating a new network connection.

Figure 4-5. Network Connections, listing all the valid network interfaces currently configured

When asked what type of network connection you want, select "Set up an advanced connection." If you read the small print, you'll see you're offered a direct connection via a serial port, which is precisely what you're trying to do.

Select the option and click Next.

A dialog box asks what kind of connection you want—whether the PC is going to be receiving or sending data.

Since TiVo is going to want to make an outgoing connection when it needs to make its daily call, select "Accept incoming connections" and click Next.

When asked to choose Devices for Incoming Connections (Figure 4-6), check the "Communications cable between two computers" box. That's the "modem" you just configured. Click Next again.

Figure 4-6. Configuring the proper "modem" for use with this connection

You're not going to be setting up any kind of Virtual Private Connection (VPN), so tell Windows not to allow VPNs and click—you guessed it!—Next.

The Wizard will ask you what users are allowed to connect. Since your TiVo is only using your PC as a proxy to the Net and won't be needing any kind of user privileges on the PC, just allow the Guest user. Click Next.

Now it's time to set up Networking Software and configure the PPP interface to please TiVo. Select Internet Protocol and click Properties to bring up the Incoming TCP/IP Properties dialog box shown in Figure 4-7.

Figure 4-7. Setting up Incoming TCP/IP Properties for TiVo's direct connection

Your TiVo is expecting to use the serial connection to access your home network and the Internet. To make this possible, check "Allow callers to access my local area network." Don't worry, this isn't opening your PC to just any vagabond on the network; only the TiVo is coming in via that serial cable, nobody else.

If you have a DHCP server on your network—everybody on your home network is being assigned IP addresses by your DSL router or cable modem—then allow for TCP/IP addressing to be done automatically using DHCP by clicking the appropriate radio button. That takes the burden of configuring the TCP/IP connection off your shoulders.

If you don't have a DHCP server, just select "Specify TCP/IP addresses" and put in a range of addresses that are not already being used on your network.

Chances are, if you set up your networking as shown in Figure 4-7, you'll be fine. Click OK to close the dialog box.

Then click Next and Finish to dispatch the wizard, and you're almost done.

Go back to the Network Connections window, and you should now see a shiny new incoming connection.

Right-click on the connection and select Properties to bring up the Incoming Connections Properties. Select the Users tab and check the "Always allow directly connected devices such as palmtop computers to connect without providing a password" checkbox, as shown in Figure 4-8. The TiVo has no notion of a password.

Figure 4-8. Allowing directly connected devices to connect without a password

Last step—I promise. Select the General tab in the Incoming Connections Properties dialog, select "Communications cable," and click the Properties button to bring up the dialog box shown in Figure 4-9. Turn off flow control (select

"None"), as TiVo's serial port does not have the extra lines needed for any kind of hardware flow control, nor does it bother with software flow control.

Figure 4-9. Turning off the flow control on the new direct connection

Click OK and OK again, and you're done. Whew!