new bits for the raspberry pi

Some inexpensive Raspberry Pi supporting components were delivered today from Amazon. They included a pair of Kootek 5V 2A universal micro USB chargers to provide power to the R-Pi boards, a pair of Edimax EW-7811 150 Mbps 11n WiFi USB adapters, and a pair of clear SB Raspberry Pi cases. I also picked up a pair of Samsung PRO SDHC UHS-I cards. I hate to say it, but the Samsung SDHC cards provide the best read and write performance of any SDHC card I’ve used so far (Sandisk and Toshiba are the other two brands I’ve tried). Those other cards are fine in my cameras, but for this use case, Samsung wins hands down. I’m also happy with the Edimax WiFi adapters. They worked first time and allowed me to move off the wired network cable I’d been using (into a hub and WiFi repeater).

I thought I was also going to get some newer and better connecting wires, but Amazon said, basically, they couldn’t ship the parts. I got on Amazon tonight and ordered a different vender’s (along with some more bits and pieces). Hopefully they’ll be in by Friday (the whole order qualified for Amazon Prime).

Before putting the R-Pi cards in their new enclosures, I’d tried the much larger and looser red Bud enclosure. While it certainly gave a lot of room, it didn’t hold the card stable, and this was a problem, especially when removing the SDHC card from the bottom edge.

The Bud case was great for using clips on the connector, but in the end I’ve decided to use the better fitting SB case and use a better way to connect to the on-card connector. Live and learn.

One other lesson learned: never buy from Radio Shack again. I went there for the clips and wires, but they charged far more than I thought it was worth. The store staff were nice and the service was nice, but The Shack can’t compete against Amazon, unfortunately. There’s two other on-line stores that sell Arduino and R-Pi components, and I’ll be trying them out in April. Along with Parallax. Especially Parallax.

One Reason Why I’m Doing This

I have all sorts of reasons for doing this, from the noble to the ridiculous, but one very good reason can be summed up as performing “miracles with minimals,” a phrase I hadn’t heard in a long time until I ran across it while reading an article on The Space Review (Rocket science on a shoestring). Over the decades we’ve gotten so spoiled by ever increasing processing power, and unfortunately, power consumption. Right now, for $35, I have on a credit-card-sized circuit board a computer that rivals what I had back around 1996, an SGI Indigo2. The Indigo2 I had was the first generation in the teal case. It came equipped with a 200MHz R4400 MIPS, 256MB of very expensive memory, and a 36GB hard drive (which was and still is a reasonable amount of storage). It ran IRIX, SGI’s version of Unix. It cost thousands. The case was as big as a desktop IBM PC. I loved it.

Here I am, nearly 20 years later, working with a computer that is a fraction of the size, cost, and power consumption of that SGI machine. It’s an ARMv6 architecture RISC (the R4400 MIPS is a RISC chip), with 512MB of memory, a video processor with resolution that matches, if not exceeds, what was in the case, an 8 GB SDHC drive, wireless networking, 1920 x 1080 resolution with 32-bit color, etc, etc, etc. And it runs cool to the touch. And I love it, for the same essential reason I loved that SGI.

The fact that it runs at room temperature and is cool to the touch is mind boggeling.

We take so much in resources these days. We’ve become so fat and spoiled (present company included). It’s good to be reminded I don’t need a kilowatt computer to do interesting work. And it’s good to be reminded just how far technology has advanced over the last 20 years. And why you shouldn’t spend too much (in some cases, way too much) on them. Our software, like ourselves, is way too bloated, having grown fat on massive diets of transistors in the form of memory and transistor budgets that are now in the billions/chip. We really need to back up and rethink how we want to build computers and write software, before we run out of energy to power them and resources to build them. This little R-Pi, with its ARM chip, shows a better way for the future.

raspberry pi + arch linux + node.js + express + jade

I’ve been working with Node.js on the Raspberry Pi, particularly with regards to the web application framework Express and the page template engine Jade. My past experiences with web tools like these goes back to the late 1990s with Microsoft’s early IIS and ASP pages, IE 4, msxml 0.8 and Microsoft’s initial Dynamic HTML implemention, through plain old Apache 1.0 with Perl, to Tomcat and JSP pages and Ruby on Rails to Node.js and Express and Jade with a side trip to EJS.

I’ve been following a tutorial titled “Creating a basic site with Node.js and Express” to create an initial application. Interestingly enough, even though the tutorial was written back in April 2011, it was still reasonably up to date. I had one deprecated call in app.js (replacing “app.use(express.bodyParser())” with “app.use(express.json())” and “app.use(express.urlencoded())”) and one error in a Jade template file (replace “!!! 5” with “doctype html” in views/layout.jade). Once those minor fixes were in place I was able to start up my very simple Node web server and have it deliver the sample page (see below) to my various home devices on my internal home network. You see a screen capture on the Nexus 7 2012 running Opera. If I’m going to use Node on my R-Pi, then I’m going to make full use of it. The screen capture above shows the system resources via htop in the upper left window, and the simple Node application with logging running in the upper right window.

As usual everything is behind a firewall.

My reason for digging into this part of Node is to build a web interface into the i2c and onoff Node modules, and thus the Raspberry Pi’s I/O capabilities. My next release of my Arch Linux image will contain all of this (though not necessarily the final web interface into the Raspberry Pi’s I/O), hopefully this weekend. I will only update the graphic image, not the base image.