Saturday, January 12, 2013

Raspberry Pi, episode 1

Okey-dokey, I will repurpose this blog yet again to describe trying to use the Raspberry Pi that Paul gave me for Christmas.

There's this much one can say about the happy group of Brits behind the Pi: they are teaching many, many people how to spell Raspppberry.

The actual thing is basically a single-board Linux computer, remarkable mainly because of its tiny size: about the size of a playing card. Central on the board is a single chip that comprises 512MB of RAM, a 32-bit CPU, and a graphics processor. Pretty much everything else on the tiny board is either connectors or resistors and capacitors.

The Pi all hooked up. Clockwise from top right corner: Power via a micro-USB connector; the SD card; some experimenter I/O pins; a yellow RCA connector for an analog TV signal; an audio jack; some blinky lights; two USB plugs for keyboard and mouse; an ethernet cable; the HDMI cable leading to the digital TV.

When I stop to think about it the Pi can make me rather giddy. I remember configuring my first home computer, with separate, 10-inch-wide cards for a 16-bit CPU and for 64kilobytes of RAM. So here's one fingernail-size chip comprising a CPU and memory, both four orders of magnitude more capable. (64e3 versus 51.2e7, and as for the CPU, forget it. The Pi's graphics processor can do 64 gigaFLOPs. That old 2MHz Z80 isn't in the same galaxy.)

Anyway it needs a keyboard and mouse, so I went to Fry's and found an optical USB mouse for $3.99 and a USB keyboard for $5.99. Later I had to go back and get a 2-metre HDMI cable, which cost more than the other two combined.

Getting the OS

The big hurdle in getting the Pi going is loading its OS. The Pi's only provision for mass storage is a single SD card, 8GB or larger. (I try not to think too much about having 8 or 16 gigabytes of memory on a thumbnail-sized chip.) If the SD card is initialized as a FAT-32 file system and loaded with a disk image downloaded from the Raspberry mothership, the Pi will supposedly boot up from it into a full-blown Linux system.

That's what the quick start guide claims. But the problem is getting the disk image written onto the SD card. The Pi instructions are for Windows users; my tool is a Macbook. Nevertheless, I thought I'd done it correctly, following these instructions at the "Embedded Linux Wiki".

It didn't work; or at least, when the Pi was all hooked up and plugged in, the screen went blank.

So I did it again and this time, the system booted up into a typical Linux startup screen going to a config screen.

It's aliiiiive! The Pi with the $4 mouse, $6 keyboard, and an expensive Samsung TV doing duty as a monitor.

I config'd it a bit, setting the locale and the time zone, although the latter was a bit of a puzzle: is California in Alaskan or Aleutian or Pacific time?

A Desktop!

I thoughtlessly told the configurator to update itself, but no ethernet was plugged in, so that hung. So I popped the power in and out and this time when it came up, it was in a graphical desktop!

The desktop after playing around a bit: terminal, Midori browser, debian doc open.

Fall Down Go Boom

I played with the desktop for a bit. Impressive that the Pi had instantly found the LAN and the browser could access the web without problem. I started apt-get update to update the database of installed software, and after a bit, everything hung solid. The mouse pointer still tracked but nothing responded to it.

So after a few minutes I popped the power plug out and in and when it booted now, it said PANIC.

Oh dear oh dear oh dear...

One More Time Unto the SD Card

I put the SD card in my Macbook and reformatted it and copied the image to it again. Checked that the Pi would boot and started through the configuration screens again.

After setting the timezone, there was a long pause. Then a series of file-system messages about inodes, including "This should not happen!" and "Data will be lost" and other stuff. Not helpful messages. In no way suggestive of what to do or how to recover.

Oh dear, some more. The Life Of Pi is finished, it seems.

And then it didn't respond to anything.

Anyone want a Pi?

I conclude that the Raspberry Pi is indeed a Linux platform of amazingly small dimensions. Loaded up with dedicated device-control software it can no doubt do yoeman duty as a lump of embedded smarts. People are doing amazing things with it.

However it is not a toy. It ain't for kids, at least, for kids who aren't ready to type sudo apt-get update without thinking about it. It needs constant hand-holding by an experienced user of command-lines, and that user better have a lot of patience. The software, combined with the iffy hardware qualities of SD card mass storage, is just not reliable. Or at least, this one example was not. The user experience, even for a very knowledgeable techie, is full of frustration. For a non-nerd, it would be hopeless.

Wednesday, April 20, 2011

Changing from DirecTivo to the DirecTV HR24 DVR

For a long time I put off the switch to HD television because doing so would mean giving up our cherished, 8-year-old Series 2 DirecTivo unit. The HD digital video recorder from DirecTV does not use Tivo's patented and deservedly popular user interface.

Finally the wait got too exasperating and we made the switch-over: a new, beautiful Samsung 46C8000 TV, a new A/V receiver, and the DirecTV HR24 DVR. (I ordered the HR24 from Amazon to be sure of getting that model, and not the slower HR23.) This is a summary of the main differences between these DVRs, as seen by a long-time Tivo user. The bottom line is: it's fine, no big problems.

This is a comparison of the standard Tivo user experience, to the DirecTV HR24 experience, as seen by a long-time user of the Series 2 DirecTivo.

The Box

As a physical box the HR24 is much less conspicuous than the DirecTivo. It is smaller in all dimensions, and lighter. Its case is midnight black with a subtle blue-glowing icon. Its primary output is HDMI, a big forward jump compared to the DirecTivo which lacked HDMI.

The Remote

The remote is not as comfortable or intuitive as the Tivo "Peanut." On the other hand, it isn't possible to pick it up and try to use it upside down, as my wife sometimes did with the peanut.

A significant feature that is new to Tivo users: the HR24 has an "off" mode. The DirecTivo was never turned off; it was always producing audio and video output unless you went through several menu levels to put it in Standby mode.

The HR24 remote has ON and OFF buttons. When you turn it off, the HR24 clears out of any menus, cancels any paused recording, shuts off its video and audio outputs and dims its front panel. Obviously it remains "on" internally because it makes timed recordings. The ON/OFF buttons can be programmed to turn your TV on/off as well, so that the TV and DVR come on together. You can also program the remote to operate a separate A/V receiver, but not with a single button-press.

Something else different: when the HR24 has been paused for more than a minute, it goes to a screen-saver mode in which a DirecTV icon wanders around a black screen. The Tivo did not do this; it would sit on a paused image indefinitely.

You can get deep into nested menus with the HR24 interface. However the remote has a dedicated BACK button for backing out of all menus in reverse sequence.

An Interface for the 80s

The first thing the Tivo user notices on meeting the HR24 on-screen user interface, is the cosmetic differences. The Tivo interface used calm, deep colors and had a polished look created by rounded corners, drop-shadows, aliased fonts, and subtle color gradients.

The look of the HR24 interface is anything but subtle and far from polished. It uses garish light-blue, black, yellow and orange colors. Every menu and window is flat and hard-edged: there's not a gradient or drop-shadow anywhere. The only concession to appearance is crudely pixillated rounded corners on some rectangular elements. Fonts, too, are unaliased and chunky. It's a surprise that an HD DVR, which will always be used with a 1920x1080, 24-bit screen, still uses interface elements that would look natural on a 16-color, 640x480 DOS screen of 1982! Twenty-five years of interface design progress ignored.

Cosmetics aside however, the functions that you command through this retro UI are in almost all cases the equal or better than Tivo's.

Playing Recorded Shows

With the Tivo, I most often went to the What's Playing List. Tivo provided a List button to get there, and so does the HR24. When scrolling through this or any other list, you can use Channel up/down to scroll by pages, just as with Tivo. Select a recorded program and press the Play button to start playing it, or hit the Red button to delete it.

A nice feature of the HR24 is a display of disk capacity used. Tivo lacked this feature.

Watching a live or recorded show, the controls are basically the same as Tivo. Play, pause, fast forward, rewind and jump back a few seconds are all similar. The FF button has four speeds, not three. Compared to Tivo the third speed is too slow and the fourth is uncomfortably fast. When you stop fast-forwarding, the HR24 jumps back a bit to compensate for reaction time, but it jumps further than Tivo did, and less predictably.

Tivo made single-frame advance and slo-mo quite easy. It is possible to engage slo-mo with the HR24; I have not found how to do frame-advance. On the other hand, the HR24 lets you set "bookmark" points in a recorded show so you can easily skip back to replay a favorite scene.

One Tivo play feature not easily replaced is Tivo's go-to-end button. On the HR24, the jump-ahead button doesn't go to the end. When playing at normal speed, it skips 30 seconds. If you are at any FF speed it skips 15 minutes. You can force a recording to its end (or to the real-time point if it is still recording) as follows: start FF at any speed, then press the skip-ahead button enough times to bring the recording to the end.

On Tivo, you could bail out of a program with the two-button sequence go-to-end, List. This was a quick way to bring up the Delete yes/no dialog. On the HR24, the same result is obtained with FF then skip (skip, skip...) to the end, and wait a few seconds until the delete dialog appears.

On DirecTivo, deleting a program moved it to a special folder from which you could recover it, sometimes days later. There is no such "trash can" folder on the HR24. A deleted program is gone immediately and forever.

Upcoming from Info

The HR24 has a dedicated INFO button that you can use to get info about a program at any time: while in a list of recorded programs, or while playing a recorded or a live program, or while browsing the on-screen guide. The displayed info includes a "first aired" date, useful for knowing when a program is a rerun.

Something that I always wanted in the Tivo interface was the ability to move easily from info about a recorded show, to a list of upcoming episodes of that show or to the Season pass manager. The HR24 provides this. The info panel brought up by the INFO button has a short menu of things to do, including finding upcoming episodes of the same show, finding other shows with the same performers, setting up to record the series, or going to the series options if the series is already being recorded. Again, you can do this while playing a program, or from the guide, or from search results, or the list of recorded programs. It's very handy.

Search

The search function of the HR24 is more accessible, more elaborate, and more useful than Tivo's Wishlists. You enter text in a similar way, by navigating a matrix of characters. But as soon as you begin entering text, search results begin to appear -- as with a Google search. The suggested results are quite good. For many searches, as few as two characters will produce the thing you want in the list of tentative results.

The most common search is for the name of a show, but you can also search a channel name (e.g. ESPN) to get a list of shows on that channel; or search a person's name and see all shows in which that person appears; or search a category (e.g. REALITY) and see all shows in that category. Of you can do a keyword search, finding every program whose listing contains that keyword. Once you have a list of shows by any means, you can browse in it, and hit Record or INFO on any one. You can also set "Auto-record" to record all shows that match a particular search, similar to Tivo's auto-recorded wishlists.

The last 15 searches you've done are available in a list so you can easily repeat them. The search also supports Boolean AND, OR and NOT functions and other special keywords. These are not documented in the user manual; you learn about them in online forums.

Performance

On internet forums there were many complaints about sluggish response of the previous DirecTV DVR, the HR23. The HR24 is apparently much faster. It is as responsive as the Series 2 Tivo in almost everything. The only place I have noticed any sluggishness is in the response to the RECORD button. Sometimes it takes a couple of seconds to respond to this button. That's awkward because, if you press the button twice, you have requested recording the entire series of that program. So you learn to press once, firmly, then wait for the ® icon to appear.

Missing Suggestions

The only major Tivo function that the HR24 lacks is Suggestions. I miss my old weekly exercise of sitting down to go through 80 to 100 programs in the Suggestions folder, deleting the majority but intrigued by some. Suggestions should be easy to implement; the algorithm would be just like Amazon's "Customers who bought this also bought X" feature. DirecTV could easily tell my DVR, "Customers who record the programs you do, also record these other programs, grab a few if you have space." I don't see why they don't do this.

No Regrets

I put off converting to HD and the DirecTV DVR for a long time out of reluctance to give up the Tivo user interface. Now that I've done it, the new environment is quite comfortable and usable. If a high-def DirecTivo ever does appear, I won't be in any rush to change back to it.

Monday, November 29, 2010

Nice 40-mile ride

I had a plan for quite a ride today, starting at 7am. Recently I had my annual physical, and the doctor ordered some blood tests, for which I have to go to the clinic 5 miles away "npo," fasting. Also I wanted to deliver something to Campbell, 19 miles away. So the plan was to start at 7, give the blood, have breakfast, and ride on to Campbell.

Well, the temperature at 7am was 35f, which made me rethink. Come to find out Marian needed to have a blood sample taken also, so we drove together to the clinic, gave up our red cells, and drove home for breakfast. When a reasonable (55f) temperature arrived at 9am, I set out on the ride to Campbell.

I had charged up the BionX battery beforehand, and I am happy to say that a ride of 40 miles (well, alright, 39.6 miles) used up only 5 of the 8 bars in the battery-state indicator. That's using assist level 2 about half the time, and level 1 the other half. There's plenty of juice for the 20-mile round trip to the gym on Wednesday. I think. We'll see.

This was a ride along familiar roads: Foothill Expressway, Homestead, Stelling, Prospect, Campbell.The streets, even busy ones like Campbell Avenue, were very quiet. There were many colorful Maple and Pistache trees along the streets. The sky was brilliantly clear; it was one of those winter days when cold Pacific air blows in from the Gulf of Alaska and makes every detail of the Bay Area hills stand out in glittering detail. Here is a view from Cupertino, east toward the Mt. Hamilton Observatory which is over 30 miles (50k) away.

Here are the exact pixels from the middle of that picture.

If I had started riding toward those so-clear little domes, it would have taken four hours to reach them, or 90 minutes to drive it.

I had stopped to take pictures of the Mary Avenue Bike Bridge. This new bridge was built in 2009 to give easy foot and bike access over I-280. It's a very nice cable-stayed bridge. Today I noticed the sun eclipsed by the north pylon:

At the south end of the bridge is a charming bronze sculpture of california quails, overlooked by an ominous red-tailed hawk.

Thursday, November 25, 2010

Longer Legs - maybe

It has been cold. Well, cold for California. Chilly, damp, gray mornings, or the last couple of days, clear frosty mornings. I don't like to ride in the cold. I have a pair of leggings that I bought 15 years ago. I wore them often when I was commuting by bike, but haven't had them on in two years at least. This week I've been jogging, either on the street or driving to the gym and jogging on the treadmill, which is terminally boring even with an iPod loaded with podcasts (Skeptic's Guide, Geologic, Security Now ... my jogging companions.)

But the bike—when I finally get back on it—should be better. Last week when the rain started, I did what I said I'd do the first rainy spell. I took the back wheel off the bike (no easy job) and took it up to the local bike shop service department along with the 11-32 freehub.

Wait. The back story is that when I was restoring the bike, I assumed that when I motorized it, it would still be using the same rear cluster, so I ordered the new front chain rings in about 10% smaller sizes than the old. But then it turned out that the BionX hub only supports a freewheel not a modern freehub, and further, that the freewheel BionX supplied was an 8-speed with a smallest gear of 14 teeth.

I described this back in June, noting that I had managed to obtain a freewheel with 11-32 gearing. But I hadn't installed it.

The reason I didn't install it is that I couldn't. I tried at one point to get the existing freewheel off, but they are notoriously difficult and I couldn't manage it. (The freewheel threads onto the hub, or in this case onto the motor casing, in such a direction that your pedaling torque tightens it.) Then I took the bike back to Joe Robinson for another reason and asked him to try to replace it. He returned it saying he had not been able to get the thing off either.

There matters rested for a couple of months, but the setup wasn't satisfactory; on a downhill I couldn't spin past 30mph, maybe 31. I used to be able to pedal past 40mph on a suitable slope.

So, OK, on this rainy day I removed the wheel and took it and the new freewheel up to the bike store and at the service counter I started saying, I want to replace this, the guy who sold it to me couldn't get it off. Before I'd finished that sentence, the mechanic, without a word, picked up the wheel and walked away to the back of the shop, where he slapped a tool into a vise, dropped the wheel on it, gave a mighty heave, and spun the freewheel off. He was back at the counter in less than a minute. He dabbed a little grease onto the threads, spun the new freewheel into place, and said, "OK?"

OK, indeed. I took it home and reinstalled the wheel, and the bike's been sitting in the garage since, waiting for better weather or more motivation.

Saturday, November 13, 2010

New grip shifts

I had wanted to replace the old shifters during the restoration. I bought a left-right pair of eight-speed Grip Shifts from Easy Racers when I picked up the frame. I forget the reason just now, but due to some issue, I retained the old left-hand (front) shifter but installed the right-side one.

Not too long after I started riding the new setup, that right-hand shift knob started to slip. Under the pressure of my awesome right hand, its rubber grip began to slip. It would pull away from the mechanism and I'd push it back in place.

This became increasingly annoying so I decided to replace it yet again. I went to local bike stores and looked at the shifters being used on modern mountain bikes. Some wouldn't work for my bike, for example because the shifter was integrated with the brake lever, and I need to keep my separate brake levers. Others looked rather cheap. Actually the nicest-looking grip shift is the one made by Shimano as part of their Nexus system. Unfortunately, the Nexus is an internally-geared hub. If I were setting up a new, non-electric, recumbent, the Nexus hub and related parts would make a very nice installation. But the center of my rear wheel is taken up by the BionX motor, and it seemed very likely that the Nexus shifter would not be compatible with my external 8-speed derailleur.

What I settled on was the SRAM "centera" twist-grip. It has a longer grip that looks well-bonded to the mechanism. It also has a somewhat toy-like gear indicator but otherwise its quality seems good for a plastic part.

I ordered a pair of shifters from Amazon; they arrived yesterday and I installed them this morning. Here is the right one in place,

...and here is the left one.

Happily the installation lacked drama. Installing cables often results in operatic drama and high-pitched swearing fits, but not this time. The nearest it came to that was when I was trying to fit the old, longer cable to the rear. The one that came with the new shifter was juuuuuust a few inches too short.

This meant threading the old cable tip down through the core of the shifter. And of course, one wire didn't want to go, wanted to spiral back and jam. I fired up my old soldering iron and soldered the tip to hold the wires together. Then it went. And the adjustment wasn't hard either, and it shifts smoothly: tick-clunk, tick-clunk.

Of course the indicator reads "backward" with 8 being the lowest gear and 1, the highest. But that's always been true because the derailleur works backward, pulling toward the higher gears.

Tuesday, October 26, 2010

An interrupted ride

Yesterday, Monday, it was chilly and damp when I went out to pick up the paper. There was a little rain Sunday and although the forecast was for dry, I decided I didn't want to ride in this weather. So I drove to the gym and jogged 40 minutes on a treadmill. Ironically, by the time I left the gym it was a bright, sunny day and I felt bad about not riding. So today, Tuesday, which would by plan be a jogging day, I went for a ride instead. Toward the end of the ride, something rather odd happened.

Rancho San Antonio Park


I opted to ride a moderate route, south on Foothill boulevard to Rancho San Antonio County Park. The attraction there for me is that on a hill at the entry, model airplane hobbyists are usually to be found flying their creations. Indeed today there were several men flying not regular planes but model autogyros.


I watched for a bit and wasted a lot of pixels trying to catch the little machines in the air.

Strange Incident

A couple of miles from home, crossing through an intersection, I became aware of something wrong with the vision in my right eye. I pulled over as soon as I could. My first thought was a visual migraine, something I get once a year or so, but this was not at all the same. A visual migraine is a scintillating transparent arc that starts in the center of the visual field and gradually expands outward, lasting typically 30 minutes until it works its way out of my peripheral vision.

What I saw now was quite different. First, it was only in my right eye, not both. And second, it was an irregular, opaque, pink arc that had appeared in the upper left of the field.

Later I worked out the perfect description: put your right hand against your brow as if you were saluting. Now, curl your forefinger down to make a half circle obstructing the inner part of your right eye. That's what it was like, except the pink blotch had no texture or shape. It could have been painted on the inside of my glasses. The bright autumn sky and trees and road were all clear except where the pink blob was.

Second thought: retinal detachment. Agh! I called home but Marian was out. So I cranked up the assist level to 3 and pedalled home, looking up as much as possible out of some notion that gravity might settle a retinal tear.

In fact, the pink blob thinned and disappeared in about ten minutes and was gone when I reached the house. Nevertheless, I hurriedly changed to street clothes and drove to the Palo Alto Clinic where, eventually, my eyes were dilated and examined. All OK; no signs of tears or separations, no swellings or other indications of a constricted blood supply. (And I had not had the common symptoms of retinal damage: lots of floaters and odd flashes.)

So, no problems found—and no diagnosis. Might have been an anomolous migraine. Anyway, an early end to the ride.

Wednesday, October 20, 2010

Aaaaaand - we're back.

Returned home from a six-week tour of Germany late on Monday the 12th. On Wednesday, Joe Robinson stopped by the house (and isn't that some kind of service?) with the new battery and my old console.

Just to recap, I pretty much ruined my BionX battery pack, but they accepted it as a warranty fix. Also I'd turned in the little console computer because a light touch on the throttle lever, or just road vibration, would make its screen blank out.

Joe said that BionX had sent back the same console, saying they didn't find anything wrong with it. Well, that was a communication failure on one of our parts, but it doesn't matter because as Joe was installing it on the handlebar... it blanked out on him.

I couldn't have been more pleased. He got a good demo of how just a gentle wiggle of the throttle lever would make the screen go blank. So he took it back to the shop with him.

Friday he stopped by again with a new console. He'd been able to duplicate the problem on another bike, so it definitely wasn't the wiring on my bike (I never thought it was; I was and am sure it's either a cracked circuit board or a bad solder joint) and now the bike was complete again.

Saturday morning I spent some time cleaning and remounting the fairing, which had been gathering dust in the garage all these weeks, then went for a 12-mile, flat ride.

Exactly as I expected and has happened after prior vacations, I've got no lungs and precious little leg. But also, the BionX motor does just what I hoped it'd do: assist level 2 makes it possible to ride at what feels like good speed, even if I'm out of shape. So I will be riding.

I have a plan for a new exercise regime, one to please my cardiologist: MWF do the 40-minute ride to the gym for a short workout; and tuesday and thursday mornings do a 5K jog. That will get me the 5x40-minutes of aerobics per week she wants me to have. (And when I see her and can report doing this program, I will be able to needle her for being a couch spud herself, which she looks like.)

I like the jogging because I can listen to podcasts on the ipod, usually the Skeptic's Guide or the Geologic podcast. One drawback with real cycling (as opposed to jogging or sitting on a stationary bike at the gym) is that it really isn't safe to have the ipod in my ears while doing it.

In aid of this plan I went to the Nike store and bought myself a pair of the almost-barefoot running shoes: a segmented rubber sole with light canvas uppers, they weigh almost nothing and feel good. On Monday and again today (Wednesday the 20th) I stuffed them into a pannier and rode the bike to the gym, as planned. They fit the pannier a lot better than the old running shoes, which by comparison look a lot like feet for the Sta-Puft marshmallow man.

Tuesday I did the jogging as planned. So the quest to recover fitness begins anew.