This past weekend I began work on a new project to prototype a new PVR/Media Centre device that runs on the Raspberry Pi 3B hardware platform using the LibreElec OS.
My plan was to combine the PVR/Media centre Device with an HDHomeRun Network Tuner to receive Free To Air TV Channels and still offer all of the benefits of running Kodi Media Centre. This gives someone the most flexibility in choosing how to receive and watch TV.
There are multiple scenarios to consider but for the purposes of this article I’ll just use my own scenario:
In my case I am using a couple HD antennae mounted on a 30′ TV Tower and get 30 or 40 channels depending on the weather, but we want to be able to pause and record these channels. At the same time you can subscribe to international IPTV services which gives us other channels from various networks around the globe. This gives me my fix of specialty channels and then I throw Netflix in to the mix to watch movies. I also have a hard drive full of DVD Rips sitting on a 2TB external Drive from my vast collection of DVD’s so I want all this in one easy to use interface.
The Project: Raspberry Pi, LibreElec, HDHomeRun & Kodi media Centre Project.
1. Raspberry Pi Media Centre Kit which includes: Retail Price: $89.95
- Raspberry Pi Model 3 B
- Class 10 16GB MicroSD Card pre-loaded with XBMC (OpenELEC)
- Our very own HighPi Raspberry Pi Model B+/2/3 Case
- 5.25V 2.4A Power Supply
- Cat6 Ethernet Network Cable
- High Quality 3ft HDMI Cable
- Aluminum CPU and GPU Heatsinks to keep your Pi running cool
2. 2 TB External Hard Drive – Western Digital (Already Had this) – Approximate Cost now $50-100
3. NuRoMedia Mini Keyboard (Already Had this) – Retail Price $25.00
4. HDHomeRun Connect DUO – Retail Price: $159.95
Pictures of all equipment below:
Setup the RaspBerry Pi:
The Raspberry Pi Media Center Kit comes with a 16GB micro SD card with the openelec build with Kodi etc already on it. I discovered that OpenElec is no longer being supported very well by the project owners (its an open source project) so I went to LibreElec instead. LibreElec is what is known as a code fork. In this case it’s a code fork of OpenElec (A Code Fork is when another group takes the source code and changes the name, creates their own project and begins working on it).
LibreELEC (short for Libre Embedded Linux Entertainment Center) is a non-profit fork of OpenELEC as an open source just enough OS (JeOS) Linux software appliance distro for Kodi. This fork of OpenELEC announced in March 2016 as a split from the OpenELEC team after “creative differences”, taking most of its active developers at the time to join the new LibreELEC project. This is a conservative fork of the OpenELEC project with a stronger focus on pre-release testing and post-release change management.
When building a device such as this, you rely on your own ability to maintain the system, so choosing an appliance OS that’s being actively supported by people that love what they do (they have to, because they don’t make any money off of it.) is important. If you are saying to yourself….why would anyone work on something like this and produce code if they aren’t making any money? …. Take some time to read about open source software and the open source software movement and GNU/GPL foundation…..you’ll understand better.
The people supporting the LibreElec OS are dedicated to better pre-release testing and post-release change management, so from this we can expect more stable releases that have all the bugs worked out before released for General use to people like us.
1. Download the LibreElect image. (at the time of this article : LibreELEC-RPi2.arm-8.2.4.img.gz (info)) Go to LibreElec–>Downloads to see what the latest is and download for the Raspberry pi version that matches your hardware. Ours is Version 3B
After This it starts to get more complicated because you need to know how to write an image to a Flash.
Basically you take the downloaded GZip file and run a command or a program to uncompress and write this image to the SD card, thus making it a bootable OS.
The way to do this is different on Mac Vs Linux and Different yet still in Windows.
To make this easier, our friends at LibreElec created a program to write the Flash for us.
To create bootable USB or SD Card installation media for any LibreELEC supported platform, download the “LibreELEC USB-SD Creator” app and run it with administrator rights: https://libreelec.tv/downloads/
If you’re using Linux, the method for Linux is below, below that you’ll see the mac OSX method that I used.
A(1): Linux | Download and Uncompress LibreELEC to MicroSD Card
Use the following instructions to download and write the LibreELEC image to the microSD card.
- Insert the MicroSD card into your computer.
- Determine the which /dev/device it is.
dmesg | tail
$ dmesg | tail [ 227.218363] sdhci-pci 0000:01:00.2: PCI INT A -> GSI 16 (level, low) -> IRQ 16 [ 227.218396] sdhci-pci 0000:01:00.2: Refusing to bind to secondary interface. [ 227.218413] sdhci-pci 0000:01:00.2: PCI INT A disabled [ 227.218884] jmb38x_ms 0000:01:00.3: enabling device (0000 -> 0002) [ 227.218906] jmb38x_ms 0000:01:00.3: PCI INT A -> GSI 16 (level, low) -> IRQ 16 [ 227.218931] jmb38x_ms 0000:01:00.3: setting latency timer to 64 [ 227.617315] mmc1: new SDHC card at address 0001 [ 227.617720] mmcblk1: mmc1:0001 SD8GB 7.32 GiB [ 227.621661] mmcblk1: p1 p2 [ 228.753036] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)
From above output the device is /dev/mmcblk1 (we ignore the partition portion p2).
WARNING: It is very important to identify the correct device. Use of the wrong device path can result in loss of data and/or the operating system.
- Ensure that the device is unmounted by checking the output from df to see if the device is in use.Example output:
$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 6734812 5612328 780368 88% / udev 499152 4 499148 1% /dev none 506428 8 506420 1% /tmp tmpfs 101288 844 100444 1% /run none 5120 0 5120 0% /run/lock none 506428 72 506356 1% /run/shm none 506428 572 505856 1% /var/log none 506428 0 506428 0% /var/tmp /dev/mmcblk0p1 15615056 1183088 14431968 8% /media/mmcard16gb /dev/mmcblk1p1 261868 111280 150588 43% /media/0F39-638F /dev/mmcblk1p2 7177771 83036 7094735 2% /media/0c0676d8-24f7-43c4-8bed-d19e6ea3a147
If the device is in use then unmount each mount point.
Using the example above we unmount two locations from mmcblk1:
sudo umount /media/0F39-638F sudo umount /media/0c0676d8-24f7-43c4-8bed-d19e6ea3a147
- Write the image to the microSD Card.Be sure to use the correctly identified device! In this example the device path is /dev/mmcblk1.
zcat ~/Downloads/LibreELEC-*.img.gz | sudo dd of=/dev/mmcblk1 bs=4M sync
- Remove the microSD Card.
A(2): MAC OSX High Sierra
1. Use Finder and go to the Gzip File and uncompress it with your file compression app.
2. Once uncompressed, you’ll have a .img file. In this case the file name is LibreELEC-RPi2.arm-8.2.4.img
Now you go to a terminal window from the utilities folder.
At the terminal window you will first determine what devicename the SD Card is on the MAC, then flash it
See your list of disks:
- Identify the disk (not the partition) of your SD card, e.g.
- Unmount your SD card by using the disk identifier, to prepare it for copying data:
diskutil unmountDisk /dev/disk<disk# from diskutil>where
diskis your BSD name e.g.
diskutil unmountDisk /dev/disk3
- Copy the data to your SD card:
sudo dd bs=1m if=image.img of=/dev/rdisk<disk# from diskutil> conv=syncwhere
diskis your BSD name e.g.
sudo dd bs=1m if=2018-03-13-raspbian-stretch.img of=/dev/rdisk4 conv=sync
- This may result in a
dd: invalid number '1m'error if you have GNU coreutils installed. In that case, you need to use a block size of
bs=section, as follows:
sudo dd bs=1M if=image.img of=/dev/rdisk<disk# from diskutil> conv=sync
This will take a few minutes, depending on the image file size. You can check the progress by sending a
SIGINFOsignal (press Ctrl+T).
- If this command still fails, try using
rdisk, for example:
sudo dd bs=1m if=2018-03-13-raspbian-stretch.img of=/dev/disk4 conv=sync
sudo dd bs=1M if=2018-03-13-raspbian-stretch.img of=/dev/disk4 conv=sync
- This may result in a
The OS is ready to go on the SD now, so now we can Move on to the next step.
Assemble your Raspberry Pi and put it in its case etc. Put the feet on, but don’t plug it into the power yet. Insert to the SD card into the Raspberry Pi Card Slot.
At first power up the image will be resized to use the entire microSD card, and then the RPi3 will reboot.
- At Welcome to LibreELEC screen choose Next.
- At Hostname prompt change or leave name LibreELEC and choose Next.
- At Networking screen with Wired and Wireless networks listed choose Next.
- At Sharing and Remote Access screen under Configure Services enable SSH and disable Samba. Choose Next.Enable Samba if you wish to access Windows network shares.Note that username is root and pasword is libreelec.
- At Thank you screen choose Next.
From here you go through and setup KODI. There are lots of Guides on how to do that so I won’t get into it.
In the Next Article in this series I will go through the physical setup of the HDHomeRun Device and the Raspberry Pi and how to Connect to the HDHomeRun Device from not only the Raspberry Pi, but also from your Tablet or PC. We also have choices on how to setup the DVR Services at this point. if you don’t mind paying 35.00 per year to HDHomeRUN you can setup the HDHomeRun DVR Service and use that. If you don’t want to pay for the HDHomeRun DVR Service, you can setup another piece of software called TVHeadEnd and use that. It has it’s upsides and downsides and I’ll explore those further in the next few articles in this series.
Here’s a teaser shot of what HDHomeRun Looks Like when watching TV on the Raspberry Pi after Setup.
Till Next time….Cheers!
Wil Roseblath – March 26, 2018