Projects‎ > ‎

TUX TV

TUX TV is an Android application that can be used for controlling my IP2IR bridge and also displaying a TV Channel guide.

The TV Channel guide is using xmltv to get the channel data. The channel data that as provided by xmltv usually have some restrictions, for instance that you are not allowed to retrieve the channel data several times/day or that the channel data can't be used in commercial applications so the actual handling of downloading the channel data will handled by my SheevaPlug, i.e. outside my Android application. The SheevaPlug is running Ubuntu and it has a 1,2 GHz ARM CPU / 512 MB RAM. The device is quite fast and it will be running a web server 24/7 and it has a very low power consumption.
The idea is that the Android application will be using it's WLAN connection to communicate with the SheevaPlug's web server and with the IP2IR bridgeMy Android phone(HTC Desire) is running Android 2.2.2 and it is quite slow when parsing large(several 100 kBytes) xml-files so to be able to get good user experience in the application will the retrieved xml-file be converted to a simple textfile, before it is sent to the phone.

Install xmltv:
apt-get install xmltv

Read the Xmltv's instructions regarding how to configure which channels you want to retrieve channel data for. After the configuration has finished should we create a file named channels.txt that include which channels we want to display in the Android application. Note the the channels will be displayed in the same order as in the file.

cat /home/robert/.xmltv/tv_grab_se_swedb.conf | cut -b9-200 > /home/robert/projekt/web_server/tv/channels.txt

The commands that will be sent to the IP2IR bridge is defined in  ip2ip_channels.txt:
robert@debian:~/projekt/web_server/tv$ more ip2ip_channels.txt 
1
2
3
4
5
6
7
8
9
1!0
1!1

It is possible to send several commands when clicking on a certain channel and the commands should be separated with a "!" character. Since we want to collect new channel data every day have I created a simple cron job that is executed every night: 
/usr/bin/tv_grab_se_swedb -days 1 --output /home/robert/projekt/web_server/tv/tv.xmltv >/dev/null 2>&1
/home/robert/projekt/web_server/tv/parse_xmltv.py > /home/robert/projekt/web_server/tv/parsed_xml.txt 

The address for the web server/ IP2IR bridge should be defined in the Android application and I'm using the following settings:
Web server: "http://192.168.0.66:8000/tv"and IP2IR bridge ip : "192.168.0.50"
To be able to get channels logos in the Channel Guide must pictures be stored in /tv/icons/{channel_name}.png ,for instance tv/icons/svt1.svt.se.png.

User guide
Short press on a item in the list box -> sends commands to the TV, thus switching TV channels
Long press on a item in the list box -> displays detailed description about the programs 
Physical volume up/down buttons -> Changes the TV's volume

 Click ButtonDescription
 POWERPower on/off the TV 
 CHAN UP/DOWNChange channel
 MUTEMute/unmute the sound on the TV

Comments