Mar 31, 2013

HTPC Comes True With Raspberry Pi

Today we're going to install a light-weighted Linux distribution - OpenELEC, to make a home theater PC (HTPC) with the Raspberry Pi.  OpenELEC is designed to be simple and fast by running XBMC in standalone mode to turn your PC into a media center.  Current latest version of OpenELEC is 3.0.0 as of this writing and the OS image could be downloaded HERE.  The installation takes less than 10 minutes with very small disk space footprints (less than 250 MB).  SSH server was enabled by default and you could login as root (password: openelec), but there's no passwd command available to change the password in a traditional way.  Poor security design!

Booting OpenELEC


openelec:~ # df -h
Filesystem                Size      Used Available Use% Mounted on
none                    185.1M     87.4M     97.6M  47% /dev
/dev/mmcblk0p1          124.7M     96.1M     28.7M  77% /flash
/dev/mmcblk0p2            1.7G     61.2M      1.6G   4% /storage
/dev/loop0               87.4M     87.4M         0 100% /
none                    186.5M         0    186.5M   0% /dev/shm
/dev/sda1               916.9G    727.4G    142.9G  84% /var/media/cove


openelec:~ # passwd
-sh: passwd: command not found


Although the CPU in Raspberry Pi is an ARM 700 MHz processor (could be over-clocked up to 1 GHz), but the GPU (Broadcom VideoCore IV) is fast enough for 1080p video playback, which is the key to an HTPC.  Since controlling an HTPC with a keyboard and mouse is way too geeky, we'll dump them and use an IR remote instead (shown below).


With the Raspberry enclosed in the black case, the composition looks less ugly tho.
Port usage in the USB hub (from left to right):
  • Power supply for the Pi
  • IR remote receiver
  • USB external hard disk


While playing 1080p video, the CPU temperature is like 62 °C (144 °F) , guess it could go up to 70 °C (158 °F) in summer, and the power consumption is less than 8W with peripherals attached shown above.

Hardware info of the Raspberry Pi

The last thing to do is enabling the AirPlay feature in XBMC.  Go to System -> Settings -> Services -> AirPlay to enable it, then your iOS devices could either play the music or display the photos to the XBMC screen (mirroring not feasible due to hardware limitation).

AirPlay feature in XBMC



Note that the iOS device and the XBMC must be within the same local network (or subnet to be specific) for the service to be broadcasted correctly. (no configuration is needed on iOS devices.) Click the AirPlay icon while browsing the photo to airplay it to the remote screen.

AirPlay icon on iOS

Photo on iPad airplayed to the remote XBMC screen

[Updated on Apr. 4, 2013]

Additional notes regarding the remote control, since the Raspberry Pi is CEC-enabled, which is a feature in HDMI specification that allows the user to operate multiple devices with one remote control, if your TV set is also CEC-enabled, you can just use your TV remote to control XMBC.  Pretty cool, huh?

Luckily the TV (Sharp LC-52GX30T) I used is CEC-enabled. To check if your TV supports HDMI-CEC or not, login to the OpenELEC and type "cec-client":

openelec:~ # cec-client
No device type given. Using 'recording device'
CEC Parser created - libCEC version 2.1.1
no serial port given. trying autodetect:
 path:     Raspberry Pi
 com port: RPI

opening a connection to the CEC adapter...
DEBUG:   [             108]     unregistering all CEC clients
DEBUG:   [             111]     Broadcast (F): osd name set to 'Broadcast'
DEBUG:   [             117]     InitHostCEC - vchiq_initialise succeeded
DEBUG:   [             118]     InitHostCEC - vchi_initialise succeeded
DEBUG:   [             120]     InitHostCEC - vchi_connect succeeded
DEBUG:   [             124]     logical address changed to Broadcast (f)
DEBUG:   [             125]     RegisterLogicalAddress - registering address e
DEBUG:   [             306]     logical address changed to Recorder 1 (1)
DEBUG:   [             307]     logical address changed to Free use (e)
DEBUG:   [             307]     Open - vc_cec initialised
NOTICE:  [             308]     connection opened
DEBUG:   [             314]     << Broadcast (F) -> TV (0): POLL
DEBUG:   [             314]     initiator 'Broadcast' is not supported by the CEC adapter. using 'Free use' instead
TRAFFIC: [             314]     << e0
DEBUG:   [             316]     processor thread started
DEBUG:   [             346]     >> POLL sent
DEBUG:   [             346]     TV (0): device status changed into 'present'
DEBUG:   [             346]     << requesting vendor ID of 'TV' (0)
TRAFFIC: [             346]     << e0:8c
TRAFFIC: [             538]     >> 0f:87:08:00:1f
DEBUG:   [             538]     >> TV (0) -> Broadcast (F): device vendor id (87)
DEBUG:   [             538]     TV (0): vendor = Sharp (08001f)
DEBUG:   [             539]     expected response received (87: device vendor id)

NOTICE:  [             539]     registering new CEC client - v2.1.1
DEBUG:   [             539]     detecting logical address for type 'recording device'


Or take a look at the lower-right corner after XBMC boots, a pop-up message will be shown (see image below) if a CEC-enabled device is connected.

Message shows this TV is CEC-enabled

Here's a quick test results on CEC features against my TV:
  • Use the TV remote to control XBMC - PASS
  • Shutdown XBMC and the TV will be turned off automatically - PASS
  • While TV is on, turn on the Pi and the TV video source will be switched to the XBMC automatically - PASS
  • While TV is off, turn on the Pi and the TV will be turned on automatically - FAIL
Details on the CEC features tested could be configured in the System / Settings / Input devices / Peripherals / CEC Adapter.

Mar 30, 2013

Hungry? Grab a Byte of Raspberry Pi

Yeah! New gadgets arrived.  A quick intro if you have no idea what it is.  Raspberry Pi is a credit-card-sized computer developed in the UK for educational purpose.  If you need a power-up-and-ready-to-go computer this is definitely NOT what you want.  This one was ordered directly from the RS Components website, with a black case and plus the shipping fee, the total cost is USD $49.49 (TWD $1480).  Still pretty affordable.

Shipped from the UK


Raspberry Pi and the black case

The Raspberry Pi (model B)

Since the Raspberry Pi was designed for educational purpose, we need to get the essential accessories and put them altogether to make it work.  Required items are:

  • 5V micro USB power supply
    • The standard USB to micro USB cable (the black cable shown below) is an accessory of an old Nokia 5310 mobile phone
    • AC to USB converter is an accessory of iPhones (the white one shown below)
  • An SD card (2GB or more recommended)
  • A USB keyboard and mouse (not needed if remote login is enabled after configuration)
  • TV or monitor with HDMI input (not shown below)

Required accessories

Optional but highly recommended items:
  • A USB hub, at least 4 ports, with external power source
  • An external USB hard drive
  • Internet connectivity
    • Will be used by software update and time sync via NTP protocol as there is no real-time clock integrated in the Raspberry Pi to keep the cost down.

Optional but highly recommended stuff
Next, we need an OS for the Pi to boot.  We'll be using Raspbian "wheezy" as it's the recommended Linux distro from the official site.  You can download it HERE, and follow the instructions on that page to dump the OS image to the SD card to make it bootable.  Once everything is ready, plug in the micro USB power supply and have fun.

  • By default, login as pi, with password raspberry
  • Type "startx" for the X Window, the graphical UI

Dinner is served ;)

Raspbian "wheezy" up and running

How to Update Flash Player Add-on on Linux Mint

It's been like a week or so the Firefox browser on Linux Mint (13, Maya) keeps deactivating the Adobe Flash Player, which is pretty annoying.  Here's a quick fix for this - remove the old package shipped by Linux Mint and get the one from Ubuntu Update Repo.

Type the following commands:

$ sudo apt-get remove mint-flashplugin-11
$ sudo apt-get install flashplugin-installer


Re-start your Firefox and you're good to go.

Outdated plug-ins got deactivated by Firefox

Before the update (original version)


After the update

Mar 25, 2013

ZyXEL P-6101C as Home Router and Wi-Fi Access Point

If you're using HiNet as your ISP in Taiwan, the ADSL modem they lent you could do much more than you think with a little more configuration.  Today we're going to turn our ZyXEL P-6101C ADSL modem into a home router, and a Wi-Fi AP.  Here's a list of services that we need to configure in this box:
  • DHCP server
  • PPPoE auto dial-up
  • Wireless service
By default, the IP address of the box is 192.168.1.1, and the login credential is fixed to 2 or 3 simple combinations based on the area you live.  It's publicly discussed so we're not going to cover this :b.  Please google it by yourself.

DHCP server 


Go to Setup -> LAN, and make a reasonable IP address pool.



On the same page, DNS server could also be configured.


Wireless service


Go to Wireless -> Basic to configure the SSID of your access point.


Setup auth type, encryption, and the passphrase.


PPPoE dial-up


Go to Quick Setup page, fill in your PPPoE username and password, and don't forget to enable the WLAN entry we previously configured.



If everything goes well, you'll see the new SSID in the AP list.  Happy surfing!