Raspberry Pi with little SD cards

If you have an old SD card that’s less than the 2gb needed to run the blessed Raspbian (Debian Wheezy) Linux distro made for the RPi, or like me, you had a 4gb SD card but a bad spot turned it into an 870mb SD card, fear not. If you’ve got a thumb drive you can trivially carry on. Here’s how.

First thing is to copy the image file to both devices with commands like this, after:

1) BEING SURE you substitute your /dev/paths and

2) Unmounting the card and/or thumb drive before copying images over the top of them

sudo dd if=2012-07-15-wheezy-raspbian.img of=/dev/sdk ; **>>MY<<** thumb drive

sudo dd if=2012-07-15-wheezy-raspbian.img of=/dev/sdi ; **>>MY<<**SD card

If the SD card was 64mb or better, then you should have an intact copy of the FAT filesystem on the front of your card, and if you have a current Linux system it automagically mounted . If not, mount it with something like mount -t vfat /dev/sdi1 /somepath and then cd into /somepath (or the actual filesystem typically under /media).

Edit cmdline.txt to look like this:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/sda2 rootfstype=ext4 elevator=deadline rootwait

Then cd out of this filesystem and umount it, put the card into your Raspberry Pi and the thumb drive into one of it’s USB sockets (or a hub socket) and power it up. The command line above will tell the system on the SD card to mount the root filesystem on the thumbdrive instead of trying to use the (uncopied or corrupt/incomplete) 2nd partition of the SD card.

 

Linux can’t tolerate a spewing USB device

I’ve been spending a lot of time with TI MSP430 chips using the incredibly inexpensive LaunchPad eval board. This board ships with an MSP430 chip pre-programmed with a temperature measurement demo program that immediately spews temperature readings out its UART pins, which by default are routed through the USB interface to the PC. This causes my Linux system extreme indigestion. It appears that Linux can’t properly identify and set up to interact with a USB device that mindlessly sends data at it right from the get go. I’d gotten over the severe disappointment of the incredibly powerful TI Eclipse-based Code Composer Studio IDE for the MSP430 not supporting the LaunchPad board on Linux (a classic big-corporation screwup: Good luck getting core Arduino-lovers interested in MSP430, TI!). I thought I was being clever to run CCStudio on Windows within a VirtualBox VM session on my Linux system, but I could not get joy. I eventually found a clue about why the LaunchPad wouldn’t work and temporarily disconnected the serial port path from the chip, brought up the board, and put a tweaked version of the program into the chip that paused a few seconds before its spewage.

Coincidentally, a somewhat similar bug manifested in the Arduino Duo IDE when I had an application that output serial data in an uncoordinated fashion. In this case, the Java-based IDE crashed with an unkillable JVM process that hung the Linux USB device connected to the Arduino, forcing me to reboot my Linux system. I even had a case where the X11 session hung with a frozen mouse pointer and stopped keystroke echoes. Apart from a misbehaving NVidia graphics driver and power failures in the past (and a maddening keyboard “autorepeat” bug that I’ll be writing about later), my Linux system never goes down, and I never have to reboot for updates or package installs. So having to reboot Linux every few minutes while trying to figure out how to hold my face with the Arduino board and its IDE became obnoxious in short order. The two bugs below describe similar issues registered with the IDE’s developer bug database. I wish I could say anybody is doing anything about these bugs, even so far as explaining what’s really happening, how to work around them ,etc. Unfortunately these bugs are unloved, and my mail to the developer’s list pleading for more information was ignored.

Relevant Arduino IDE bug reports 1 and 2.

Allman Brothers and Lynyrd Skynyrd from a different viewpoint

Last night my wife and I worked seven hours at food and beverage concession stands to make money for our daughter’s high school band expenses. My wife was a “runner,” assembling and handing off items to the cashiers at one of the main food concessions while I was a cashier/runner at the smaller pizza concession.

For a college instructor and career counseling professional and a software engineer used to being around nerds of the Nth degree, this work has been an incredible experience for both of us. It’s been character building, to say the least. We sold a lot of food and beverages, I had to inform a couple folks that they’d had enough beer for one night as they struggled to stay upright, and I got to hear the “Free Bird” guitar duet through my window, albeit with 70% bass and 30% treble because of the  angle and distance to the stage.

Here’s the crummy-phone pic of what the pizza concession looks like from the front (partner manning the left window).

Walnut Creek West Pizza
And here’s the the view from the inside.
Walnut Creek concession

Goals for my Raspberry Pi computers

I have two Raspberry Pi boards now, and both seem to be finding a long term role. The first I’ve been using for some time as a PC at Splat Space meetings. Connected to the meeting room’s LAN, a mouse, keyboard, and USB-based hard drive, this RP makes a usable stand-alone Linux system for keeping up with email and the like. A fellow Splat Spacer is making a case for this RP with his 3D printer (thanks, Geoff!). Instead of hauling all the pieces and parts and plugging them together for every meeting, I intend to strap the RP, hard drive, USB hub, etc to the back of the monitor. A wireless bridge is needed, too. I still have several left over from when our broadband was via Starband and I was my next door neighbor’s ISP.  This RP is named kludge-pc.

The other RP is destined to live on my home LAN. The original charter I had in mind for it when I ordered it in February was as a low power, battery-backed “overseer” to monitor the various bits and bobs in the house and make available clues as to what’s right or wrong with things. I especially want it to be able to diagnose common failure modes, such as when the wireless repeater gets unplugged for the sake of the vacuum cleaner and then we all wonder what happened to the Internet connection. But since deciding on this job for it, I’ve since realized we badly need a local caching DNS server to make today’s URL-heavy web content less painful to access. Before we could get broadband at this house in the boondocks, I ran an autodial modem-based LAN, and a DNS server was key to making it tolerable. The problem with that (bind-based) setup was that it had to be highly available, and apart from it becoming painful to reboot while others were using computers in the house, I begrudged the watts of electricity. I can’t use my main Linux system because I can’t guarantee it being up all the time (of all things the Arduino development IDE is capable of killing it: more on that in another post.) But a 3.5 watt board like the Raspberry Pi will be perfect. Finally, the GPIO on this board in combination with the Adafruit Linux distro will naturally tie into various monitoring functions, such as how many hours a day the water pumps are actually running. The obvious name for this RP will be eye.

Windows 8 first try

I downloaded the Windows 8 release preview and set it up under VirtualBox 4.0.12 on my 4-core AMD system running Ubuntu 10.04. (I’m “this close” to switching that system to XUbuntu 12.04 now that I seem to have found an alternative to the new “improved” Gnome that is in fact UNUSABLE Gnome.) Windows 8 installed very quickly and with an impressively small number of inputs on my part. But when I tried to shut the VM down and save the session it hung badly, and for the first time in my experience, VirtualBox has a process running that doesn’t respond to a “force quit” GUI action. It did respond to a kill 9. This was with the 32 bit version of W8, and I realize I specified “Windows/other” but maybe Windows/Windows 7 (32 bit) would be a better choice. I made this choice and reinstalled and then did a shutdown of Windows (spending only 3-4 minutes trying to find the interface for this, giving up, and finding the secret on the net: hover around on the right side of the screen to get the “charm bar”, click on “settings”, then on “power”, then on “shutdown”). Now I can start up W8 each time under VirtualBox. However it’s still the case that trying to just save the VM state for a quick restart results in a VB failure dialog and another hard to kill process.

The Windows 8 user interface is astonishing and I’ll leave judgments of that for others. My goal now is to determine what the device support situation is.

Mitt didn’t swing in England

Yesterday Mitt Romney stepped on British toes by raising doubts about how well the Olympics will go in London. I was impressed by two things: the immediate ferocious power of the British press to lash out and blow relatively unimportant remarks into big loud balloons of indignation, and the notion that if Romney can’t visit a foreign country for a half day without insulting a large part of its population, he’s going to have a hard time in later stages of his presidential campaign. I have to confess I’m looking forward with relish to an impressive string of gaffes, poor judgment calls, and episodes of very public clumsiness (forgetting Ed Milliband’s name yesterday was a good start).

Raspberry Pi round two

I ordered a Raspberry Pi in late February, soon after the gate opened, but didn’t get it until late May. My vendor Newark opened the gate again, this time with a quantity ten limit, on July 5th and I put in for 10 more as a group buy for fellow Splatspace enthusiasts. Newark published “late August” delivery as they were opening the gate, gave us a crazy 162 day lead time right after the order was put in, then pulled it back to August 16. The 10 new boards arrived yesterday, three weeks after the order and three weeks ahead of schedule. They were triple-boxed and this weekend we’ll be testing each one before sending it on to its new home.