Linux NQC for the Lego Spybotics Brick

When Frys was dumping Lego Spybotics hardware a while back for $29, quite a few DRPG people grabbed one or two of them. So we have a whole pile lying around and nobody knows quite what to do with them. The Spybotics brick is a bit more limited than the original RCX brick and, to make matters worse, they come with a Windows-only “visual” programming environment. I’ve been setting up programming environments on a Linux box at the DPRG Lab for various microcontrollers and wanted to figure out something useful we could do with all our Spybotics bricks.

I had wired my brick up to one of the Linux boxes and started experimenting when Ed Paradis noticed it and we got to talking. It turns out he’s been doing some work on robot swarm behaviour using Spybotics robots. He suggested we try Not Quite C. NQC compiles C-like source to the Lego bytecode format used by the RCX and Spybotics bricks. This is cool because you can write code in a familiar language. Ed gave me a copy of v2.5 and I started playing with it. There is also a newer version 3.0 but it’s still beta and didn’t compile on Linux or OS X. After a little hacking on the makefile and code, I got 3.0 to compile just fine. (patch submitted to the maintainers of course!)

Like most converted toys, the Spybotics units are not exactly ideal for real robotics use. They lack any sort of sensors that would allow odometery and, after a couple of weeks of trying, we could find no way to make them go in a straight line or do any sort of remotely accurate dead reckoning. On the other hand, a minor hardware hack turned the optical serial link used for programming into a tolerable line-following sensor. And the robot-to-robot IR communication makes them a cheap way of playing with swarm behaviours.

I’m told this month’s issue of Circuit Cellar includes an article on hacking the I2C bus on the Spybotic’s motherboard to allow more sensors. If it’s not too much work, this could make them a lot more useful.

The demise of Red Hat Linux

We’ve run Red Hat Linux on our servers since version 5. Now we’re contemplating what distro to use in the future since Red Hat has announced the end of Red Hat Linux. They will continue to make their high-end Enterprise Linux but it’ll cost $1500 – $2500 per server per year. And they’re using security updates as a sort of legal loophole that lets them get around the GPL and prevents you from buying one copy of the software and installing it on multiple servers. Supposedly, you can still download the source but if I wanted to compile a whole GNU/Linux system from source, I wouldn’t be using a distro like Red Hat in the first place.

I installed Fedora on a test box to evaluate it but it’s clearly not intended for serious use in a production environment. It’s intended as a bleeding-edge distro for “enthusiasts and developers” only. From what I can tell, it’s just a new name for Red Hat’s beta distro, Rawhide. Even if someone wanted to use it on a server, it would be impossible – each release is only good for about three months before it’s replaced by a new one and support for the old one is dropped. We don’t even reboot our servers every three months and I sure don’t want to be reinstalling the OS every three months! And then there’s the issue of Red Hat trying to trademark the Fedora name and essentially steal it from an existing project.

The only good news on the Red hat front lately is Fedora Legacy, a project that will attempt to offer security patches and support for Red Hat Linux 9 after Red Hat abandons it in April. Looks like we’ll stick with that until we can find a new distro. And if some new distro springs up to take it’s place, I think they’re going to be a lot of takers. I know a lot of folks in the same situation we’re in who relied on Red Hat Linux. It’s really hard to believe Red Hat did something this stupid. They’ve effectively found a way to do what none of their competitors had been able to – reduce Red Hat’s market share drastically.

Buying a Mini-ITX

After playing with the VIA Technologies Mini-ITX board for the robots.net review, I decided to buy one and put together a system for NCC to try out as a Linux server. I immediately ran into a problem – it’s hard to find anyplace to buy one. We normally buy our hardware through Tech Data, a large national distributor or through ASI, a somewhat smaller distributor that specializes in hardware produced in Asian countries. Neither carries VIA Technologies products. I tried a number of local hardware distributors without luck and finally ended up with the local Frys store as the only option. Frys is fine for some things but it’s not a place I like to buy anything mission critical like a server motherboard. But I convinced myself it couldn’t be that much of a risk and picked up a Mini-ITX M10000 board at the Irving Frys Wednesday morning.

Immediately upon opening the box, I realized I was in trouble. The motherboard was not in an anti-static bag and didn’t have the pink anti-static mat under it like the demo we reviewed, it was just lying in the bottom of the cardboard box. It was missing assorted jumpers and a few other parts. And the bottom of the board had several discolored areas of the type caused by severe overheating. I was pretty sure it was toast but connected it to a power supply and monitor to make sure. Yep, it was dead.

Upon further examination, I noticed a couple of square white stickers on the outside of the box that looked like some sort of Frys quality control info. They had handwritten dates and several paragraphs of fine print about manufacturers warranties and such. A couple of lines into the first paragraph of the second sticker was the phrase “this product may have been returned”. Yikes. Someone had bought this board, toasted it, returned it to Frys, and they’d put it back out on the shelf with the new products.

Back at Frys, I attempted to return the board and get an actual new, unopened, unreturned, untoasted one. It took a little work to get them to take it back. At first they said I couldn’t return it because I hadn’t brought back the anti-static bag and the CD (I hadn’t even noticed the missing CD until now). I pointed out that it was also missing some jumpers and was completely dead. The Frys’ return clerk decided to check another box from the shelf and see what was in it. Interestingly, the box he pulled was missing the CD, the ATX back plate, and the cables. Turns out he did exactly what I did. He grabbed a box from the shelf thinking it was new but it had the well-hidden “this is a defective return product” blurb on it. This convinced him to give me a refund.

I checked the shelf but all four of the remaining M10000 boxes were returns. Yesterday I drove out to the really big Frys in Arlington and they had about ten VIA Mini-ITX boards. I found a total of four M10000 that weren’t customer returns and bought one of them. I looked around at some of the other motherboards and it looks like it’s SOP for Frys to mix defective customer returns in with new products on the same self. Most reputable stores have a special section where they offer customer returns at a discount.

Anyway, the new board was just like the demo we reviewed; well packed, anti-static bag, all the parts were there, and it fired right up the first time and ran beautifully. In the end, I guess there are two morals to the story. 1) Be careful when buying motherboards at Frys and 2) VIA Technologies needs to work on getting their product into normal distribution channels like Tech Data and ASI.

Mini-ITX Boards

I’ve been catching up on my ToDo list the last couple of weeks. Most of it was boring work-related stuff. But among the fun things, I finally got the review of VIA Technologies Mini-ITX board posted on robots.net. The board will now pass on to the DPRG where it will hopefully end up in a robot or be put to some other equally creative use. I liked it so much, I think we may buy a couple of Mini-ITX boxes to try out as Linux servers at NCC. If nothing else, they make a lot less noise than our new Dell 1750 does.

I also managed to put a few more fixes and patches into my fork of the mod_virgule code and released a new version today. The libxml2 patch has been in place since the last release and has working pretty well. I added some minor cosmetic fixes today to make the XML output nicely formatted again. I also incorporated a patch from James Henstridge that add RSS link elements for diaries.

To get away from the computer for a while this afternoon, we went to an exhibit of Martha E. Simkins paintings at the Irving Arts Center.

Staring at the Sun and other Follies

As I got on the highway driving home last night, I was heading west and looking right into the sun around sunset. This is fairly normal. What isn’t normal is that there was a solar eclipse going on. A fairly amazing one with about a quarter of the sun’s disc covered. Yeah, yeah, I know, I’m not supposed to look directly at the sun. But it’s unavoidable when the sun is that low in the sky and you’re driving straight towards it. Besides, how can looking at 75% of the sun be any worse than looking at 100% of the sun which I have to do on most days?

Anyway, it confirms my theory about astronomical events. The more they are hyped, the less worthwhile they are to see. Things like Halley’s comet which was hyped all my life as supposedly being the most amazing thing that man would ever see, turned out to be so obscure that you could look right at it and not even know if you saw it or not. Most other highly promoted astronomical events turn out to be a similar waste of time. I’ve seen many previous solar eclipses that were allegedly “the last eclipse that will be seen in 20,000 years, etc. etc.” (and used appropriate filters to look at them, of course). They were all rubbish. And usually, if you read the fine print, they’re really saying something like “the last eclipse that will be seen in 20,000 years that covers exactly 63.5% of the sun and can be seen on a Tuesday in the month December during the Reagan administration” or somesuch.

The really spectacular things I’ve seen in the sky I usually don’t hear much about before hand. Like the eclipse last night that I had no idea about until I saw it. Or a couple of years ago when I watched an event that turned out to be the most amazing thing I’ve ever seen in the sky – the nighttime re-entry of a space shuttle over Texas. I just happened to see something on the local news about it and we walked outside a few minutes later and there it was.

The other interesting event today is that Microsoft found some goofy “think tank” that it could pay to issue a “study” claiming that all us Open Source and Free Software folks are a bunch of communists out to destroy the American way of life by standing up to poor, helpless corporations like Microsoft. I’d never heard of the “Alexis de Tocqueville Institution” prior to this but it appears to be one of those a “money for bogus research” places. The author seems to barely even grasp what software is, so it’s hard to take seriously his opinion that sharing my source code with others is a threat to the free world. As people stop laughing at the thing, I suspect a few rebuttles will be springing up across the web. The Roaring Penguin already has one up.

The Outer Limits of Server Maintenance

Today I’m bringing down zanti, our Sun Ultra10 that runs Red Hat Linux 6.2. It’s main job is being a PostgreSQL server. Zanti has been up for 597 days but now it’s time to do some major upgrades. I’ll probably switch it back to Solaris as well since Red Hat no longer supports the Sparc distribution of Linux. All our Intel servers run Red Hat Linux and all our Sparcs (except zanti) run Solaris. The interesting part will be getting a current version of PostgreSQL runnning on it after Solaris 8 is installed. There are no PostgreSQL binaries available for Solaris, so I’ll have to build it from source which is always a pain on Solaris boxes. Overall I’d prefer to stick with Linux. It’s a sad day but, then, zanti always was a misfit.