Thursday, September 25, 2014

Raspberry Pi DVR - PiBang

Although not on my initial list of Linux distros to look at on the Raspberry Pi, I read some posts online where people raved about PiBang.  So I thought I would give it a try.

PiBang - November 2013
When you go to download PiBang, the first thing you notice is a post stating that PiBang is no longer in active development.  They claim this is not because of a loss of interested, but because PiBang had reached a point where there was little more to do on it.  I guess there is only one way to find out.

Booting PiBang for the first time and immediately run into a problem.  The setup screen comes up, but your mouse and keyboard do not work.  Also, any devices plugged into the USB jacks on the Raspberry Pi are not powered on.  After much research on this problem (and experience from other old distros) I found the problem and a solution.  The new model B+ requires newer firmware files to boot correctly.  Without them the USB jacks will not be powered up, hence the non-working keyboard and mouse.  To solve this problem I manually downloaded and copied the latest Raspberry Pi firmware files onto the SD card and rebooted (I will post an entire follow up post with details on this manual firmware update process).

This time my keyboard and mouse worked.  PiBang includes a first-time boot config screen almost identical to Raspbian.  I changed similar settings such as region and locale as well as select the option to expand the SD card.  When the Raspberry Pi rebooted, PiBang crashed and would not recover no matter how many times I rebooted it.  At this point I decided to give up on PiBang.  Because it is so much older than the model B+ I have, it is not worth my time to try and figure out how to get it to work.  In the future if they release an updated version that is compatible with the B+ I would love to give it a try.  But for now PiBang is just too old to be of use.

Raspberry Pi DVR - Pidora

The second Linux distro I looked at for the Raspberry Pi is Pidora, which is the Raspberry Pi version of Red Hat Fidora.

Pidora - Version 20, July 2014 (kernel 3.12.23)
Installing Pidora is even easier than Raspbian.  The first thing you are greeted to is a nice GUI wizard that walks you through the process of setting up the keyboard, user account, time zone, etc.  Not that this was hard in Raspbian, but Pidora makes this so easy anyone could do it.

Once the initial Pidora setup is complete, you immediately notice how it differs from Raspbian.  Whereas Raspbian is an operating system geared towards education and tinkering, Pidora is a full-fledged operating system.  It has user login accounts, defaults to a graphical desktop, and the default set of software is geared more towards work and productivity than education.

The next thing you notice is that Pidora is slower and less responsive than Raspbian.  This is no doubt because it is a more complete operating system and therefore has more tasks and processes going on.  It is still usable as a computer, but be prepared to wait just a little bit more.

Pidora did include built-in support for the Rosewill RNX-N180UBE.  To configure it I selected Settings | Network Connections | Add New Connection for WiFi.  WiFi was not quite as easy to configure as on Raspbian, but Pidora was fairly straightforward.

Pidora also includes the firmware file for my TV tuner, but I did not run any tests on the hardware such as install tvheadend.  After running Pidora I could see that, while a great operating system, it was not a good fit for my needs.  So I did not perform any further tests towards the end goal of setting up a DVR.

Pidora was definitely an interesting distro, worth my time to look at.  If you are looking to use a Raspberry Pi as a replacement for a desktop or laptop computer then Pidora is definitely worth a look.  Of all the distros on the Raspberry Pi, Pidora is probably the closest to a regular desktop version of Linux .

Wednesday, September 17, 2014

uBlock for Chrome - Give it a try

One great thing about Firefox and Chrome is their extensive libraries of add-ons, plugins, extensions (whatever you want to call them).  I do not install many, but the ones I do install I could not imagine "surfing" without them.  One of my long time favorites is AdBlock Plus.  This plugin does a great job of blocking many of the ads we are bombarded with on a regular basis.

I just found an even better alternative to AdBlock Plus.  It is called uBlock (micro-block).  uBlock does the same thing as AdBlock Plus, in fact it uses the same lists and filters as AdBlock Plus.  But what sets uBlock apart is how efficient it is.  The authors wanted to create an ad blocker that is A) as fast as possible, B) as memory efficient as possible, and C) as clean and simple as possible.  And they succeeded!  uBlock is fast, simple, and unobtrusive.

The only downside with uBlock is it is currently a Chrome only plugin, there is no Firefox plugin.  I really hope they come out with a Firefox version.  But in the meantime, all Chrome users should add this plugin to their system and reap the benefits.

Tuesday, September 16, 2014

Raspberry Pi DVR - Raspbian

The Raspberry Pi has lots of different operating systems to choose from.  For my DVR project, instead of picking one and trying to make it work at all costs, I decided to experiment with each operating system one by one.  That way I can see the strengths and weaknesses of each before deciding which operating system is the best for me.  To start things off I will be looking at Raspbian.

Raspbian is the main operating system for the Raspberry Pi.  It is a version of Debian "Wheezy" Linux made specifically for the Raspberry Pi.  It's a general purpose operating system, so you should be able to do most anything from Raspbian that you could do on a regular computer.

Raspbian Debian "Wheezy" - September 2014 (kernel 3.12)
Installing Raspbian is very easy.  Download the image then use a tool like Win32 Disk Imager burn the image onto your SD card.  The first time you boot a configuration screen will pop up.  I made the following changes on this screen (you can rerun this tool later on to make these changes).

  1. Select "Enable Boot to Desktop" and then "Desktop log in as user pi."  Without this change Raspbian will boot to command line, with this change Raspbian will boot to a nice graphical interface.
  2. Select "Internationalization Options" and then "Change locale."  Place a check by "en_US.UTF-8 UTF-8."
  3. Select "Internationalization Options" and then "Change time zone."  Linux handles time zones differently than Windows.  Instead of selecting your time zone by name or UTC offset, you instead select a region and a city near you.  So for me I select Americas and Los Angeles.
  4. Select "Internationalization Options" and then "Change keyboard layout."  For me I selected "Generic 104 key" and "English US."  This step is important as the default keyboard layout is English UK with things like the pound sterling symbol.
  5. Select "Advanced Options" and then "Overscan."  Set this option to disabled.  Older analog TVs have overscan where the image is smaller than what the TV can display.  If I don't disable overscan then on my computer monitor I have half an inch of black all the way around the outside edge.  Disabling overscan corrects this.

Once Raspbian is loaded, I used the "WiFi Config" link on the desktop to configure my wireless network.  I'm pleased to report that Raspbian includes drivers for the Rosewill RNX-N180UBE so the network worked as soon as I entered my wireless password.

One very common task on any operating system is browsing the Internet.  The Raspberry Pi has at least 4 browser options.  I tried each to see which worked the best; Iceweasel, Midori, Chromium, and Epiphany.
  1. Iceweasel is the Raspberry Pi version of Firefox.  To install it you run the command "sudo apt-get install iceweasel"  Whereas Firefox is my favorite browser on Windows, the Raspberry Pi does not do it justice.  It was the slowest of the bunch making surfing a painful experience.  On the plus side, the pages were rendered perfectly and looked as they should.
  2. Midori was the default Raspbian browser up until one month ago.  It was faster than Iceweasel, but still slow.  I also noticed some pages looked as if they did not render correctly.
  3. Chromium is the Raspberry Pi version of Chrome.  Chromium was fast and also rendered the pages correctly.  To install Chromium run the command "sudo apt-get install chromium"
  4. Epiphany was just released about a month ago.  It is the result of about 10 months of work dedicated to making the fastest most optimized browser for the Raspberry Pi's limited hardware.  And it shows!  Epiphany was the fastest of the bunch, rendered all pages correctly, and has a clean simple UI that was easy to use.
I would recommend Epiphany to anyone using a Raspberry Pi.  If you need a second choice, then go with Chromium.  Regardless of which you chose, all 4 browsers scored a perfect 100 on the acid 3 test.  You might run into problems getting Epiphany installed if you are using an older image.  I initially started testing with the June 2014 Raspbian image which does not include Epiphany.  There are instructions on adding it to your system, but each time the upgrade process hung.  I repeated it 3 times on fresh images, each time it hung.  Eventually I got it installed right about the time they released the September 2014 image which contains Epiphany out of the box.  So unless your image contains data you must keep, I recommend wiping your SD card and starting fresh with a new image.

The next hardware question was does Raspbian see the Hauppauge 950Q TV tuner?  The kernel does see it, but you need to manually install a firmware file (more on that in a later post).  Next you need to install the tvheadend server.  First run the command "sudo curl http://apt.tvheadend.org/repo.gpg.key | sudo apt-key add -" then edit the file /etc/apt/sources.list.  Append the following to that file, "deb http://apt.tvheadend.org/stable wheezy main"  Lastly, run "apt-get update" and "apt-get install tvheadend"  This will install and start the tvheadend server.  tvheadend did see the TV tuner and started to pick up local TV channels.  I won't go into more details about tvheadend right now.  I'll save that for another post.  After all, whether I use Raspbian or something else like OpenElec, the configuration of tvheadend will be the same, so best to cover it once in a dedicated post.

The final tests I wanted to run on Raspbian is remote access.  Using the Putty on another computer I was able to connect to SSH on the Raspberry Pi.  SSH was enabled by default in Raspbian.  SSH access was fast and snappy, as you'd expect from a command line only connection.

I also tried Windows Remote Desktop Connection.  On the Pi I ran "sudo apt-get install xrdp"  After which I was able to connect remotely from Windows using the built-in Remote Desktop tool.  The connection was relatively responsive.

The final remote option I tried was VNC.  I installed TightVNC server on the Pi, but no matter what I tried I was unable to connect using another computer.  I don't know if the server wasn't properly started, or maybe the port was wrong.  But I never got it working.  Since I had two other ways to remotely connect, I decided not to pursue this any further.


Well there you have it.  My first distro review for the Raspberry Pi.  For the most part it was easy to use, but I recommend a lot of tinkering to get used to the quirks.  For example, it took me a while to figure out how to set the keyboard to US layout instead of UK layout.

Tuesday, September 9, 2014

Windows will not load after ImageX

One thing I do a lot is image a computer and restore that image using Microsoft's ImageX utility.  Imaging a disk is one of the fastest ways to backup a computer.  But about 1 in 4 times that I restore an image the computer will not boot afterwards.  I never knew why it worked most of the time, but had a high rate of failure.  What's more, it made me very hesitant to use this in critical situations.  What if I backup a computer knowing I will need to restore the image, and that image restoration fails?  You'd never put your money in a bank that has a 1 in 4 chances they will lose your money, right?  Fortunately, I recently found out what the problem is, and more importantly, how to fix it.

First let me describe the symptoms.  After performing a restore from a WIM file using ImageX, you reboot your computer.  But instead of Windows loading you get an error screen saying:

Status: 0xc000000e
Info: The boot selection failed because a required device is inaccessible.

The problem here is the Boot Configuration Data (BCD) info.  Windows stores the boot information in a BCD file and for whatever reason the BCD from the image file is not compatible with the new system after restoring the image.

To correct this problem you need to first boot your computer from a WinPE CD or USB drive.  I won't explain that as there are lots of guides on the Internet.  Once WinPE is loaded, if you type "bcdedit.exe" you will see the problem.  Three of the fields are "unknown."


The following 3 commands will restore these unknown values and fix the problem

bcdedit.exe /set {default} device partition=c:
bcdedit.exe /set {default} osdevice partition=c:
bcdedit.exe /set {bootmgr} device partition=c:

After this, simply reboot and Windows should load normally!

Tuesday, September 2, 2014

Funny sayings

This is a random post with some funny things I ran across recently.  First is a saying:
A PC a day keeps the Apple away.
As a longtime Apple-hater, this is just hilarious to me!  And so true!


The second funny thing is funny SSID names for your home wireless router.  One of my neighbors has a funny SSID, which got me curious so I googled to find more.  Here's a list of the funnier ones I found:

  • Don't sleep with my wifi
  • It hurts when IP
  • Pretty fly for a wifi
  • Bill Wi the Science Fi
  • FBI Surveillance Van
  • Get off my LAN
  • All Your Bandwidth Are Belong To Us
I guess some people use them to send subtle (or not so subtle) messages to their neighbors such as:
  • Stop stealing our Internet
  • Keep your kids off my lawn
  • Stop your dogs from barking
These aren't as funny as the first group unless your situation warrants it.

Thursday, August 21, 2014

Raspberry Pi DVR - Software

In addition to the hardware for this project, I'll need software to make it all work.  For all intents and purposes, the only OS that runs on the Pi is Linux - which is fine by me.  I first learned Linux back in college only a few years after the OS was created.  Yes, my Linux "skills" are no where near my Windows "skills," but I know enough to be effective in the OS.

My ultimate goal is to create a DVR, so to make that happen I need TV recording software.  So far the only software I've found that supports this task is "tvheadend."  If I go with my stretch goal of a full-blown media center, then I'll need a software package to play videos and media content.  Here I have several options, but in truth there is really only one contender - XBMC (soon to be renamed "Kodi").

Linux is different than Windows in that you can get Linux from many different sources, each source being custom tailored for a different use.  Each of these different versions is called a "distro."  For the Raspberry Pi I have 5 different distros that I am considering.  One may work better than another with the hardware I have and the goals I'm trying to accomplish.  So my plan is to try all 5 distros and report back on each.  I'll blog about each distro in a separate page as I test with them.  But here's an overview of the 5 distros I'm going to try.

Raspbian
Raspbian (a.k.a. Wheezy) is pretty much the default OS for the Raspberry Pi.  If you're looking to use the Raspberry Pi as a general computer; web surfing, checking emails, word processing, programming, etc. then you'll most likely use Raspbian.  It has a friendly graphical user interface along with support for a lot of hardware and software packages.  My guess is all new Pi owners should at least start here, to get a feel for how the hardware and software works before moving onto more specialized options.

Raspbmc (soon to be renamed OSMC)
As stated above, XBMC is the preeminent media center application for the Pi.  Whereas you can install and run XBMC on Raspbian, with so many resources used by the OS it sounds like it will run sluggishly and/or have issues.  Enter Raspbmc - one of several distros dedicated to running XBMC on the Pi.  Raspbmc is built on top of Linux, but it is built specifically to run XBMC.  Anything in the OS that is not needed by XBMC has been removed.  What's more, the creators have taken the time to add drivers and support for hardware specifically used by media centers.  Hardware like TV tuners, remote controls, etc.  The trade off is these media center distros are not general purpose computers.  You cannot check email, surf the web, etc.  In fact, when you power up the Pi it boots directly into XBMC.

OpenElec
OpenElec is another dedicated media center distro for the Pi.  It sounds like OpenElec is Raspbmc taken even further.  Even more of the unused parts of the OS have been removed making OpenElec tiny and fast.  It sounds like OpenElec is even faster than Raspbmc, but at the cost of customization.  If OpenElec has support for your hardware then you're golden, but if not it sounds like your only option is to download the sources and recompile OpenElec yourself - not for the faint of heart.

Xbian
Xbian is the last of the dedicated media center distros I'm going to look at.  From what I've read, Xbian sounds like a cross between Raspbmc and OpenElec.  It's got the speed of OpenElec with the customization and flexibility of Raspbmc.

RetroPie
The last distro is completely different from the others in that it is not for media but is designed to play retro video games.  It's basically a collection of computer and video game emulators as well as free and open-source video games from the 70s, 80s, and 90s.  Assuming I connect the Pi to my TV (and not headless in the garage) this would be a fun distro to have on hand for playing "old-school" video games.


That's a summary of the 5 distros I plan to look at.  Not having tried the distros, only going by what I've read on the Internet, it sounds like OpenElec and Xbian are the most promising for my goal.  I think it all boils down to if these two distros have drivers for my hardware, and if not then I'll have to research how to add that support.

As I said, I plan to run all 5 distros and report back on my findings and impressions of each.