Showing posts with label xbmc. Show all posts
Showing posts with label xbmc. Show all posts

Wednesday, May 28, 2014

XBMC project - Post 7 - Interfacing IR Remote to Raspberry Pi

Story Board:
Post 1http://blog.karthiksunil.com/2013/07/installing-home-media-centre-dyi-xbmc.html
Post 2http://blog.karthiksunil.com/2013/07/xbmc-project-what-you-need.html
Post 3http://blog.karthiksunil.com/2013/07/xbmc-project-post-3-operating-systems.html
Post 4http://blog.karthiksunil.com/2013/07/xbmc-project-post-4-installing-openelec.html
Post 5http://blog.karthiksunil.com/2013/07/xbmc-project-post-5-updating-to-latest.html
Post 6http://blog.karthiksunil.com/2014/01/xbmc-project-post-6-installing-nas.html

Background:
Raspberry Pi as XBMC media device without a remote control... !!! Something is wrong. Of course we can use Android and iPhone apps to control using Wi-Fi. But after using for a while, it feels very awkward to look for phone, unlock it, search for the app, launch it, press desired button .. may be to pause the movie ?? Uff not a good idea. How about having our TV or any other existing IR remote to control our XBMC. This post explains how

What you need:
If you having completed installation of XBMC on Raspberry Pi, you just need one Hardware for IR remote to work..I bought IR module from ebay - http://www.ebay.in/itm/181394100511

It looks something as below. It works directly with Raspberry Pi, no soldering etc required




Connections:
Very straight forward connections, VCC will get 3.3V pin, that is first pin on left lane on GPIO stack. GND will goto any of ground pin. Data pin goes to any of GPIO pins, I selected pin 18. 6th on right stack. As shown below




Settings to be done on OpenElec
Step 1: Update and Upgrade your OpenElec
This is the way you can keep your system upto date. You can do it from XBMC user interface itself.
check this link http://wiki.openelec.tv/index.php?title=Updating_OpenELEC#Update_Methods

Step 2: Install LIRC

Log into OpenElec from a computer using SSH. You can use PuTTy from windows. Default user name and password - root / openelec

Execute following command to install LIRC

sudo apt-get install lirc

This will install LIRC. 

Step 2: Configure LIRC
For IR receiver to work properly you need to configure few settings..

First off OpenElec needs to be know which remote you are going to use and which buttons means what. This information is obtained from a config file called lircd.conf. This file needs to be placed in /storage/.config/lircd.conf

For this to be achieved there is a Utility called irreccord as part of LIRC which can be used.

first all kill all running LIRC services.

killall lircd

Now start the utility

irrecord /storage/.config/lircd.conf

The instructions are straight forward. However you need to name the keys in a specific format.

You can use following names as it explains:
KEY_PLAY
KEY_PAUSE
KEY_STOP
KEY_FORWARD
KEY_REWIND
KEY_HOME
KEY_LEFT
KEY_RIGHT
KEY_UP
KEY_DOWN
KEY_OK
KEY_MUTE
KEY_MENU
KEY_EXIT
KEY_BACK
KEY_NEXT
KEY_PREVIOUS

Step 3: Start the LIRC services
Following command starts the LIRC services. Make sure you have attached data wire to pin 18 as shown above

modprobe lirc_rpi gpio_in_pin=18 gpio_out_pin=1

You can also start the service automatically every time the OpenElec boots, by creating a file /storage/.config/autostart.sh with below content

#!/bin/sh
modprobe lirc_rpi gpio_in_pin=18 gpio_out_pin=1

Make the above file executable
chmod ugo+x  /storage/.config/autostart.sh


Now you are all set. Reboot the system and try using the remote


Watch below video for full explanation .. Don't worry about initial circuit design he has given, you would not need those additional resistors and capacitors..


Tuesday, January 14, 2014

XBMC project - Post 6 - Installing NAS

Story Board:
Post 1http://blog.karthiksunil.com/2013/07/installing-home-media-centre-dyi-xbmc.html
Post 2http://blog.karthiksunil.com/2013/07/xbmc-project-what-you-need.html
Post 3http://blog.karthiksunil.com/2013/07/xbmc-project-post-3-operating-systems.html
Post 4http://blog.karthiksunil.com/2013/07/xbmc-project-post-4-installing-openelec.html
Post 5http://blog.karthiksunil.com/2013/07/xbmc-project-post-5-updating-to-latest.html

Make or Buy decision :)

The latest on my XBMC project is that, I added NAS to my landscape. After a lof research, I decided to buy Iomega IX2-200 as my NAS. Initially I thought of building my own NAS using an old PC and installing FreeNAS on it. May be I did not have enough enthusiasm or din't get right hardware, I dropped the idea and went for a ready made NAS. I bought used NAS (IX2) from eBay. Actually it was not used, the box seal was just open, everything was intact. Seller could not sell as new as seal was opened. Seller was from Bangalore, I went to his shop in SP road and checked the box, tested and bought it for RS 10,500. More over he gave the bill as of current date so that I get company warranty for 2 years from purchase date. MRP of new box was RS 19,000. It was a good deal for me 

Upgrading firmware
This is the first thing I did. The box import date was Apr 2013. As it was pretty old, I wanted to upgrade to latest firmware. Downloaded from Lenovo, Iomega site and uploaded to NAS and upgraded. It upgraded without any glitch. 

Using NAS
It was pretty straight forward. Almost plug n play :).. Created users/ admin users etc and started using web interface. All was well :)

My Initial feeling
Slowwwwwwwwwww file transfer. I get 1-2 mb/s using SMB file transfer. FTP was better 10-15 mb/s.
Otherwise it is just fine.

Backed up my old 1 TB HDD, my phone, my laptop. Everything took almost 2 days.

Integrating with XBMC
Added my NAS as source in XBMC and it could stream audio, video and pictures without any issues.. No issues with streaming media files



Monday, July 29, 2013

XBMC project - Post 5 - updating to latest version

Story Board:
Post 1http://blog.karthiksunil.com/2013/07/installing-home-media-centre-dyi-xbmc.html
Post 2http://blog.karthiksunil.com/2013/07/xbmc-project-what-you-need.html
Post 3: http://blog.karthiksunil.com/2013/07/xbmc-project-post-3-operating-systems.html
Post 4: http://blog.karthiksunil.com/2013/07/xbmc-project-post-4-installing-openelec.html

This is what I did to install 3.1.2. You can follow these steps for even downgrading.

1. Follow steps in http://squirrelhosting.co.uk/hosting-blog/hosting-blog-info.php?id=9 
Get 3.0.6 img file and install
http://resources.pichimney.com/OpenELEC/official_images/?C=M;O=D

Later get official 3.1.2 (or any other latest version) kernel, system md5 files from http://openelec.tv/get-openelec/download/viewcategory/10-raspberry-pi-builds

Then, follow link below to update to highest version
http://wiki.openelec.tv/index.php?title=Updating_OpenELEC#Manually_Updating_OpenELEC

Thursday, July 18, 2013

XBMC project - Post 4 - Installing OpenELEC

Story Board:

What you need
1.  Pi
2. SD card
3. Computer
4. USB drive, optional but recommended for better performance
Instructions
If you are using Linux based system use following link for instruction
============================
If you are using windows machine to install  follow the instructions in link below
(this method is tested and works fine)
To simplify, I skipped formatting and partition step. I used normal windows format. Just make sure that you select FAT32.I used suggested win32 disk imager to write image file to SD card


Once completed you can boot raspberry pi with SD card. I have tried at this stage. All feature works without any problem with functionality, however screen navigation and add on experience are not that great. A lot of lag. Follow the instruction in below link to move "/storage" partition to USB drive, which boosts the performance drastically.

Follow the instruction mentioned in below link to get the /storage into USB drive. Only deviation I did was to create a bootable GPARTED CD drive and boot from it to move the partition.
http://forum.xbmc.org/showthread.php?tid=150297&page=4 

Assuming that you have LAN router, cable, HDMI TV, a USB Keyboard, another computer which is on the same LAN.

1. Install OpenELEC on SD card as explained above. 
2. Format USB Drive - FAT32
3. Insert SD Card, USB Drive both into Raspberry pi
4. Connect USB Keyboard
5. Connect HDMI Cable to TV
6. Connect power adapter to pi and turn it on

Above steps were derived from link below


Next Post:
Upgrading to 3.1.2
Installing wireless adapter

Wednesday, July 17, 2013

XBMC Project - Post 3 - Operating Systems for Raspberry pi

Story Board:

  1. Post 1: http://blog.karthiksunil.com/2013/07/installing-home-media-centre-dyi-xbmc.html
  2. Post 2: http://blog.karthiksunil.com/2013/07/xbmc-project-what-you-need.html


Before you go ahead with the installation let's see how to connect things together

Connecting Pi to TV and other gadgets is as simple as plugging in power adapter to your laptop.


  • Connect your HDMI cable to Pi and TV
  • Insert SD Card
  • Insert your mobile power adapter to Pi (micro USB) - Make sure that current rating is more than 700mA
  • If you have wireless adapter, plug it in one of the USB ports
  • Plug key board in another USB port for initial setup

And that's it..

Now you have got Pi, you have got power of a computing engine on your palm. Many people use Pi in very different purpose. Most popular flavor is to use it as an XBMC server. This series of posts is to achieve the same. We have many options of OSs to be installed on Pi. Refere http://elinux.org/RPi_Distributions

As our goal is to implement XBMC on Pi, let's concentrate on XBMC distributions. Following are the options . (http://wiki.xbmc.org/?title=Raspberry_Pi/FAQ#Installing_XBMC_on_the_Raspberry_Pi)

  1. Raspbian
  2. OpenELEC
  3. Xbian
I have instaled OpenELEC and recommed strongly. However, OpenELEC works very smoothly when installed on USB Drive instead of SD card. I will write a separate post on it. Advantage of OpenELEC is that, it has been build from the scratch for the purpose of XBMC and only XBMC. Its light, fast and accurate. Visit openelec.tv 

My next post will be on instaling OpenELEC on SD card and then move to USB drive for snappiness. 

Tuesday, July 16, 2013

XBMC project - Post 2 - What you need

Story Board:

  1. Post 1: http://blog.karthiksunil.com/2013/07/installing-home-media-centre-dyi-xbmc.html


In this post I will try to make a list of things you need to establish full working solution
Goal: To achieve full working xbmc which can be used by even novice, who it's not interested experimenting all these things :), also to stream all your own videos, pictures,  movies and songs from external hard drive wirelessly
1. Raspberry pi circuit: So what is this
Raspberry pi is not edible :). It's a small cute circuit board which gives you the power of full working computer. Following are the Ports/external interfaces available
a. Hdmi output - out goes road monitor, in our case out will be TV
b. 2 USB Ports, almost anything or takes
c. SD card slot, has the bootloader and OS
d. Power slot, you micro USB mobile phone charger is good enough
c. Audio and video out, in case you don't want to use hdmi (in our case these are obsolete)
Cost: I got it for ₹ 2900 plus taxes. I went to JP Nagar in person to buy it, you can visit crazypi.com  or contact Ranganath. Just note that prices are already hiked due to falling rupee value against dollar
2. SD card: you can use an existing one if you already have. Better to user high class one
3. Wireless mini keyboard (optional): This is optional, but very useful and cute enough to not to opt out. Cost ₹1500
4. Wireless adapter: I got d link n300 one for ₹900 again from crazypi.com. Note all wireless adapters are compatible with pi, even tough pi works without this, I strongly recommend to have this, assuming that you have wireless router and have access to internet through it
5. Wireless N router with USB:(Optional)
You need this if you want to stream your own contents from your hard disk wirelessly. This could be an alternative to an expensive NAS. Of course you have certain  draw backs, will  explain in some later posts.
I bought dlink N300 2750u . One of the coolest routers, costed ₹2200 from flipkart. You can have others but make sure that it has USB storage sharing, supports UPnP.
6. Hdmi cable: This is mandatory for media center so better buy it. You get it for around ₹800.
7. Case for pi: There are different case options, I suggest to buy a decent looking one. I bought black case from crazypi.com, it costed aground ₹400.
Total cost of all these gadgets
Pi - ₹ 3100
Wireless adapter - ₹900
hdmi cable - ₹800
SD card - ₹350
Wireless router - ₹2200
Wireless mini keyboard - ₹1500
Case - ₹ 400
Total (including optional devices) ₹9350

My next post will be on choosing OS for your pi

XBMC project - Post 1 - See the end

Today, one of my dreams have come true. I have installed my home media center, with as affordable price as it can be. I am going to write a series of posts regarding it.

Summary:
XBMC running on my raspberry pi. OpenElec version of Xbmc
Established wifi connection to my pi using d-link wifi adapter n300

I have also established network drive using my new wifi router with USB. All my media can be streamed from my external 1 TB drive.

Create amazing library of my movies using useful scrappers

Using filmi by nature add on, I can stream HD videos online

Using Yatse Android app I can control xbmc
Using Yatse+ plugin I can stream my media directly from phones and tablets

I can start slide show of my old picture archives just by a click

Play my music from anywhere

Play YouTube videos on big screen

You know, its really good feeling. DIY XBMC, is really cool