A Complete Guide to Help to Monitor Smart TV App with Raspberry PI
It was a Wednesday morning and I was sitting on a couch watching a daily soap with my mom. Suddenly, I got up and told my mom, “Mom, I am getting bored so I am ordering a Raspberry PI!”. Mom replies, “But I thought you were on a diet”. I know it sounds a lame joke. But this exactly happened when I first time tried to introduce Raspberry Pi to my mom.
So, When the box arrived she was curious to know how this tiny little device works? What am I gonna do with this?
“Ok! Ok too many questions so here it goes…..
The Raspberry Pi is a credit-card-sized computer that plugs into our TV and keyboard. It is a capable little computer which can be used in electronics projects, and for many of the interesting stuffs that our desktop PC does, like spreadsheets, word processing, browsing the internet, and playing games, watching videos etc.
I am going to make this work as a monitoring and debugging tools for our smart TV, STB, HDMI sticks etc. It will let you know what is going wrong with your favorite episode of daily soap. It will show you if its your network, your app or your content.”
Mom, “So you are going to make my living room ugly with those wires lying all around?”
“No Mom, it is tiny little device and we can hide it just behind our TV Cabinet and we can access it remotely through our computer.”
“Ok! Show me how are you going to do it I will try to do it myself. “
“Mom but it requires some knowledge of basic linux commands and monitoring tools.”
“Well! Well! I am the mother of three Engineers so I am already aware of some basic Linux commands and if I get blocked I can google it!”
“Ok so let’s get started….
The Essentials for Monitoring Smart TV using Raspberry Pi
- A Raspberry PI V3 with Raspbian Jessie with Pixel installed.
- USB to Ethernet connector
- 2 LAN Cables
- SD Card and Card Reader
- A good internet connection
First of all, format you SD card and try to flash the latest Raspian OS https://www.raspberrypi.org/downloads/raspbian/ from here.
Now you boot your PI and open the terminal.
Try to install all the packages using the following commands:
$ apt-get update
$ apt-get upgrade
$ apt-get install -y curl wget vim openssh-client libxml2 git python2.7 python2.7-dev python-pip build-essential libssl-dev git dnsmasq
Now go to /etc/sysctl.conf and uncomment this line:
net.ipv4.ip_forward=1
Next connect your Ethernet cable on the LAN port available in Raspberry PI and connect that other end with the device you want to monitor (OTT box, Smart TV, HDMI Sticks). Now, Use the USB to LAN connector and connect one end in Raspberry PI and another with your Internet. The setup should look something like this:
Now, Install dnsmasq in your PI.
$ apt-get install dnsmasq
Now we will set up the DHCP server to assign the IPs
It is recommended to take the backup of the available file
$ cp /etc/dnsmasq.conf /etc/dnsmasqOld.conf
Add the following to the new file, /etc/dnsmasq.conf
interface=eth1
dhcp-range=192.168.0.2,192.168.0.254,255.255.255.0,12h
Now we need to define the network interfaces so that the device can connect properly to the Pi as well as the Pi to the internet.
Please take the backup of the available file:
$ cp /etc/network/interfaces /etc/network/interfacesOld
Now, add the following to the new file: /etc/network/interfaces
iface eth0 inet manual
auto eth1
iface eth1 inet static
address 192.168.0.1
netmask 255.255.255.0
Now, reboot the Raspberry PI.
All Set Mom!! Now, just get the IP address of your raspberry PI:
$ ifconfig
Now, once you have got your IP address so forget about the Raspberry PI. You can hide it behind the cabinet so it doesn’t spoil the beauty of the living room!!
Now, sit in any corner of the home on your laptop and open the terminal. But mom make sure that you are in the same network as your device and PI.
In your terminal type:
$ ssh pi@ur.pi.ip.add
It will ask for the password; the default password is: raspberry (Unless you have changed it)
So, now you are remotely able to access the PI.
$sudo apt-get install tshark
Once installed try to play open the app you want to monitor and type the following in your terminal:
$ tshark -i eth1 -Y http
Takeaway for you MOM
“That’s it!!
That was easy! But what were to talking about some debugging can you show me that?”
Well Mom, that’s for the next time now. For now, it’s time to go shopping. ☺
Now that you have learnt to monitor your logs and see what’s going wrong, how about sharing this piece of valuable information with those who can put this in practice?
Thanks for the read.