Showing posts with label Raspberry Pi. Show all posts
Showing posts with label Raspberry Pi. Show all posts

Saturday, January 5, 2013

Cutting The Cable

You may have inferred the fact that I have recently upgraded a perfectly wonderful MacBook Air to the latest model. And you may also know that I've been geeking with the Raspberry Pi. Implicit in this is my desire to create the perfect Internet/TV lash-up. If you buy an Internet-ready TV, you'll find it has some of the apps you want, but it'll have some annoying gaps that are filled by the Apple TV. And if you buy an Apple TV set top box, you'll find it has more of the apps you want, but other annoying gaps that are filled by the Raspberry Pi. (If you think this is an unreasonable line of reasoning, I agree and I blame my friend Paul.) My days of subscribing to Cable TV are numbered.

So, I've been poking around figuring things out how to plug those gaps.

Since the weather has gotten cold, I don't like to walk outside with my wife for exercise. We have a treadmill and Nordic Trak next to one another, but took out the TV in front of them when television went HD digital a while back. So, I didn't want to be cold when I exercise. and I didn't want to be bored, either. So, this morning after breakfast, I trotted off to Best Buy and bought an open-box Samsung TV. It's not particularly large, and it was reasonably priced. So reasonably priced that I was able to throw in another Apple TV into the deal.

It took a few hours and a bit of to-and-fro with the cables, but I got both the Apple TV and the Raspberry Pi XBMC application going. If you're going to do this, I recommend a TV that implements some form of HDMI/CEC so you don't have to fuss with adding a keyboard, mouse, or other interface to the Raspberry Pi.

Because I got the television dirt cheap, it did not have HDMI/CEC. But I was able to dispense with the keyboard/mouse after I told the XBMC application to let other programs control it over the net. After I turned that on, I was able to download and configure apps for my Android phone and also for my iPad so that each can serve as a remote control That's pretty cool to pick up the cell phone or the iPad when you want to pause a video.

(I got my wife a Nest thermostat for Christmas. So, this morning I turned up the temperature without getting out of bed with my iPad. I love living in the future.)

I made mention of upgrading a perfectly good MacBook Air, because it supports this feature called "AirPlay mirroring." Thus, when I'm running the MacBook Air, I can mirror its display to the television. Anything I can see on my Mac I can also see on my TV without having to schlep a bunch of cables between things. And all the wires are tucked behind the television and its stand the way God intended them to.

In these days of HDTV, I find that I can dispense with a lot of complexity I had to sort out in the 1990s, but I get a lot of new complexity. So, it's a wash. It's amazing how much awesome technology you can get for not much money these days.

With a HDTV, Apple TV, and Raspberry Pi running XBMC, I figure I can have the almost-perfect television-viewing experience...

WHEN I SHOULD BE READING A BOOK.

Friday, December 7, 2012

The Red pill or the Green pill?

Are you going to take the Red pill...
... or are you going to take the Green pill?
I've rambled on about how much I hate dystopian novels. And how I intend to write prose that is anti-dystopian.

Sarah Hoyt, et alia, have suggested an alternative they call Human Wave. Human Wave is basically old-fashioned Humanism (neither Secular nor Religious, just Humanism qua Humanism) that's contextualized within the motifs of Science Fiction.

That's a fine sentiment. I like humans. I really like cute little humans and attractive female humans--particularly the one to whom I'm married. But I've always thought "man is the measure of all things" to be a bit too uppity. Not humble enough.

Thus I now feel more of a co-belligerent of Human Wave than an unequivocal ally. Instead, something got me thinking about the future and how my writing should engage the future.

Let's suppose I take all the problems in the world and consider worst-case scenarios. The great terror of my childhood was nuclear war.

Maybe there will be a nuclear war, and the radiation will keep growing so that we'll all die. And if that happens, the last survivors would live in Australia, drive race cars, and take suicide pills. That's not a fun day On The Beach, is it?  
Conversely, the survivors in such a scenario would have the time and resources to build underground or underwater habitats with sufficient shielding to protect against radiation. OR they could build rockets and live on the moon for a century or two while waiting for the radiation to half-life away.

So, do you want to keep calm and carry on or do you want to get excited and make things? Do you want the Red Pill or do you want the Green Pill?

(You'll note that I did not say Blue Pill.)

When I was a wee lad (That sounds better in a Scottish brogue.), you could drive through Gary, Indiana and you would see an orange haze in the air from all the steel making. The river in Cleveland caught fire.

Today you can fill your lungs with air that's a lot cleaner. You can go to the beach and take a dip in water that's a lot cleaner, too.

(But I live in Michigan. It's too cold to go swimming. At least, not until we get some more Global Warming, please.)

What changed between then and now is that our parents saw problems and set about to fixing them. They fixed them so well, that the remaining pollution problems became much more subtle, and more questionable.

That's the green pill. You see something is wrong, and you set about to fixing it.

Is the planet too hot or too cold? Don't Stay Calm and Carry On, roll-up your sleeves, build a thermostat, and hook it up. What about unintended consequences? There's risks in anything and we're already dealing with unintended consequences of everything else that's gone before.

Once Upon A Time the world of the future was not a dystopian place. Stay Calm and Carry On was WW2 and on the other side of the Atlantic. The American way has been to see a problem, and do something to try to fix it. We Get Excited And Make Things.

Happily, today most of the things that are worth making are within the scope and skills of one or a few tinkerers. The Maker Movement is a bunch of folks doing art installations, starting companies, subverting monopolies, and engaging in creative destruction. A lot of us are engineers and computer geeks. Note the word "us" because that's who I am. You may have noticed my experiments with the Raspberry Pi.

I also write. And after you read my stories I hope that you will want to get up and invent a jetpack or a flying car. Or a cure for cancer. Or a better way into space.

Friday, November 23, 2012

Please Baby, Go All The Way

The title of this post comes from this tune by The Raspberries. I've written a few blog posts about the Raspberry Pi of late and here is a summary thereof. And an observation of the entire course of experiments. You will want to read the summary statement even if you skip the rest.

Can Raspberry Pi Save Civilization?
In this post I introduced the Raspberry Pi, a single-board computer designed in the UK to provide a way for kids to learn computers without spending a lot of money. The board costs $35 and the software is free. You'll have to dig out a USB keyboard and mouse, provide a power supply from a cell phone, a 4GB memory chip, and enclosure. So, you'll feel like you are being nickle-and-dimed to death.

Will Raspberry Pi Destroy Civilization?
My experience with the Raspberry Pi wasn't all beer and skittles. It will serve a useful purpose as a media computer/television set-top-box if you can get it to run XBMC. But I failed to get it to run despite several attempts. Part of this was climbing the learning curve of XBMC. And when you compare the performance of the Apple TV that Just Works, the rationale for the Raspberry Pi as a media computer is diminished.

Thinking Inside the Box
Since the Raspberry Pi does not come with an enclosure, I figured I needed one. I did some googling and stole a design for repurposing an audio cassette tape case and make it into a Raspberry Pi enclosure. It works surprisingly well.

Raspberry Pi as Torture

My experiments with the Raspberry Pi disclosed that you need to be careful to check compatibility. Don't just assume you can plug random components into your Raspberry Pi and expect them to work. Instead, you should check whether they have been verified to work with your Raspberry Pi when you encounter difficulties.

Tasty Raspberry Pi
Happily, I bought a second Raspberry Pi that has twice the on-board memory in hopes it would work better. Then I repeated the earlier, failed experiments with much better results. I devised more powerful troubleshooting techniques and better approaches. This made my Raspberry Pi start acting as a useful media computer.

Raspberry Pi Safe
With the second Raspberry Pi working well, I sought a second enclosure. Yes, I could make another enclosure from the audio cassette case, but my wife gave me a raspberry-colored wooden box of the appropriate size to serve as an enclosure that I named a Pi Safe.

Hot Raspberry Pi
In the Raspberry Pi Safe enclosure, I worried that the Raspberry Pi might run hot. I cut slots in it to accommodate cables, and dissipate heat. And I discovered the Raspberry Pi temperatures go UP when I ask it to tell me its temperature.

The Magic Raspberry
While using the Raspberry Pi as a media computer, I discovered something magical called HDMI-CEC. And that discovery has enabled me to simplify the hardware requirements of the Raspberry Pi when it is used as a media computer.

In summary
The Raspberry Pi is a great educational tool. If you think, "Oh, I want an open source replacement for my Apple TV," stop. Repeat after me: the Raspberry Pi is a great educational tool.

When you unbox something and expect it to Just Work, there's little educational value.

There's a lot of fuss and bother putting things together just right. There's frustration when things ought to work don't work. There's annoyance when expectations are not met and behavior is a little different. BUT every time you encounter a problem, diagnose it, and tweak a fix you are Learning Something.

Learning Something is often frustrating and time consuming. I had forgotten something important when I was in the throes of making the Raspberry Pi work.

Just because I'm not a kid any more doesn't mean I'm past education.

Sunday, November 18, 2012

The Magic Raspberry

I got my Raspberry Pi put into an enclosure and doing great things running XBMC with my TV. I wasn't thinking and I picked up the TV Remote Control instead of the micro wireless keyboard. Instead of pushing the arrow buttons on the keyboard, I pushed the arrow buttons on the remote control.

It did what I wanted.

Then I stopped. Oh my gosh. How did that do that? That shouldn't have worked.

I'm an engineer. I understand things. If you push a button on a remote control, infrared light waves go speeding to an eye built into the TV. The Raspberry Pi has no eyes. It is blind to infrared light and everything else. It CAN'T respond to the remote!

Your eye does not work in the infrared. So, when you push the button on the remote control, you don't see anything.  Your smartphone's camera uses a sensor that is sensitive to infrared. So, when you aim a remote at it, you can tell whether it's emitting or not.
(If you're a terrorist worried about infrared targeting lasers from the US military, you already know this. I said I understand things.)

My wife held the remote up to the camera with the button off and the button pushed on so that we could illustrate this.

How in the world did my Raspberry Pi figure out that I'd pushed the button on the TV remote?

After a bit of Googling, I found the HDMI standard and read about a CEC (Consumer Electronics Control) connection. If you have the right kind of HDTV, it can send commands back down the HDMI cable from the TV. And if the thang, Blu-Ray player, cable box, satellite box, whatever, is smart enough, it'll respond to those commands. It's like freaking magic.

This has profound ramifications for use of a Raspberry Pi as a set top computer. You don't need to hook ANY MOUSE or KEYBOARD to it: Just power, HDMI, and Ethernet. No USB hub or even those cute little wireless dongles.

So, I got to thinking, let's try this on my other TV set. I did. No joy. HDMI CEC is not on every TV set, just a select few. Since Black Friday is coming up, you might want to know what to look for if you're going to be buying a TV.

According to Wikipedia, the Trade names for CEC are
  • Anynet+ (Samsung); 
  • Aquos Link (Sharp); 
  • BRAVIA Link and BRAVIA Sync (Sony); 
  • HDMI-CEC (Hitachi); 
  • E-link (AOC); 
  • Kuro Link (Pioneer); 
  • CE-Link and Regza Link (Toshiba); 
  • RIHD (Remote Interactive over HDMI) (Onkyo); 
  • RuncoLink (Runco International); 
  • SimpLink (LG); 
  • HDAVI Control, EZ-Sync, VIERA Link (Panasonic); 
  • EasyLink (Philips); and 
  • NetCommand for HDMI (Mitsubishi).
Before you buy a TV from these vendors, look in the specs for these buzz-words. If you see them on the set you want to buy, you'll know its TV remote can control your Raspberry Pi XBMC application.

Tuesday, November 13, 2012

Hot Raspberry Pi

If you've been following my fevered ravings about the Raspberry Pi, you know that I'm trying to use a raspberry-colored wooden box purchased at Goodwill as an enclosure for the Raspberry Pi. I call it a Pi Safe, because my mom referred to an enclosure for desserts similarly.

(This is improves upon my first Raspberry Pi enclosure I've described elsewhere.)

I glued the lid together and mended the broken hinge. That white stuff next to the clamp is wet Elmer's glue.

The holes shown above were completely useless. If you hold the Raspberry Pi board in front of you, you can orient it such that the Power, HDMI, and Ethernet connectors are at 3-o'clock, 12-o'clock, and 9-o'clock, respectively. To route cables to these points through a hole in the back, two of the cables must go around corners.

These cables aren't flexible and they have bulky connectors. This makes it such that 90-degree turns require a wide radius like a highway on-ramp. Hence I expanded the hole in the back into a slot, and cut additional slots on the sides.

It's just as well, I was worried about heat dissipation and airflow. Though the Dremel tool is marvelous for cutting holes in something, when you are cutting slots the Right Tool for the job is a Dremel multi-max.

I absolutely love that gizmo.

With slotted holes in the sides and back, I can plug in the cables as desired, and I now have plenty of airflow.

Thermal dissipation is interesting. If you go to the XBMC settings page, you can find a status indicator that will show you the temperature of the CPU and the graphics chip.

I used it to take these measurements:
  • 111° - Raspberry Pi out in the open
  • 135° - Raspberry Pi in the "pi safe"
  • 120° - Raspberry Pi in the "pi safe" just after running a movie for an hour.
(There's something reminiscent of quantum mechanics that bringing up the measurement screen should raise the temperature being measured. )
 
I figure 120° - 135° is good enough for now. Clearly, the slots permit sufficient airflow. As stated earlier, I have heatsinks on order that should cut down these temperatures a little more.

Here's what the Raspberry Pi looks like in its enclosure sitting beside my television.

I'll have to dress the cables to make things pretty, but you get the general idea.

The big surprise that I discovered a few nights ago was that my Sharp Aquos TV is having side-conversations with my Raspberry Pi. I inadvertently used my TV remote's menu buttons and was shocked to see XBMC menus on the Raspberry Pi responding in turn. This means that I didn't need teeny little keyboard/touchpad. Now that I think of it, I think I could have used ssh to telnet into the Raspberry Pi when I was configuring it. There was no need for keyboard or mouse even then.

Technically, the combination of a Raspberry Pi, OpenELEC/XBMC, and the "Pi Safe" is cheaper than an AppleTV. But it nickel and dimes you, and it doesn't "just work" like my AppleTV did. You have to make it work. This is a Linux box for the second decade of the 21st century. It's small, cheap, powerful (in a narrowly constrained domain), and it is fussy to set up and get right. If you count how much your time is worth, buy an AppleTV. But if you want to learn something get a Raspberry Pi.


P. S.
You may be wondering, "OK, if I hook up a Raspberry Pi to my television set, what could I use it for?" This is a good question, not because the answer is hard, but because MY answer is so self-serving: You can use it to look at this book trailer. If you think that's a lame reason, I'll be grateful if you turn off the TV and read a book.


Raspberry Pi Safe

You are familiar with my previous post about an Raspberry Pi enclosure here.

I took an old audio cassette case and then used a Dremel tool to put strategic holes therein to accommodate cables and also some holes immediately above the chips that generate the most heat.

I've bought heat sinks for these chips here. The price was $10 with $3 shipping.

It was a very tight fit and when I tried to get it to fit with a different Ethernet cable the hole was too small. So, I decided against munging my Wang Chung cassette.

Since the fit was so tight, I decided to use something else as an enclosure. Something a little larger.
It looked like the Doors double-album was large enough.

Before I started Dremel-carving on the Doors album, I asked my wife to stop by the Goodwill store to pick up another double-album of something less iconic, maybe Ray Conniff or Mantovani.

She said they didn't have any double CD cases at Goodwill, but they did have a small wooden box. The best thing was the color of the box.

Only downside was that one hinge was loose. And the lid that was made of plywood and split. So, I replaced the missing nails, glued the split, and clamped it down.


The Raspberry Pi has cables for HDMI, Ethernet, and power. So, I carved three holes in the side of the box to accommodate these cables.

Now, this isn't finished. For one thing the hole for the USB is too small and it's too late to Dremel tonight. Moreover, I am worried about air circulation being insufficient to accommodate heat dissipation. At the moment my Raspberry Pi Model B 512MB does not have the heat sinks I put on my Model A 256MB. I've ordered a 2nd set of heat sinks and we'll see how they do.

The system says I'm starting at 111 degrees when the Raspberry Pi is sitting out in the open. We'll see.

Sunday, November 11, 2012

Tasty Raspberry Pi

I thought I was doubling down on stupid.

I bought a 512MB model B Raspberry Pi. I couldn't get my 256MB Raspberry Pi to perform satisfactorily as a media computer. However, a mix of climbing the learning curve and adjusting my expectations has brought about a pleasing round of experiments I'd like to relate to you.

First off, less is more. If you don't have to plug in a USB hub, don't. If you don't need a wireless Internet interface, don't use it.

Second off, more is more. Dig out some extra SD chips and try out more Linux distros until you get the one that works best for you.

Here's my new model Raspberry Pi. If you see that little black nubbin on the right of the card, that's the USB dongle for the keyboard. The unplugged dongle on the left is the wireless Internet adapter that I unplugged and don't use.

I attached this teeny USB keyboard/touchpad combination. Yes, it costs more than the Raspberry Pi itself did, but it's cool.

My application is to create a media computer/set top box. When I bought my big new HDTV last winter, it came complete with Internet connectivity. Trouble is that Sharp's idea of Internet connectivity is pretty lame.

Instant Netflix works really well, but almost everything else does not. This includes YouTube or media stored on my network. So, I decided to buy or build something to make everything work with everything.

My first stop was an Apple TV. It is cheap $99 and it does a good job with stuff I didn't care about: iTunes. It falls on its face for what I really want: media stored on my network.

I am told that if I can jailbreak the AppleTV3, all my problems will be solved. Trouble is that nobody has figured out how to jailbreak the AppleTV3 yet.

Here's an amusing factoid: If you have an Apple TV2, you can sell it used for more money than an Apple TV3 sells for new.

This is why I wanted to make the Raspberry Pi into a media computer.

First thing I suggest if you buy a Raspberry Pi is to buy three SD cards that run as fast as possible. Then install onto these cards the following Linux distributions:
Each distribution has unique pros and cons. For instance, Wheezy-Raspbian is the most stable build and most things "just work." However, it is not specialized for service as a media computer. It doesn't readily run XBMC which seems to be the gold standard for Open Source media center software. That's XBMC you are seeing on the TV screen above.

Raspbmc automatically boots into XBMC as does OpenELEC. Sadly, Raspbmc does not seem as stable as OpenELEC.

Maybe I have just learned what not to try to do on a Raspberry Pi. I first installed Raspbmc and struggled with it in my first Raspberry Pi Model A 256MB card. It never really worked and I gave up.

That's why I thought I was doubling down on stupid buying a Model B 512MB card.

This was one of those rare times that worked out. I made the three SD chips with the three Linux distributions described above.

Of these I settled on OpenELEC. As you can see above, the Raspberry Pi handled media stored on my network. That's the Dude in the bathrobe above.

Then I installed the YouTube plug-in and pointed it to my favorite YouTube video. Happily, it worked and you can see it here.

If you'd like to see that video for yourself, you can find out more about it here.

Saturday, October 20, 2012

Raspberry Pi As Torture

The Raspberry Pi is a $35 computer. It's great. Just hook it up to your TV and some junk laying around the house and boom, you've got a computer.

If you want a cheap media computer, uh, well... what's your time worth?

I've got several years' worth of junk in my junk box. So, I rifled through it to find junk to plug into it.
  • I've got a TV with an open HDMI port.
  • And do I have a USB mouse? Yeah, but it's an optical mouse...
  • And do I have a keyboard? Several. Any of them USB? Uh, no.
  • But I've got two USB hubs, a big white one and little black one. 
There's one critical point that you might overlook like I did. Just because your junk box has a bit of kit in that list doesn't mean it has the right bit of kit. 
The Raspberry Pi has a thing about power. If you plug something really power-hungry into its USB, the board won't work. You fix that by plugging a USB hub into the Raspberry Pi then plugging your stuff into the hub.

Mindful of this, I used the big white USB hub. Mistake. You'd think that a USB hub is as vanilla device as imaginable. It is not as far as the Raspberry Pi is concerned. ERGO, when you decide to set up your Raspberry Pi, verify each of the items above to make sure they are verified to work with it.

I discovered this when I couldn't get the Wifi dongle to work and went googling for device drivers. Didn't find them, but I did find a list of approved USB hubs. What? Turns out the little black USB hub is confirmed to work with the Raspberry Pi and the big white USB is confirmed to cause trouble. I swapped in the little black hub and it seemed to work a little better, but I suppose by this time my expectations had been downgraded significantly.

Ergo, when you start hooking up things to your Raspberry Pi, check to see they have been confirmed to work with it. Here's a link where you can check. Check first. It will save time & pain.

Sunday, October 14, 2012

Thinking Inside the Box

You know how some computers that have a warranty that you'll void if you open the box. The Raspberry Pi gets around that by not having a box. When you buy the Raspberry Pi, you'll get a bare board.

Before I say anything more about Raspberry Pi enclosures, please humor a bit of nostalgia. When I was a kid wearing bell bottoms in the 1970s, almost everyone had several of these things on the right.

That plastic thing on the top is called an audio cassette tape. You'd stick a pencil into one or the other of those holes if you had to manually rewind the tape. We also used stone knives and bearskins. That thing on the bottom was the protective plastic case.

Ask your grandparents if you can have one of their old Peter Frampton audio cassettes, toss it out and keep the plastic case like the one you can see peeking out from underneath. If you're lucky, there will be no annoying plastic stickers to peel off, just paper inserts you can discard.

This is how I made my own Raspberry Pi enclosure from an audio cassette tape case in which I cut holes with my Dremel.

Note the notch cut into the case closest to the camera. It is to accommodate the fact that the RCA connector is too tall to fit into the case. This lets the Raspberry Pi board slide into the niche of what's now the bottom of the case. You'll note that I've also added heat sinks to the Raspberry Pi board and have cut holes in the top of the case to accommodate them as well as the USB connector on the left.

I turned the case 90 degrees counter-clockwise to take this picture:

Here we can see the hole cut into the side and top of the case to accommodate the USB connector, as well as a hole to accommodate an Ethernet cable. If you use a USB wireless Ethernet, or don't want Ethernet, you can skip this hole in the side.


I turned the case another 90 degrees counter-clockwise to take this picture:

Here we see the hole cut in this side of the case to accommodate the HDMI cable to the TV set. You'll note that it is important to make some of these holes a little bit oversized to accommodate your cable. This is less an issue than the Ethernet cable that's a little more deeply recessed as well as the USB cables that also tend to have fat plastic shields on their connectors.


I turned the case another 90 degrees again:

This side gets two two holes: a slot for the SD card to stick out of, and a hole for the power cord.

This is another deeply recessed hole, so you'll have to make that a little bit over-sized.

 

Tipping the case up, we can see the top more clearly here:
There are a few things to take note of in this view. The holes for the heat sinks have to be a little bit oversized because they can stick out of the case, and you'll need clearance when you open the case and close it.

Also note that because the case is transparent, you can see all the status lights on the Raspberry Pi.

Another thing. I almost forgot to mention this, because it was the first thing I did. Audio cassette tape cases can have two little tabs to engage the holes you saw in the audio cassette. These prevent the tape from sliding out.

The FIRST thing to do is to Dremel these off. You can't see where the tab on the left used to be, because I've cut a hole for the leftmost heat sink. However, you can see a cloudy haze on the right. That's the ghost of the tab on the right. I just removed enough material to make the plastic level.

A true aesthete would have polished the plastic to get rid of the ghostly fogging. I'll leave it there as an homage to Halloween. Tell your friends about the ghost picture you saw on my blog.

For completeness sake, let's take a look at the underside of the Raspberry Pi enclosure:

Some might claim that I need to remove material from the bottom of this case to accommodate the SD card socket that's protrudes slightly from the underside of the circuit board.

I think it unnecessary, but you may not.

The whole thing requires a Peter Frampton cassette tape case, a Dremel tool, and an hour or so of cutting.  Oh, and I'm sorry. You really shouldn't toss out your grandparents' Peter Frampton cassette.



Those more worthy than I: