Published on Sake.in.th (https://sake.in.th)

หน้าแรก > หน้าหลัก > LIRC (Linux Infrared Remote Control)

LIRC (Linux Infrared Remote Control) [1]

เขียนโดย sake [2] เมื่อ 2008-02-25 18:02

เขียนไว้ที่ space ซะนาน เลยดึงมาเก็บไว้ที่นี่ซักหน่อย

LIRC (Linux Infrared Remote Control)
บังเอิญต้องทำงานกะ Linux แล้วต้อง set box ให้ใช้ remote
ซึ่งเป็น remote ที่แถมมากับการ์ด Skystar 2 ไม่เคยใช้เลย ลองดู
ถาม google อยู่นาน ได้คำตอบดังนี้

วิธีการติดตั้ง
1. ติดตั้ง kernel source

sudo apt-get install linux-source


2. extract แล้วก็ link ไปที่ /usr/src/linux
cd /usr/src
sudo tar xjvf linux-source-2.6.15.tar.bz2
sudo ln -s linux-source-2.6.15 linux

3. คอมไพล์ LIRC
cd /usr/src
sudo tar xjvf lirc-0.8.0.tar.bz2
cd lirc-0.8.0
./setup.sh --> อันนี้กด save and exit เลย
make
make install

4. ปรับแต่ง device blog
sudo apt-get install setserial
sudo setserial /dev/ttyS0 uart none


5. โหลด module ที่คอมไพล์แล้ว
modprobe lirc_serial
modprobe lirc_dev
sudo update-modules
sudo depmod -ae

6. copy remote config file ไว้ใน /etc
sudo wget http://lirc.sourceforge.net/remotes/technisat/TTS35AI [3]--output-document=/etc/lircd.conf

7. run server daemon
sudo lircd --driver=default --device=/dev/lirc0 --output=/dev/lircd --pidfile=/var/run/lircd.pid --listen


8. ทดสอบ run client โปรแกรมที่ใช้เป็นจาวา เลยใช้ jlirc [4]
unzip jlirc-src-0.06.zip
cd jlirc
vi Makefile --> แก้ jdk-home ซะ
make

9. แก้ไข client config
vi /home/sake/.lircrc
begin
remote = Technisat_TTS35AI.conf
button = Power
prog = irexec
repeat = 0
config = echo "Hello world!"
end

10. ลองรันดู
cd jlirc/build
java java org.lirc.test.Irexec

11. กดปุ่ม Power

echo "Hello world!"
echo "Hello world!"
ใช้ได้ ๆ ค้อยไปโปรแกรมต่อ

 

SiteTags: 
linux [5]
programming [6]
LIRC [7]

Source URL (modified on 2008-06-05 02:00): https://sake.in.th/node/56

Links
[1] https://sake.in.th/story/lirc-linux-infrared-remote-control
[2] https://sake.in.th/users/sake
[3] http://lirc.sourceforge.net/remotes/technisat/TTS35AI
[4] http://jlirc.sourceforge.net/
[5] https://sake.in.th/tags/sitetags/linux
[6] https://sake.in.th/tags/sitetags/programming
[7] https://sake.in.th/category/sitetags/lirc