I turned my non-smart TV into an Android TV with Raspberry Pi — here’s how you can too | Harper29
Call Us Free 773-759-7945
user heart cart0
order Free Shipping on Orders Over $100

I turned my non-smart TV into an Android TV with Raspberry Pi — here’s how you can too

watch TV and movies primarily from streaming services, but one of my televisions lacks the smart features you find on Roku or Android TV. Despite its lack of smart features, that TV works great, so I turned it into an Android TV rather than buying a new one. I pulled it off using a Raspberry Pi 5, and so can you. Here’s how to do it.

Spice up your Raspberry Pi game with these cool distros

Android TV on your Raspberry Pi: what you’ll need

You can turn your Raspberry Pi into an Android TV box in several ways. One method is to install Emteria OS, then download the apps you need and a more TV-friendly launcher. However, the free version of the best Android TV launcher hasn’t been updated in quite some time.

Fortunately, KonstaKang has up-to-date builds of Lineage OS, another Android distribution, with a good launcher already installed. It’s unofficial and is considered beta quality. The official Lineage OS team won’t offer any support.

 

First, download the necessary files from KonstaKang’s website. Then, select the Raspberry Pi model you have from the Devices dropdown menu and then LineageOS 21 Android TV. Don’t download the TWRP flashable OTA package unless Android TV is installed.

While on the page, scroll down and download any additional files you think you need. You’ll definitely want KonstaKANG-rpi-resize.zip, because flashing the Android TV image to the micro SD card will leave a lot of storage space unallocated. Other packages I recommend downloading are:

Package

What it does

Widevine 14

Allows you to stream DRM-protected content from streaming services like Google Play, YouTube, Netflix, and more.

Magisk

Provides an easy route to root access.

MindTheGapps

Installs Google Play apps and services.

Installing the Android TV image to your Raspberry Pi

You’ll need to write the LineageOS image to your microSD card to get started. Insert the card into your SD reader, launch the Raspberry Pi Imager app, and follow these steps.

  1. Click Choose Device and select your Raspberry Pi model.
    RPi Imager Choose Device
  2. Next, click Choose OS > Use custom. Choose the LineageOS zip file you downloaded earlier.
    RPi Imager Use custom OS
  3. Click Choose Storage, then pick your micro SD card.
  4. Now, click Next > No, then confirm you want to erase the micro SD card and write the Android TV image.

Copy the other zip files to your microSD card once the image is flashed. That way, they’ll be readily available when you need them. Insert the microSD card into your Raspberry Pi, plug it into your TV, and power it up. You may also want to connect a keyboard and mouse for the initial setup.

First steps with Android TV on your Raspberry Pi

After your Pi boots, the first thing you can do is connect a game controller. This will help you navigate Android TV until you get a remote set up. If you don’t have a controller to connect, press F1 on the keyboard to exit the pairing process.

AndroidTV pair bluetooth controller

KonstaKang’s LineageOS distribution supports other keyboard shortcuts, too.

Keyboard key

What it does

F1

Return to Android TV Home screen

F2

Go back

F3

Multitasking menu

F4

Menu

F5

Power

F11

Volume up

F12

Volume down

Next, we need to enable advanced reboot options to access the TWRP Recovery Tool. To do so, navigate to Settings (gear icon) > System > Buttons and enable Advanced Restart.

We need to reboot into TWRP Recovery and install any extra software required.

TWRP Recovery Main Menu
  1. Choose Settings > System > Power and Energy > Restart > Recovery.
  2. Click Install. If you copied the packages to the micro SD card, they will be in the boot folder.
  3. Always run KonstaKANG-rpi-resize.zip first to reclaim the unallocated storage space on your micro SD card. Reboot to recovery if you have more to install; otherwise, reboot to the system.
  4. Install any other packages you want, such as Widevine 14, Magisk, or the Google Apps package.
  5. If you’ve installed Google Apps, be sure to choose Wipe > Factory Reset after installation finishes.
  6. Finally, reboot to system.

Doing more with Android TV on your Raspberry Pi

AndroidTV customize home screen

If you’ve installed Google Apps, your new Android TV box will prompt you to log in to your Google account when it boots up. This will give you access to the entire Google Play Store, where you can download apps and buy or rent music, movies, or TV shows.

As of this writing, Netflix is not available on the Android TV Google Play Store. You can, however, find it on APKPure.

You can also customize it further, such as connecting an IR remote, configuring a physical power button, setting up SSH, and more.

Connecting an IR remote

If you have an IR remote that’s Android TV-compatible, you can set it up in Settings. Enable it in Settings > System > Raspberry Pi settings > Infrared remote.

To set up key mapping for the remote, see the FAQ on KonstaKang’s web page for your device. I chose just to use my Xbox controller, which works very well. For an Xbox controller, the button functions on Android TV are as follows:

Controller button

What it does

Xbox button

Return to Android TV Home screen

Left stick or D-pad

Navigate up, down, left, right

Right stick up/down

Volume control

Right stick left/right

Channel control

A button

Select an option

B button

Back to previous screen

Press and hold B button

Exit app

Enabling SSH access to your Android TV box

Many folks like to be able to SSH into their Android TV box for maintenance, installing applications, or otherwise managing the system and files. Android doesn’t have user accounts with passwords, so it uses key-based authentication with SSH instead. When you first boot your Android device, it generates the necessary keys. You can either pull the private key to your computer or push your own previously generated keys to the device.

To accomplish this, you'll use the Android Debug Bridge command line tools. If you've installed Android Studio, these tools are already on your computer. If not, you can download the command line tools directly and install them.

Once the ADB tools are installed, you can connect to your Raspberry Pi Android TV to get your SSH keys. First, find your Android TV's IP address at Settings > System > About > Status > IP address. For this article, I’m using 192.168.0.100. Also, make sure to enable Android debugging and rooted debugging under Settings > System > Developer options. With that information, issue these commands.

  1. Connect to your Raspberry Pi Android TV: adb connect 192.168.0.100
  2. Authenticate as root: adb root
  3. Next, download your SSH keys: adb pull /data/ssh/ssh_host_ed25519 key myprivatekey
  4. Set the proper permissions on the key to ensure your security: chmod 600 myprivatekey
  5. Once done, you'll be able to SSH into your Android TV with this command: ssh -i myprivatekey root@192.168.0.100

Once you’re done retrieving your private key, you should disable adb.

Connecting a physical power button

While the Raspberry Pi 5 has a power button, earlier models do not. You can make your own by connecting a power button to the GPIO header on your Pi. Just connect it to ground and GPIO 21 (right next to ground).

To enable the power button, toggle Settings > System > Raspberry Pi settings > Power button. If necessary, you can use the same button to access TWRP Recovery by pressing and holding it while powering on the device until you see the TWRP screen.

Enjoy your new Android TV box

You should now have a working Android TV installation on your Raspberry Pi. If you installed the Google Apps, you also have the Google Play Store and all that comes with it. Of course, you can also install APK packages directly or use a different app store, like F-Droid or APKPure. Now, all you need to do is sit back and enjoy your new entertainment options.

Leave a comment

Please note, comments must be approved before they are published