I want to use my raspberry pi as a TV webbrowser to display messages at my youth house. To do that, I will configure it to power on the TV when people are present and shut the TV down when no one is around. Here is my checklist of todo things:
- Setup PI with SSH enabled
- Enable x11org vnc server to view hardware hdmi output. (With a fixed resolution)
- Install LibCEC to control the TV
- TBA Making it boot in a browser kiosk mode to display the infopage
- TBA Creating the infopage and managing software.
1. Setup Raspberry PI with SSH enabled
First of all we want to download the raspbian image from the official site.
Secondly, we are gfbashoing to put the image on our SD card. I recommend using at least class 10. Once for a school project we had troubles because our programs were running to slow, and upgrading the sd card solved all our problems. The software we use is Win32 Disk Imager.
Now we boot up the pi with a screen and keyboard connected. We enable ssh from raspi-config.
And how to find the raspberry pi’s IP address? Simple, just fire up advanced IP scanner and look for raspberry foundation or look at the hdmi output.
After that we connect to the raspi using putty. We run raspi-config to enable the gui, expand the file system etc…
pi@raspberrypi ~ $ sudo raspi-config
2. Enable x11org vnc server to view hardware hdmi output.
Using a simple vnc server will create a virtual desktop. For developing purposes this isn’t handy because we could get a different output on the screen.
First we will install the package.
sudo apt-get update && sudo apt-get dist-upgrade
sudo apt-get install x11vnc
Now we add a password.
pi@raspberrypi ~ $ x11vnc -storepasswd
Next, create a folder to hold the X11VNC desktop configuration file.
Insert the following:
Exec=x11vnc -forever -usepw -display :0 -ultrafilexfer
Save it by doing CTRL+X and press Y.
Then we restart:
After that we edit the boot.txt file. Find teh hdmi_mode line and change it. Here you find the diffrent modes under the HDMI_mode topic.
sudo nano /boot/config.txt
# uncomment to force a specific HDMI mode (this will force VGA)
Testing the connection.
We fire up tightvnc, enter the IP address and password.
3. Install LibCEC to control the TV
Now we are going to install LibCEC using the following commands.
I got it working for version 2 using these commands from this project:
wget http://packages.namniart.com/repos/namniart.key -O - | sudo apt-key add -
sudo sh -c 'echo "deb http://packages.namniart.com/repos/pi wheezy main" > /etc/apt/sources.list.d/libcec.list'
sudo apt-get update
sudo apt-get install python-dev build-essential libcec-dev cec-utils
Binaries also available here: libcec compiled raspberry
And to test if it’s working:
Shut down the tv: echo ‘standby 0′ | cec-client -s
Other commands: http://www.cec-o-matic.com/ (backup of the site: CEC commands)
Executing the above commands goes as follows.
pi@raspberrypi ~ $ echo "tx 10 36" | cec-client -s #turn of tv
pi@raspberrypi ~ $ echo "tx 10 04" | cec-client -s #turn on tv
#Switch to HDMI1
pi@raspberrypi ~ $ echo "tx 4f 82 13 01" | cec-client -s
#Switch to HDMI2
pi@raspberrypi ~ $ echo "tx 4f 82 23 01" | cec-client -s