Sunday, January 22, 2006

Cabinet Blogging

If you’re wondering why my blogging has been light recently, there are two main reasons: I’ve been sick as the proverbial dog for the past few days (but now I’m recovering nicely), and I’ve been working on a humongous project. The guts of the project are pictured at right, and I’m sure nobody could figure out what’s going on from that little bit of a clue <smile>!

As usual, click on the small pictures to get a larger view.

The general point of this project is to upgrade the pitifully slow bandwidth of our Internet connection. Way out here in the boondocks of Jamul, the only choices we’ve got are dial-up and satellite. Dial-up is doggone slow, and satellite is just terrible for almost everything other than file downloading (it’s great at that!).

And there are two parts to this problem: the bandwidth that we experience, sitting in Jamul, suring the web or picking up email — and the bandwidth that our web site visitors experience. This project addresses both issues.

First, I’m locating two servers at a friend’s house (this maniac has oh-so-graciously allowed me to put all this stuff in his home!). My friend lives in El Cajon — a real city, with real services. I’ve installed a high-speed DSL connection to his home, and my two servers will be connected to that. This means that you, dear reader, should experience simply stunning speed improvements when reading this blog. This operation is scheduled to take place next Sunday, January 29th.

Second, in addition to the DSL I ran to my friend’s home, I also ran a pair of dedicated phone lines. Also in his home will be a special kind of router that will accept a pair of connections over the phone lines (doubling the normal dial-up speed) and relaying them to the DSL. At our home in Jamul, I’ve also installed two phone lines, and these will be connected full time to our friend’s home.

Saying it all like that makes it sound pretty easy — but there are some tricks here. First of all, the place my friend made available is in a somewhat dirty basement, not air conditioned. That dictates putting the equipment in a cabinet with a filtered air supply. Then when you start adding up what I mean by “equipment", you see some challenges: two servers, two routers, one dual modem router, two network switches, a DSL modem, and a UPS. Yikes!

But wait — it gets worser.

This cabinet full of tightly packed equipment will be located about a half-hour’s drive from my home. It’s not really practical to drive that far to reset a server whenever I make some change in my blog code that causes a crash. Or when any other of a zillion things happen. So I needed a way to remotely reset the servers. And taking that same thought to a (very) slightly more extreme level, I also needed to be able to power cycle the servers (sometimes a reset just doesn’t do the trick). Plus I needed to automatically manage the server shutdown and startup in the event of a power outage. And then I also need to manage the fan speeds — rather than just run them at full blast all the time (reducing their lifetime), I thought I’d monitor temperatures in the cabinet, and adjust the fan speeds automatically.

Oh, this got complicated really fast…

One saving grace: my friend’s son is a most excellent cabinet maker, just by happenstance. And he very graciously allowed me to use his shop and his skills to build a custom cabinet of my own design, just the right size to fit all my gear. Without his help (and his fantastic computer-controlled MDF-cutting machine!), this project would have been much more difficult.

The lower three pictures are various views of the controller board that I built to run the cabinet. It’s based on a Z-World Jackrabbit BL1810 board (with prototyping board), which has a processor that’s basically a seriously souped-up Z80 (and I wrote a lot of Z80 code in my day!). The pair of stacked PC boards visible in the lower-right photo are the Jackrabbit.

The rest of that mess is a piece of vectorboard with a bunch of circuitry that I designed on it. There are switches to turn the fans on and off, digitil potentiometers to control the fan’s speed, and a tachometer mux to allow all the fans to be individually monitored for speed. Temperature measurement is handled by eight digital temperature sensors, which are scattered throughout the cabinet and inside the two servers. Power control is handled by a pair of miniature hard-contact relays (with drivers); reset is handled by a pair of digital switches. The controller has its own sensing of the power mains, separately from the UPS. And of course there are LEDs (couldn’t build something like this without 'em!), and just for grins, a pair of optoelectronic reflective infrared door-open sensors. Finally, the controller has a pair of serial ports that I’m using for communications between the controller and the servers.

Whew! Just building all that hardware was a pretty big project. But then came the firmware for the controller… There’s some fairly tricky stuff in there, like a few interrupt service routines that really had to be done in assembly language (for speed) — and it’s been a few years, folks, since I’ve written any assembly language. Fortunately the old saw about never forgetting how to ride a bicycle appears to apply to assembly language coding as well. I had to re-familiarize myself with the Z80’s architecture, but within a few hours of starting I had the first ISR going. The rest of the firmware I wrote in “Dynamic C", supplied by the Z-World folks. This is a very modern and very friendly environment compared to the primitive tools I used way back when. It’s full of snazzy features and unexpected conveniences. But … it ain’t Java, and this ancient and venerable software engineer has gotten very comfortable with the cushy, safe, protected world of Java. I’ll give you just one example, which the techies amongst you will appreciate. In Java, if you intend to compare a variable 'i' with 2, you might write this code: if( i = 2 ). But that would be wrong, and it wouldn’t compile (so you’d know it immediately and fix it before you ever tried to run the program). With the C language, that code compiles just fine, and when it runs, that code will set i equal to 2 and then tell you it was equal. Yikes! I did that three times in 5,600 lines of code, and each of those took me quite a while to find. Sheesh! I miss Java!

But now the whole darned thing is working. All the hardware, all the wiring, and all the firmware — it’s all up and chunking along. Yee hah! All that’s left is configuring the network gear and servers, and that, my friends, is truly trivial compared to what I just went through with the rest of this project.

My wife is absolutely overjoyed to have this project come to an end — I believe she’s marked next Sunday on her calendar. The reason for her abundance of joy is one that I’m sure many of you will be sympathetic with: this project is being built in our livingroom. We simply have no other place to build something this large, so there it had to be. Oh, Debbie will be very, very happy to see that cabinet depart…

And so will I…

The Thing

Hah! Here’s a short post from The Big Pharaoh (a most excellent blog, BTW) that I’ve taken the liberty of posting in its entirety:

The THING!

An old Arab lived close to *New York* City for more than 40 years. One day he decided that he would love to plant potatoes and herbs in his garden, but he knew he was alone and too old and weak. His son was in college in Paris, so the old man sent him an e-mail explaining the problem:

"Beloved son, I am very sad, because I can’t plant potatoes in my garden. I am sure, if only you were here, that you would help me and dig up the garden for me. I love you, your father."

The following day, the old man received a response e-mail from his son:

"Beloved father, please don’t touch the garden. That is where I have hidden 'the *THING*.' I love you, too, Ahmed."

At 4pm the FBI and the Rangers visited the house of the old man and took the whole garden apart, searching every inch. But they couldn’t find anything. Disappointed, they left the house.

The next day, the old man received another e-mail from his son:

"Beloved father, I hope the garden is dug up by now and you can plant your potatoes, that is all I could do for you from here; Your loving son Ahmed.

We can only hope that the NSA and DHS have this much on the ball…

A Son's Farewell

Lt. Hank Harding died on March 27, 1961 when his Navy FJ-4 “Fury” crashed into the side of Otay Mountain. Bad weather and confusion at the Brown Field control tower take the blame.

Yesterday Marc Harding — Lt. Harding’s son — visited the wreckage that he only recently found out had been discovered in 1998. Read the whole thing.

From the San Diego Union-Tribune:

Harding knelt beside it, alone, for several minutes. Chunks of the plane were remarkably well preserved with the original paint, still bright, stenciled writing, clearly visible.

Eventually, the group found another large chunk of airplane wing. As they huddled around it, Harding took out of his backpack a small plaque. It had his father’s name and rank, his birthday and date of death.

"To our loving son, brother, husband, father,” it read. “We miss you so much. We will forever love you. We will never forget you."

He held it in place carefully while Dave Schurhammer, who also works with the Macha family on wreck sites, screwed it into place.

Later, after the long hike out, Harding reflected on the day’s events. He had said that placing the plaque did not necessarily close a circle for him, but after coming down from the mountain he said the effort was worth it.

"When my Dad died, he was doing something honorable,” he said. “And I wanted to honor that."

Otay Mountain is about 8 miles southwest of our home.