Auffie’s Random Thoughts

Thursday, May 28, 2009

Watchdog for asterisk

I've been mulling over designing a watchdog circuit for my asterisk (open-source telephony) process that runs on my linux server. My current safety mechanism consists of a relay that connects a vanilla telephone directly to the POTS line in the event of a power failure. However, if the operating system crashes, there is no way to switch the relay automatically as in the case of power failure.

There are several ports out of my old linux box that I can use to communicate to the outside world: a RS-232 serial port and a couple of USB ports. The RS-232 serial port is taken by the UPS, so it's out of consideration. USB is too complex and probably requires some expensive parts just to get started (cf. this article on linuxfocus.org).

There is another possibility: the sound card. Since the server doesn't care for outputting music or other sounds, I can program a watchdog process to monitor asterisk and output a tone, say every minute. If the operating system crashes, there will be no such notification tones. A timer circuit can then turn on the relay to enable the vanilla telephone.

I'll need a LM567 (or equivalent) tone decoder and a 555 timer for this purpose. A simple 567 circuit is found here. The timing function can be implemented by this circuit using a 555. To generate the tones through the sound card, this is probably the way to go.

Will update when I actually construct the circuit and make it work.

UPDATE 2009-06-01: Don't forget a flyback diode (1N4148?) across the relay!

UPDATE 2009-06-05: NightFire Electronic Kits looks like a good place to get the parts I need.

Labels:

Friday, May 22, 2009

Credit cards and guns

Only a law that comes out of the U.S. Congress can have something to do with both.

Thursday, May 21, 2009

Defining prodigyhood downward

Eight-year old Ethan Bortnick appeared on Jay Leno's Tonight Show two days ago. Since he was introduced as a prodigy pianist, I was curious to see how he would fare. Well, he was a talented boy, as he sang and played a song he composed for Leno. He also had a nice jazzy sense of music. But as far as technical accomplishment is concerned, I would not call him a prodigy.

This one was a real prodigy: accompanying a Beethoven violin sonata at five, and 32 Beethoven piano sonatas at ten; in addition to other talents than music.

Thursday, May 14, 2009

Mark Steyn: Live Free or Die

A must-read from Mark Steyn on Hillsdale College's Imprimus.

Wednesday, May 06, 2009

Phase-locked loops

I was listening to Henryk Szeryng's performance of Beethoven's Sonata No. 7, with pianist James Tocco, at the 1979 Salzburg Festival.  And I was thinking about electronic circuits at the same time.  Then an obvious fact dawned on me that musicians in an ensemble constantly employ feedback processes to stay in sync—not unlike a phase-locked loop.

Now I know why I can't count when I play the violin with a pianist.  My phase-locked loop is broken, sometimes a sort of positive feedback results: difficult passages in which the piano part gallops through many notes (supposedly steadily) makes me nervous and speed up, causing instability.

Friday, May 01, 2009

Excerpts from the Patriot Post, Vol. 09 No. 17, 1 May 2009

From the 'Court Jesters' File: Accidental Shooting Ruling

The Supreme Court also ruled this week on a case involving a robbery during which the perpetrator accidentally fired his gun. He claimed that the automatic 10-year sentence for firing a weapon during a crime was too harsh for something that was an accident. The Court disagreed. Mandatory minimum sentences are another can of worms, but we agree with Chief Justice John Roberts, who pointed out that if criminals wanted to avoid the penalty for firing the gun, even by accident, they should "lock or unload the firearm, handle it with care during the underlying violent or drug trafficking crime, leave the gun at home or -- best yet -- avoid committing the felony in the first place."

Funnier still is the dissent, written by Justice John Paul Stevens and joined by Stephen Breyer, which said, "Accidents happen, but they seldom give rise to criminal liability. Indeed, if they cause no harm, they seldom give rise to any liability. The court today nevertheless holds that petitioner is subject to a mandatory additional sentence -- a species of criminal liability -- for an accident that caused no harm." Call us crazy for pointing it out, but these are two of the justices who dissented from last year's Heller ruling, which affirmed the Second Amendment right to keep and bear arms. In other words, they are in the unusual position of defending a criminal who accidentally fired a weapon during a crime while maintaining that law-abiding citizens have no right to own a firearm.

The leftist judges have to go. But sadly, BHO will replace them with ones even more left leaning.

A Fly and a Flea in a Flue

Found this funny verse by Ogden Nash.

A fly and a flea in a flue
Were imprisoned, so what could they do?
     "Let us fly," said the flea
     "Let us flee," said the fly
So they flew through a flaw in the flue.