Categories

  • Apple (15)
  • Coding (4)
  • del.icio.us (14)
  • General (136)
  • Life (10)
    • Remodel (1)
  • Politics (16)
  • Project Steamroller (1)
  • Spam (11)
  • Sysadmin (9)
  • Tech/Geek (15)
  • Uncategorized (52)

Ye Olde Posts

  • March 2010 (1)
  • January 2010 (3)
  • December 2009 (1)
  • November 2009 (1)
  • October 2009 (2)
  • September 2009 (1)
  • August 2009 (3)
  • July 2009 (3)
  • June 2009 (2)
  • May 2009 (2)
  • April 2009 (1)
  • March 2009 (4)
  • February 2009 (2)
  • January 2009 (1)
  • December 2008 (1)
  • September 2008 (1)
  • July 2008 (1)
  • May 2008 (5)
  • April 2008 (2)
  • March 2008 (9)
  • February 2008 (5)
  • January 2008 (6)
  • December 2007 (7)
  • November 2007 (2)
  • October 2007 (6)
  • August 2007 (7)
  • July 2007 (2)
  • June 2007 (3)
  • May 2007 (3)
  • April 2007 (8)
  • March 2007 (8)
  • February 2007 (10)
  • January 2007 (3)
  • December 2006 (2)
  • November 2006 (1)
  • October 2006 (2)
  • August 2006 (2)
  • July 2006 (2)
  • June 2006 (2)
  • May 2006 (5)
  • April 2006 (2)
  • February 2006 (1)
  • January 2006 (2)
  • December 2005 (2)
  • November 2005 (2)
  • October 2005 (3)
  • September 2005 (1)
  • August 2005 (1)
  • July 2005 (3)
  • June 2005 (3)
  • May 2005 (1)
  • April 2005 (1)
  • March 2005 (1)
  • February 2005 (4)
  • January 2005 (1)
  • December 2004 (3)
  • October 2004 (3)
  • July 2004 (1)
  • April 2004 (5)
  • March 2004 (5)
  • February 2004 (5)
  • January 2004 (3)
  • December 2003 (2)
  • November 2003 (9)
  • October 2003 (5)
  • September 2003 (4)
  • August 2003 (3)
  • July 2003 (2)
  • June 2003 (8)
  • May 2003 (5)
  • April 2003 (4)
  • March 2003 (10)
  • February 2003 (25)
  • January 2003 (12)

Monthly archives for July, 2005

How I wifi-enabled my Tivo

Jul05
2005
Leave a Comment Written by Craig

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

  1. You can connect it to an external modem, and have the Tivo use that for calls
  2. You can have the Tivo establish a PPP link directly over the serial cable, without dialling
  3. 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.

Posted in Tech/Geek
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail

MAKE interview

Jul05
2005
Leave a Comment Written by Craig

MAKE magazine interviewed Gordon and me and the podcast is now available.

Posted in Tech/Geek
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail

Special guest blogger: TJ

Jul01
2005
Leave a Comment Written by Craig

Heading into the long weekend, we have a special guest blogger today.

When in the Course of human events, it becomes necessary for one people to dissolve the political bands which have connected them with another, and to assume among the powers of the earth, the separate and equal station to which the Laws of Nature and of Nature’s God entitle them, a decent respect to the opinions of mankind requires that they should declare the causes which impel them to the separation.

We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness.–That to secure these rights, Governments are instituted among Men, deriving their just powers from the consent of the governed, –That whenever any Form of Government becomes destructive of these ends, it is the Right of the People to alter or to abolish it, and to institute new Government, laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect their Safety and Happiness. Prudence, indeed, will dictate that Governments long established should not be changed for light and transient causes; and accordingly all experience hath shewn, that mankind are more disposed to suffer, while evils are sufferable, than to right themselves by abolishing the forms to which they are accustomed. But when a long train of abuses and usurpations, pursuing invariably the same Object evinces a design to reduce them under absolute Despotism, it is their right, it is their duty, to throw off such Government, and to provide new Guards for their future security.–Such has been the patient sufferance of these Colonies; and such is now the necessity which constrains them to alter their former Systems of Government. The history of the present King of Great Britain is a history of repeated injuries and usurpations, all having in direct object the establishment of an absolute Tyranny over these States. To prove this, let Facts be submitted to a candid world.

  • He has refused his Assent to Laws, the most wholesome and necessary for the public good.
  • He has forbidden his Governors to pass Laws of immediate and pressing importance, unless suspended in their operation till his Assent should be obtained; and when so suspended, he has utterly neglected to attend to them.
  • He has refused to pass other Laws for the accommodation of large districts of people, unless those people would relinquish the right of Representation in the Legislature, a right inestimable to them and formidable to tyrants only.
  • He has called together legislative bodies at places unusual, uncomfortable, and distant from the depository of their public Records, for the sole purpose of fatiguing them into compliance with his measures.
  • He has dissolved Representative Houses repeatedly, for opposing with manly firmness his invasions on the rights of the people.
  • He has refused for a long time, after such dissolutions, to cause others to be elected; whereby the Legislative powers, incapable of Annihilation, have returned to the People at large for their exercise; the State remaining in the mean time exposed to all the dangers of invasion from without, and convulsions within.
  • He has endeavoured to prevent the population of these States; for that purpose obstructing the Laws for Naturalization of Foreigners; refusing to pass others to encourage their migrations hither, and raising the conditions of new Appropriations of Lands.
  • He has obstructed the Administration of Justice, by refusing his Assent to Laws for establishing Judiciary powers.
  • He has made Judges dependent on his Will alone, for the tenure of their offices, and the amount and payment of their salaries.
  • He has erected a multitude of New Offices, and sent hither swarms of Officers to harrass our people, and eat out their substance.
  • He has kept among us, in times of peace, Standing Armies without the Consent of our legislatures.
  • He has affected to render the Military independent of and superior to the Civil power.
  • He has combined with others to subject us to a jurisdiction foreign to our constitution, and unacknowledged by our laws; giving his Assent to their Acts of pretended Legislation:
  • For Quartering large bodies of armed troops among us:
  • For protecting them, by a mock Trial, from punishment for any Murders which they should commit on the Inhabitants of these States:
  • For cutting off our Trade with all parts of the world:
  • For imposing Taxes on us without our Consent:
  • For depriving us in many cases, of the benefits of Trial by Jury:
  • For transporting us beyond Seas to be tried for pretended offences
  • For abolishing the free System of English Laws in a neighbouring Province, establishing therein an Arbitrary government, and enlarging its Boundaries so as to render it at once an example and fit instrument for introducing the same absolute rule into these Colonies:
  • For taking away our Charters, abolishing our most valuable Laws, and altering fundamentally the Forms of our Governments:
  • For suspending our own Legislatures, and declaring themselves invested with power to legislate for us in all cases whatsoever.
  • He has abdicated Government here, by declaring us out of his Protection and waging War against us.
  • He has plundered our seas, ravaged our Coasts, burnt our towns, and destroyed the lives of our people.
  • He is at this time transporting large Armies of foreign Mercenaries to compleat the works of death, desolation and tyranny, already begun with circumstances of Cruelty & perfidy scarcely paralleled in the most barbarous ages, and totally unworthy the Head of a civilized nation.
  • He has constrained our fellow Citizens taken Captive on the high Seas to bear Arms against their Country, to become the executioners of their friends and Brethren, or to fall themselves by their Hands.
  • He has excited domestic insurrections amongst us, and has endeavoured to bring on the inhabitants of our frontiers, the merciless Indian Savages, whose known rule of warfare, is an undistinguished destruction of all ages, sexes and conditions.

In every stage of these Oppressions We have Petitioned for Redress in the most humble terms: Our repeated Petitions have been answered only by repeated injury. A Prince whose character is thus marked by every act which may define a Tyrant, is unfit to be the ruler of a free people.

Nor have We been wanting in attentions to our Brittish brethren. We have warned them from time to time of attempts by their legislature to extend an unwarrantable jurisdiction over us. We have reminded them of the circumstances of our emigration and settlement here. We have appealed to their native justice and magnanimity, and we have conjured them by the ties of our common kindred to disavow these usurpations, which, would inevitably interrupt our connections and correspondence. They too have been deaf to the voice of justice and of consanguinity. We must, therefore, acquiesce in the necessity, which denounces our Separation, and hold them, as we hold the rest of mankind, Enemies in War, in Peace Friends.

We, therefore, the Representatives of the united States of America, in General Congress, Assembled, appealing to the Supreme Judge of the world for the rectitude of our intentions, do, in the Name, and by Authority of the good People of these Colonies, solemnly publish and declare, That these United Colonies are, and of Right ought to be Free and Independent States; that they are Absolved from all Allegiance to the British Crown, and that all political connection between them and the State of Great Britain, is and ought to be totally dissolved; and that as Free and Independent States, they have full Power to levy War, conclude Peace, contract Alliances, establish Commerce, and to do all other Acts and Things which Independent States may of right do. And for the support of this Declaration, with a firm reliance on the protection of divine Providence, we mutually pledge to each other our Lives, our Fortunes and our sacred Honor.

Posted in Politics
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail

Translate

EnglishFrenchGermanItalianPortugueseRussianSlovenianSpanish

Search

Recent Comments

  • Craig on On the efficiency of Virtual Machines
  • flickr.com/photos/jm on On the efficiency of Virtual Machines
  • jmason on Neat. A new way to track website visitors!
  • jmason on On the time domain, with regard to spam
  • pooya on Interesting Tivo trivia bit

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

EvoLve theme by Blogatize  •  Powered by WordPress Craigalog
Craig's musings