Saturday, January 25, 2014

XBMC on Raspberry PI

Install XBMC on Raspbian


The easiest way to install the package is to add my archive to your system. To do this, store the following in /etc/apt/sources.list.d/mene.list: (this file does not exist before, you need to create it)
deb http://archive.mene.za.net/raspbian wheezy contrib

and import the archive signing key:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 5243CDED

Then update the package lists:
sudo apt-get update

You can then install it as you would with any other package, for example, with apt-get:
sudo apt-get install xbmc

The user which you're going to run XBMC as needs to be a member of the following groups:
audio video input dialout plugdev tty

The check your current user, use command:
whoami
The command to check if these groups exist:
egrep -i "^groupname" /etc/group
For example find out if audio group exists or not, enter:
egrep -i "^audio" /etc/group
If a group doesn't exist, you need to create it:
addgroup --system input
To check the groups that a user belongs to, use the command:
groups username
or
groups
which check for the current user by default
To add an existing user to an existing group
usermod -a -G group_name user_name

Setup some udev rules to grant it ownership of input devices (otherwise the keyboard won't work in XBMC), by placing the following in /etc/udev/rules.d/99-input.rules:

SUBSYSTEM=="input", GROUP="input", MODE="0660"
KERNEL=="tty[0-9]*", GROUP="tty", MODE="0660"

Running
To run XBMC, run xbmc-standalone from a VT (i.e. not under X). XBMC accesses the display directly and not via Xorg.
If you want XBMC to automatically start when the system boots, edit /etc/default/xbmc and change ENABLEDto 1:
ENABLED=1

You also need to set the user which XBMC should run as (the xbmc user is not automatically created at the moment). Run sudo service xbmc start to test this.

To use smart phone as remote, download Android App “Yaste”. See reference http://www.chiphell.com/thread-662458-1-1.html


My new toy: Raspberry PI

I just bought a Raspberry PI (short as "PI" in the future) and plan to play with it for various projects. 

The hardware I bought from Amazon includes the following items: 

1) a PI Model B, a transparent plastic case and a wireless adapter;
2) a HDMI cable to connect the video output to my TV;
3) a micro USB charger of 5V/2A. 

The input devices are a wireless keyboard/mouse combo. The visual display is my TV. My first project is XBMC, which turns the PI into home multimedia center. 


The following is the log of what I have done to my PI until it works as Lubuntu machine. 




After restart PI, a GUI shows up (similar to Lubuntu)
  • default user and password

    • default user: pi
    • default password: raspberry
  • Now you can login PI remotely using SSH and tools such as putty. If you want a GUI from PI, you need a VNC server.
  • install VNC server
    • type this command to install VNC server:       
      • sudo apt-get install tightvncserver
    • type this command to change VNC password:
      • tightvncserver
    • type this command to start VNC server:
      • vncserver :1 -geometry 1250x950 -depth 24
        • screen resolution 1250x950 is good for my Gateway monitor at Norfolk home
    • From now on, we can access to PI from my laptop!
      • to know the IP address of the PI, type command:
        • ifconfig
  • update system and reboot

    • sudo apt-get update
    • sudo apt-get upgrade
    • sudo rpi-update
    • sudo reboot


  • web browser

    • NetSurf has problem that some adjacent characters overlap each other and I can not select a whole line using mouse
    • Midori has no such problem


In next post I will report my experiments on XBMC.