Introduction: Setup Raspberry Pi 3

This is not a generic Raspberry Pi setup, it is focused on being used as the basis for a multicast OTA TV Tuner system. Multicast OTA TV should not use Wi-Fi. So, it is not setup. The OTA setup in in this instructable.

A Raspberry Pi Media Center must meet the following requirements:

  • Stream my videos
  • Stream my music
  • Display my photos
  • Stream free internet channels
  • Stream OTA (over-the-air or off-the-air) TV
  • Record and playback OTA TV (PVR or DVR functionality)
  • Stream protected channels (e.g., Hulu, Netflix, Amazon, etc)

By "stream", I mean it must go to every device connected to my home network, and to family's smartphones, tablets, and laptops.

As of 04JUN2017, the last requirement is not supported by any media center running on the Raspberry Pi. Instead of using open source media centers. I chose Roku to replace my set top box. However, Roku doesn't seem to support OTA TV with recording and playback.

OTA TV is required because it is okay to wait a day or two to watch a TV show, but it is not acceptable to wait a day or two to watch time sensitive content, like a basketball or football game.

Google (cwne88 and multicast) and you will meet my hero. He built an impressive OTA TV setup.

To stream OTA TV, I need to build 6 Raspberry Pi-based TV Tuners to capture the local channels. So, I will be using these instructions repeatedly.

This instructable is useful on its own and will allow me to reference it from other instructables as I complete the next steps in my OTA TV system.

Step 1: Gather Parts

I have found the parts below perform best in my applications.

Get parts and tools (prices in USD):

  • Raspberry Pi 3 Element14 $35
  • 5.2V 2.1A USB Power Adapter from Amazon $5.99
  • Micro USB to USB cable 3ft from Amazon $4.69
  • HDMI Cable 4ft from Amazon $5.99
  • Case from Amazon $6.99
  • SanDisk Ultra 16 GB microSDHC Class 10 with Adapter (SDSQUAN-016G-G4A) from Amazon $8.99

Parts lying around:

  • MacBook Pro (a PC could be used)
  • TV with HDMI port
  • USB keyboard, USB mouse

Notes:

  • Text enclosed in spades, such as, ♣replace-this♣, should be replaced with an actual value. Of course, remove the spades.

Step 2: Download Raspbian

Download latest version of Raspian

  • Download latest full version of raspbian
  • When this was last updated the latest version was: 2017-04-10-raspbian-jessie.zip
  • Move the zip file from downloads to a directory where you store images:
♣your-macbook-image-directory♣
  • Use an unzip utility to unzip zip file. I use "The Unarchiver", but any zip utility will work.
  • Rename the image so it doesn't contain parentheses or spaces.

Step 3: Burn Raspbian Image to Micro SD Card

Download Etcher

Follow the directions to install Etcher

Launch the Etcher app (On Mac, select Finder, New File Window, Applications, scroll to etcher and open). I use Etcher all the time so I pinned it to the Dock). Etcher has three steps:

  • Select a raspbian image
  • Select a disk
  • Flash

Enter your MacBook password when prompted.

For whatever reason, when etcher completes it says the disk is unmounted, but if I take it out I get a message saying the disk was not properly dismounted.

I haven't seen any downside from this, but if you want to do it correctly, do the following:

  • Find the microSD card disk image on your desktop. Select it and eject it.

Remove the microSD card.

Step 4: Raspberry Pi Setup and Connections

Heat Sink
Remove tape and press firmly onto the processor. The heat sink and chip are almost the same size. It was fairly obvious where it was supposed to go. I did not take a picture.

Case

Take case apart. The older version has three parts: top, bottom, and middle. Slide Raspberry Pi into the bottom part of case Slide Raspberry Pi into the bottom. There are two clips on the end where the SD card is inserted. The board must slide under these clips. It slides in easily, no need to force it. Again, this seemed very straightforward. So, there is no photo. It is good to keep the pi in the bottom part of the case.

Cables and SD Card

Insert these into Raspberry Pi

  • Micro SD card
  • Ethernet cable

Once the above are complete:

  • Insert power cable

Step 5: Setup Using Raspi-config

On the Raspberry Pi, open a terminal window.

raspi-config is a shell script for configuring the Raspberry Pi. The shell script displays a numbered menu and some actions at the bottom in angle brackets. Use the following commands to navigate:

  • On lists
    • [ * ] indicates selected, while [ ] is unselected
    • Use spacebar to toggle * on and off
  • On menu items, the red highlight means it is selected
  • Use arrow keys to move up and down
  • Use tab to move from menu items to actions
  • Use ENTER to take the action

Setup raspbian using raspi-config

$ sudo raspi-config

Change user password to:

♣raspberry-pi-password♣

Change the hostname to:

♣hostname♣

Change Localization Options to match your location (I am in Central, US):

  • keep en_GB.UTF-8 UTF-8
  • For the US, select US English UTF 8 (en_US.UTF-8 UTF-8)
  • Click OK, select UTF and click OK
  • Change time zone US and Central
  • Keyboard: Dell, Other, English (US), English (US)

Interfacing Options

  • Enable SSH

Advanced Options

  • Expand FIlesystem
  • Memory Split 16GB
  • Finish
  • Reboot

Step 6: ​Always Update and Upgrade

On Raspberry Pi open a terminal window, or on the Mac, open a terminal window and run the command:

$ ssh pi@♣hostname♣.local

Run the following commands

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get autoremove
$ sudo reboot

If there are errors, check that an Ethernet cable is plugged in.

Step 7: Setup Mail

Mail is very useful for receiving emails or alerts (text messages sent to a cell phone) about issues on the Raspberry Pi.

In a terminal window, install ssmtp and mail utilities:

$ sudo apt-get install ssmtp -y
$ sudo apt-get install mailutils -y

Edit the ssmtp configuration file:

$ sudo nano /etc/ssmtp/ssmtp.conf

as follows:

root=♣your-gmail-account♣@gmail.com
mailhub=smtp.gmail.com:587
hostname=♣your-hostname♣
AuthUser=♣your-gaccount♣@gmail.com
AuthPass=♣your-gmail-password♣
UseSTARTTLS=YES

Edit the SSMTP aliases file:

$ sudo nano /etc/ssmtp/revaliases

Create one line for each user in your system that will be able to send emails. For example:

root:♣your-account♣@gmail.com:smtp.gmail.com:587

Set the permissions of the SSMTP configuration file:

$ sudo echo This is a test email | mail -s "Test tvtuner email" ♣your-account♣@gmail.com<br>

And the Raspberry Pi is ready to use!

Step 8: Backup MicroSD Card

When Raspberry Pi is setup, then back up the image. Use this image to create the next OTA TV Tuner.

Also, backup the project when it is complete. If anything goes wrong with the SD card, then it is easy to restore it.

Shutdown the Raspberry Pi

$ sudo shutdown –h 0

Wait until the card has shutdown, and then remove the power supply, and then remove micro SD Card

Insert micro SD card into SD Adapter, and then insert the SD adapter into MacBook

On MacBook use these instructions from The Pi Hut with modifications as follows:

Open terminal window

Change to directory containing raspbian image

$ cd ♣your-macbook-image-directory♣

Identify the disk (not partition) of your SD card e.g. disk4 (not disk4s1). From diskutil output, = 4

$ diskutil list

IMPORTANT: make sure you use the correct – if you enter the wrong disk number, you will end up wiping out your hard disk!

Copy the image from your SD card. Ensure the image name and are correct:


$ sudo dd if=/dev/disk♣micro-SD-card-disk#♣ of=tvtuner.img

CTRL-t to see the status of the copying.

When complete, unmount the SD Card:

$ diskutil unmountDisk /dev/disk♣micro-SD-card-disk#♣

Remove SD adapter from MacBook and remove micro SD card from adapter

Insert micro SD Card in Raspberry Pi

When setting up the next TV Tuner, use this image and skip many of the steps in this instructable. The only thing that will need to change is the hostname. Follow the directions in Step 3 but use tvtuner.img image, and change the hostname using raspi-config