Since I moved my T1 line from the old house to the temporary one, for some reason my Vonage link has become seriously worse. Connection quality if flakey, as though packet latency had gone way up or something. It could be that my QoS stuff is not doing the right thing any more or something, but in any case, my Tivo refuses to succesfully make its outbound daily calls any more. But I figured that it’s just trying to make a PPP connection to a dialup ISP somewhere, then surely transfers the data over some TCP/IP channel, so I figured if I could just get my Tivo onto my LAN, everything would be peachy.
I did some digging around, and discovered that I was right in my hypothesis. Now the trick is: how to get the Tivo onto my LAN. There are a range of crack-open-the-box solutions, but I’m not interested in cracking open the box. Luckily, the Tivo has a serial port on it, intended for use as a way to plug in an IR tranceiver (so the Tivo can control a cable box). The Tivo even conveniently comes with a serial cable to plug in there. It turns out that you can have the Tivo use this serial port a couple of ways
- You can connect it to an external modem, and have the Tivo use that for calls
- You can have the Tivo establish a PPP link directly over the serial cable, without dialling
- You can get a debugging console on the Tivo over this serial port
Now the second of these is the most useful here. If I could connect the other end of the serial cable to something which could run a PPP daemon, then route from that thing onto my LAN, I’d be all set. The trouble is, I don’t have any computers anywhere near my TV/Tivo setup.
Luckily though, I do have ready access to lots of gumstix and the various add-on cards it can use. So I screwed a connex card to a waysmall board (with 2 serial ports) and a cfstix into which I added a netgear MA701 wifi adapter. I recompiled the gumstix kernel to include PPP support plus all the iptables/routing stuff I needed, compiled pppd and iptables userspace apps too, disabled all the bits I didn’t need (to keep filesystem size down), and then was ready to go. Connected the Tivo IR serial port to the Tivo-supplied cable, and hooked that to a gumstix serial cable, and plugged it into the non-console serial port on the waysmall board. Plugged the whole setup in, and then logged in to the gumstix via SSH over the wifi (I had configured wlan0 to auto-up on my LAN). Then some tinkering with pppd options and reading through Tivo hacking websites, and I came up with the following script, which I placed in /etc/init.d/S99tivopppd on the gumstix:
#!/bin/sh # # Start the PPP Deamon for Tivo.... # start() { echo "Starting pppd..." /bin/echo 1 > /proc/sys/net/ipv4/ip_forward /usr/sbin/iptables-restore < /etc/tivo.iptables /usr/sbin/pppd /dev/ttyS2 115200 persist noauth passive local deflate 15 bsdcomp 15 nocrtscts nodefaultroute mru 1492 mtu 1492 10.0.241.1:10.0.241.2 } stop() { echo -n "Stopping pppd..." killall pppd } restart() { stop start } case "$1" in start) start ;; stop) stop ;; restart|reload) restart ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac exit $?
/etc/tivo.iptables is just:
# Generated by iptables-save v1.2.11 on Sat Jun 4 18:12:49 2005 *nat :PREROUTING ACCEPT [55:6836] :POSTROUTING ACCEPT [0:0] :OUTPUT ACCEPT [7:823] -A POSTROUTING -o wlan0 -j MASQUERADE COMMIT # Completed on Sat Jun 4 18:12:49 2005
this enables NAT from any interface (ie ppp0 when it comes up) onto the wifi LAN. Starting the /etc/init.d/S99tivopppd script, I now have a pppd daemon on the gumstix which waits for the Tivo to connect. On the Tivo side, configure the dial options to use the dial prefix “#211″ and it will then not dial a number, but instead use pppd directly on the serial port (which is what the “#2″ means), and connect at 115200 (which is what the “11″ means). I then initiated a test call on the Tivo while watching /var/log/messages on the gumstix, and lo! It worked!
tivostix kern.notice pppd[470]: pppd 2.4.1 started by root, uid 0 tivostix kern.info pppd[470]: Using interface ppp0 tivostix kern.notice pppd[470]: Connect: ppp0 < --> /dev/ttyS2 tivostix kern.warn pppd[470]: LCP: timeout sending Config-Requests tivostix kern.notice pppd[470]: local IP address 10.0.241.1 tivostix kern.notice pppd[470]: remote IP address 10.0.241.2 tivostix kern.info pppd[470]: LCP terminated by peer (User request) tivostix kern.notice pppd[470]: Connection terminated. tivostix kern.info pppd[470]: Connect time 1970.8 minutes. tivostix kern.info pppd[470]: Sent 98388 bytes, received 15238 bytes.
Not sure exactly why it’s reporting such a long connect time for the PPP link — I guess it looks like it’s actually reporting the time from when the pppd on the host side started, rather than the time when ppp was actually connected, and the connection only happens every so often. Anyway, this seems to be working pretty good, for a while now. I have an uptime of 16 days on the tivostix, with record of 16 succesful daily calls in /var/log/messages — one about every 27 hours.

Recent Comments