Raspberry Pi on your TV
Tags: raspberrypi
Published: 2019-02-09 17:42:35

---
title: Raspberry Pi on your TV
published: true
description: 
tags: raspberry_pi
cover_image: https://thepracticaldev.s3.amazonaws.com/i/edwhkzq3g3fo0fa12xsk.jpg
---
I had a raspberry pi that was gathering dust for a few months. Earlier last month I hooked it up to a usb keyboard, mouse and a monitor and got the WiFi set up. But with all the messy wires and the dedicated real estate for the screen, it defeated the purpose of being a pocket size computer. 
Last weekend I finally got it to a setup that I am happy with. Optional bluetooth keyboard and mouse, so no messy wires.


### Using the TV as a monitor
The idiot box is a vice of mine that sucks up all the productive time. Since it has a dedicated place already in my living room already, plugged it to the TV. So fun that I have a linux machine hidden behind all the trinkets on TV cabinet!

![pi tv](https://thepracticaldev.s3.amazonaws.com/i/wsm472onfe8sneswehcy.jpg)

A small settings change was needed so that I can instantly switch over to the pi when I turn on my TV or switch over from other HDMI inputs. Edit the lightdm configuration `/etc/lightdm/lightdm.conf` as root and uncomment the line `xserver-command=X` to `xserver-command=X -s 0 dpms`. Save and `reboot`.


### Phone Apps to replace mouse and keyboard

#### Terminal emulator
[Termius](https://www.termius.com/) - A beautiful terminal emulator that is fast, feature packed and best of all - free for my purposes. Just install, connect to the raspberry pi’s up address and boom you are on the shell. It amazes me how beautifully the ncurses screens renders on Termius!


<img src="https://thepracticaldev.s3.amazonaws.com/i/z2gvvi6vaudueme80gjw.jpg" alt="drawing" width="200"/>

Side note: [Fing](https://www.fing.com/) is a nice little app to find the up addresses of devices on your network.

#### GUI access with Phone/Ipad
Install [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/) on your iPhone or iPad. On the pi, install realvnc.

```
sudo apt-get update 
sudo apt-get install realvnc-vnc-server
reboot
```

After rebooting `sudo raspi-config` > *Advanced Options* > *VNC* Enable. 👍


That’s it! You a running Linux desktop on your TV that you can use with your phone or tablet. So theoretically, I can go from Netflix n chill to a linux desktop, with the flick of a button on the remote.


### (Optional) Bluetooth Keyboard & Mouse

While realVNC works better than I expected from the free app, it wouldn't be bad to throw in a bluetooth keyboard and mouse to the mix. My Magic Keyboard and Mouse are small and wireless - would probably be useful at times.

```
sudo bluetoothctl
scan on
connect ma:ca:dd:re:ss:00
pair ma:ca:dd:re:ss:00 
remove ma:ca:dd:re:ss:00
```
<img src="https://thepracticaldev.s3.amazonaws.com/i/cumy1ii7rmbqp3xafwi2.jpg" alt="mousenkeyboard">


Tip: Here's how to find the mac address of your bluetooth device, if you have them connected to your mac: click on the apple menu , hold down option key, click on System information and click on Bluetooth.


#### Wait. What does the cover picture have to do with this post?
Not a single thing. This is a picture I took at Sorrento. ❤️ Italy, can't wait to go back!