Membuat HTPC dengan Linux Ubuntu

So, what is HTPC?

HTPC is Home Theater PC, from the name it can be guess that HTPC is a Home Theater using PC (Personal Computer). This is how to make it work:

Install XBMCBuntu

Setup LIRC

Keluar dari xbmc, login pilih ubuntu

klik Dash Home (logo ubuntu kiri atas) lalu ketik term, pilih UXterm

jika belum punya lirc, ketik:

sudo apt-get install lirc setserial

cari daftar remote yang support, di http://lirc.sourceforge.net/remotes/ misalnya dipilih remote TV Sharp http://lirc.sourceforge.net/remotes/sharp/G1324SA download dan copy ke share, ketik:

wget http://lirc.sourceforge.net/remotes/sharp/G1324SA

sudo mkdir /usr/share/lirc/remotes/sharp

sudo cp G1324SA /usr/share/lirc/remotes/sharp

perbaiki file hardware.conf dengan ketik:

sudo nano /etc/lirc/hardware.conf

perbaiki dengan:

# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="sharp" #isi dengan sharp atau nama remote apapun terserah
REMOTE_MODULES="lirc_dev lirc_serial" #tambahkan modul dev dan serial
REMOTE_DRIVER="default" #isi dengan default
REMOTE_DEVICE="/dev/lirc0" #defaultnya, cek dengan: ps ax | grep lirc
REMOTE_LIRCD_CONF="sharp/G1324SA" #isikan alamat conf remote yg tlh dicopy
REMOTE_LIRCD_ARGS=""

#tambahkan konfigurasi berikut
#ttyS0 berarti COM1 atau serial pertama, isikan ttyS1 jika COM2 dst
#lihat di ls /dev/ttyS*
#serial
COM_PORT=/dev/ttyS0  
DRIVER_OPTS="irq=4 io=0x3f8" #tergantung alamat dari serial
setserial /dev/ttyS0 uart none 

#Chosen IR Transmitter
TRANSMITTER="None"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""

#Enable lircd
START_LIRCD="true"

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD="false"

#Try to load appropriate kernel modules
LOAD_MODULES="true"

# Default configuration files for your hardware if any
LIRCMD_CONF=""

#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn't have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to "false"
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""

perbaiki file lircd, ketik:

sudo nano /etc/lircd.conf

tambahkan baris:

include “/usr/share/lirc/remotes/sharp/G1324SA” #sesuaikan dengan letak file conf remote

OK, sekarang reboot Lanjutkan dengan cek modul, ketik:

lsmod | grep lirc

ps ax | grep lirc

jika ada tulisan: /usr/sbin/lircd berarti sudah ok lakukan cek dengan irw, ketik:

irw

lalu pencet remote. Jika ada keterangan tombol yang dipencet berarti OK.

Saran:

Instal gedit, editor text grafis,biar edit file conf mudah (perlu konesi internet)  ketik:

sudo apt-get update

sudo apt-get install gedit

Troubleshoot:

1. Jika ada tulisan Cannot open /dev/ttyS0: permision denied berarti seting tty salah

2. Jika pada saat irw tidak keluar apa-apa, file conf remote salah, buat baru: Matikan lirc, ketik:

sudo -s

/etc/init.d/lirc stop

irrrecord –driver=default –device=/dev/lircd0 Remotku –disable-namespace

lalu ikuti petunjuk, hingga diminta set nama tombol pada saat tulisan please enter name bla bla bla. isikan nama tombol, misalnya POWER dan tekan tombol power pada remote. Ikuti dengan tombol lain dan terakhir tekan enter saja. copy hasil konfigurasi ke dir remote

cp Remotku /usr/share/lirc/remotes/

ganti alamat konfigurasi file hardware.conf dan lircd.conf dari /sharp/G1324SA menjadi Remoteku jalankan lirc kembali, ketik

/etc/init.d/lirv start -v

exit

irw

harusnya sudah muncul tombolnya! tekan ctrl+c untuk keluar

Konfigurasi XBMC

edit file lirc, ketik:

sudo nano /usr/share/xbmc/system/Lircmap.xml

Tambahkan:

<remote device=”sharp”>
<power>POWER</power>
<select>TV/VIDEO</select>
<one>1</one>
<two>2</two>
<three>3</three>
<four>4</four>
<five>5</five>
<six>6</six>
<seven>7</seven>
<eight>8</eight>
<nine>9</nine>
<zero>0</zero>
<up>VOL+</up>
<down>VOL-</down>
<left>CH-</left>
<right>CH+</right>
<play>MENU</play>
<mute>MUTE</mute>
</remote>

 

How to make USBasp work with Arduino in Linux

Make sure USBasb plugged into USB Port and check whenever its conected or not by typing lsusb in terminal.

stufi1983@latif-laptop:~$ lsusb
Bus 001 Device 003: ID 0db0:6877 Micro Star International RT2573
Bus 001 Device 004: ID 058f:6387 Alcor Micro Corp. Flash Drive
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 003: ID 16c0:05dc Van Ooijen Technische Informatica shared ID for use with libusb
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

USBasp should detected with VendorID 16c0 and ProductID 05dc. Look at bus address. It says Bus 002 Device 003. See permission on Bus 002 Device 001 by typing ls -l /dev/bus/usb/002/003 in terminal.

stufi1983@latif-laptop:~$ ls -l /dev/bus/usb/002/003
crw-rw-r-- 1 root root 189, 130 Sep  6 10:05 /dev/bus/usb/002/003

Current permission is crw-rw-r– mean user dont have permission to write at the bus. So, change permission to 777 with chmod command.

stufi1983@latif-laptop:~$ sudo chmod 777 /dev/bus/usb/002/003
[sudo] password for stufi1983:

OK, Done. USBasp now already to use with Arduino. Select in Arduino  menu Tool>Progammer>USBasp. Make new file New>Examples>Basic>Blink. Then upload by using menu: File>Upload using Programer