Fedora Linux Support Community & Resources Center
  #1  
Old 17th April 2012, 04:32 PM
coozoo Offline
Registered User
 
Join Date: Mar 2010
Location: Ukraine, Vinnitsya
Posts: 25
linuxopera
Lightbulb Media Center Remote (MCE) (from china shop) as lirc device in Fedora 16

I've bought cheap remote USB device from one china shop (I wouldn't call which one because it's advertisement) something about 8$ or cheaper I don't remember.
It's recognized in my system as USB keyboard, and all key presses on the remote are translated to system as some key presses on keyboard (sorry not all key presses some was ignored).
I've wanted to setup this device as lirc ruled and I've did that because it's more flexible ways to use it (comparely to usual key presses). I've used this article http://ubuntuforums.org/showthread.php?t=805876 with some modified steps for my Fedora 16 (upgraded from old 12->13->14->15 ) (BTW (my remote looks like the same to remote from picture by link). So due that some steps are different I've post it here (hope not wrong place).

So first that we need it's a identified our device, plug-in it into USB and execute "lsusb".
Example of my result:
Code:
[happiness@happyfedora ~]$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 064e:a127 Suyin Corp. 
Bus 006 Device 099: ID 04b4:0100 Cypress Semiconductor Corp. Cino FuzzyScan F760-B
You can see ID and name of my IR remote device above it's:
ID 04b4:0100
Cypress Semiconductor Corp. Cino FuzzyScan F760-B

Let's find our input device:
Unplug your device (if it's inserted) and execute "ls -l /dev/input/*" for that.
Code:
[happiness@happyfedora ~]$ ls -l /dev/input/*
crw-r----- 1 root root 13, 64 кві 15 19:58 /dev/input/event0
crw-r----- 1 root root 13, 65 кві 15 19:58 /dev/input/event1
crw-r----- 1 root root 13, 66 кві 15 19:58 /dev/input/event2
crw-r----- 1 root root 13, 67 кві 15 19:58 /dev/input/event3
crw-r----- 1 root root 13, 68 кві 15 19:58 /dev/input/event4
crw-r----- 1 root root 13, 69 кві 15 19:58 /dev/input/event5
crw-r----- 1 root root 13, 70 кві 15 19:58 /dev/input/event6
crw-r----- 1 root root 13, 71 кві 15 19:58 /dev/input/event7
crw-r----- 1 root root 13, 72 кві 15 19:58 /dev/input/event8
crw-r----- 1 root root 13, 73 кві 15 19:58 /dev/input/event9
crw-r----- 1 root root 13, 63 кві 15 19:58 /dev/input/mice
crw-r----- 1 root root 13, 32 кві 15 19:58 /dev/input/mouse0
crw-r----- 1 root root 13, 33 кві 15 19:58 /dev/input/mouse1
Now plug device into USB and execute again the same command:
Example:
Code:
[happiness@happyfedora ~]$ ls -l /dev/input/*
crw-r----- 1 root root 13, 64 кві 15 19:58 /dev/input/event0
crw-r----- 1 root root 13, 65 кві 15 19:58 /dev/input/event1
crw-r----- 1 root root 13, 74 кві 16 16:11 /dev/input/event10
crw-r----- 1 root root 13, 66 кві 15 19:58 /dev/input/event2
crw-r----- 1 root root 13, 67 кві 15 19:58 /dev/input/event3
crw-r----- 1 root root 13, 68 кві 15 19:58 /dev/input/event4
crw-r----- 1 root root 13, 69 кві 15 19:58 /dev/input/event5
crw-r----- 1 root root 13, 70 кві 15 19:58 /dev/input/event6
crw-r----- 1 root root 13, 71 кві 15 19:58 /dev/input/event7
crw-r----- 1 root root 13, 72 кві 15 19:58 /dev/input/event8
crw-r----- 1 root root 13, 73 кві 15 19:58 /dev/input/event9
crw-r----- 1 root root 13, 63 кві 15 19:58 /dev/input/mice
crw-r----- 1 root root 13, 32 кві 15 19:58 /dev/input/mouse0
crw-r----- 1 root root 13, 33 кві 15 19:58 /dev/input/mouse1
crw-r----- 1 root root 13, 34 кві 16 16:11 /dev/input/mouse2
Is pretty easy to see new event10 (gotcha ).

So new created event /dev/input/event10
Then you want to have a symlink created correctly, for whenever you plug or unplug that receiver.
Now create a udev rule for the receiver.
Execute "udevadm info -a -p $(udevadm info -q path -n /dev/input/eventX)"
Very long output (sorry I didn't find something like a cut tags).
Example:
Code:
[happiness@happyfedora ~]$ udevadm info -a -p $(udevadm info -q path -n /dev/input/event10)

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0/input/input167/event10':
    KERNEL=="event10"
    SUBSYSTEM=="input"
    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0/input/input167':
    KERNELS=="input167"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{name}=="Cyp Se WitheHome"
    ATTRS{phys}=="usb-0000:00:1d.0-1/input0"
    ATTRS{uniq}==""
    ATTRS{properties}=="0"

 ...blablabla...
Take the one unique attribute of device (looks like the name is the most unique and not changable from time to time for mine device )
From above result:
Code:
ATTRS{name}=="Cyp Se WitheHome"
Now create or update /etc/udev/rules.d/10-local.rules to add an entry for this remote
Code:
KERNEL=="event*",ATTRS{name}=="Cyp Se WitheHome",SYMLINK="input/Cyp_Se_WitheHome"
Unplug and plug your device again.
And execute "ls -l /dev/input/" now it should looks like that:
Code:
[happiness@happyfedora ~]$ ls -l /dev/input/
загалом 0
drwxr-xr-x 2 root root    100 кві 16 20:13 by-id
drwxr-xr-x 2 root root    180 кві 16 20:13 by-path
lrwxrwxrwx 1 root root      7 кві 16 20:13 Cyp_Se_WitheHome -> event10
crw-r----- 1 root root 13, 64 кві 15 19:58 event0
crw-r----- 1 root root 13, 65 кві 15 19:58 event1
crw-r----- 1 root root 13, 74 кві 16 20:13 event10
crw-r----- 1 root root 13, 66 кві 15 19:58 event2
crw-r----- 1 root root 13, 67 кві 15 19:58 event3
crw-r----- 1 root root 13, 68 кві 15 19:58 event4
crw-r----- 1 root root 13, 69 кві 15 19:58 event5
crw-r----- 1 root root 13, 70 кві 15 19:58 event6
crw-r----- 1 root root 13, 71 кві 15 19:58 event7
crw-r----- 1 root root 13, 72 кві 15 19:58 event8
crw-r----- 1 root root 13, 73 кві 15 19:58 event9
crw-r----- 1 root root 13, 63 кві 15 19:58 mice
crw-r----- 1 root root 13, 32 кві 15 19:58 mouse0
crw-r----- 1 root root 13, 33 кві 15 19:58 mouse1
crw-r----- 1 root root 13, 34 кві 16 20:13 mouse2
Sure now we need to configure winlirc service:
Open /etc/sysconfig/lirc for that.
in case if you have any nodes related to gnome infra remote remove them out.
And edit two nodes (don't forget to make back up):
LIRC_DRIVER="dev/input"
LIRC_DEVICE="/dev/input/Cyp_Se_WitheHome"

Exemple of my file:
Code:
# Note: in addition to these parameters, you need to have working    -*- sh -*-
# configuration file for lircd (and lircmd if enabled).

# Options to lircd(8).  Typically, this will be empty, as which driver to use
# should be specified using the LIRC_DRIVER variable below.
LIRCD_OPTIONS=""

# The infrared receiver (and/or transmitter) driver to be used by lircd(8),
# similar to passing "-H driver" to lircd(8).
# Run "/usr/sbin/lircd -H help" to get a listing of supported drivers.
LIRC_DRIVER="dev/input"

# Which lirc device will be used by lircd(8).
# This is the same as passing "-d device" to lircd.
# An empty value will use the default /dev/lirc0 device.
LIRC_DEVICE="/dev/input/Cyp_Se_WitheHome"

# If "yes", the init script will try to start lircmd(8) too.
ENABLE_LIRCMD="no"

# Options to lircmd(8).
LIRCMD_OPTIONS=""
Now if your device exactly the same as mine then open "/etc/lirc/lircd.conf" (don't forget to make back up) and replace all internal data with this below (source again the same http://ubuntuforums.org/showthread.php?t=805876):
Code:
begin remote
        name Cyp_Se_WitheHome
        bits 32
        begin codes
		POWER		0x40004 0x80010074
		RADIO		0x40004 0x8001001e
		TV		0x40004 0x80010014
		DVD		0x40004 0x80010031
		MUSIC		0x40004 0x80010032
		PHOTO		0x40004 0x80010017
		VIDEO		0x40004 0x80010012
		DVD_MENU	0x40004 0x8001002f
		MUTE		0x40004 0x80010042
		BACK		0x40004 0x8001000e
		GUIDE		0x40004 0x8001003b
		VOLUME_UP	0x40004 0x80010073
		VOLUME_DOWN	0x40004 0x80010072
		CHANNEL_UP	0x40004 0x80010068
		CHANNEL_DOWN	0x40004 0x8001006d
		ARROW_UP	0x40004 0x80010067
		ARROW_DOWN	0x40004 0x8001006c
		ARROW_LEFT	0x40004 0x80010069
		ARROW_RIGHT	0x40004 0x8001006a
		ENTER		0x40004 0x8001001c
		RECORD		0x40004 0x8001001d 0x40004 0x80010013
		REPEAT		0x40004 0x8001002a 0x40004 0x80010013
		PLAY		0x40004 0x8001002a 0x40004 0x80010019
		PAUSE		0x40004 0x8001001d 0x40004 0x80010019
		STOP		0x40004 0x8001001f
		REWIND		0x40004 0x8001002a 0x40004 0x80010020
		FORWARD		0x40004 0x8001002a 0x40004 0x80010021
		PREV_TRACK	0x40004 0x8001001d 0x40004 0x80010030
		NEXT_TRACK	0x40004 0x8001001d 0x40004 0x80010021
		NUMPAD_1	0x40004 0x80010002
		NUMPAD_2	0x40004 0x80010003
		NUMPAD_3	0x40004 0x80010004
		NUMPAD_4	0x40004 0x80010005
		NUMPAD_5	0x40004 0x80010006
		NUMPAD_6	0x40004 0x80010007
		NUMPAD_7	0x40004 0x80010008
		NUMPAD_8	0x40004 0x80010009
		NUMPAD_9	0x40004 0x8001000a
		NUMPAD_0	0x40004 0x8001000b
        end codes
end remote
Then restart lirc service:
Code:
systemctl restart lirc.service
Now open console, launch irw and push buttons of your remote.
For example my output looks like this:
Code:
[root@happyfedora sysconfig]# irw
0000000000040004 00 GUIDE Cyp_Se_WitheHome
....blabla...
Finally it should works

If it doesn't work try to reboot (or check previous steps).

Last edited by coozoo; 17th April 2012 at 05:57 PM. Reason: fix some mistypes
Reply With Quote
  #2  
Old 17th April 2012, 04:34 PM
coozoo Offline
Registered User
 
Join Date: Mar 2010
Location: Ukraine, Vinnitsya
Posts: 25
linuxopera
Re: Media Center Remote (MCE) (from china shop) as lirc device in Fedora 16

And due to post limitation it's continue

And now if your device is different and lircd file IR codes doesn't work so you need to learn your device.

What that you need it's compile lirc with debug option due that original without it.

How I did that (sure you could make it in your own way and you can share it):
1. First I want to have original lirc in functional.
So firstly I've removed it and all rpm related to it by running "yum remove lirc*" I've did it to make sure that new compiled lirc wouldn't overwrite any original file (Don't forget to save console output of removed packages) If you want you can try to skip this step... I'm not sure
2. Download lirc.
And unpack it "tar -jxvf lirc-0.9.0.tar.bz2"
Change to lirc directory cd lirc-0.9.0
3. Now configure lirc by running "./configure".
You should see blue screen with available options (I've five items).
Perform the next steps to configure lirc:
Code:
    Select 1st item (Driver configuration)
        Select hardware group 0 item (Other)
            Select hardware 6th item (Linux input layer). Hit Enter button
    You will came back to first page. And at the end of first option you will see selected hardware (driver:devinput)
    Select 2nd option (Software configuration)
        1st option marked by default (Compile tools for X-Windows)
        Mark 2nd option using Space button (Compile with DEBUG code)
        And if you want 6th (Enable dynamic codes)
    Now again press Enter. And you will see first screen.
    Select 3rd option (Save configuration & run configure) and hit enter
4. After configuration make sure that you have all dependencies (I have no problem with it but I'm sure that you should have installed kernel source and maybe some other packages)
5. Now just type "make" and wait till compilation will be finished.
And after that perform installation "sudo make install"
6. Now you can install back lirc "yum install lirc*" and sure you can add all packages from your saved file with list of removed rpm during step 1.

So now you will have lirc with debug option.
Every time when you want to use it you should stop original one by running:
"systemctl stop lirc.service"

After that you can start debug version of lirc, run as follows:
Code:
/usr/local/sbin/lircd -n -D --driver=dev/input --device=/dev/input/Cyp_Se_WitheHome --output=/dev/lircd --pidfile /var/run/lircd.pid
You should see a long output something like that:
Code:
[happiness@happyfedora ~]$ sudo /usr/local/sbin/lircd -n -D --driver=dev/input --device=/dev/input/Cyp_Se_WitheHome --output=/dev/lircd --pidfile /var/run/lircd.pid
lircd: WARNING: you should specify a valid gap value
...a lot of...
lircd: first signal is a space!
...end of a lot of...
lircd: nothing to send
lircd: lengths: 0 0 0 0
lircd: config file read
lircd: lircd(devinput) ready, using /dev/lircd
After that open another console instance and run "irw /dev/lircd".
In first console you should see additional output:
Code:
lircd: registering local client
lircd: accepted new client on /dev/lircd
lircd: initializing '/dev/input/Cyp_Se_WitheHome'
Keep your IR remote and press some button, for example output of Power button pressing:
Code:
lircd: devinput_rec
lircd: time 1335947152.988059  type 4  code 4  value 65665
lircd: code 4000400010081
lircd: trying "Cyp_Se_WitheHome" remote
lircd: devinput_decode
lircd: pre: 0
lircd: code: 40004
lircd: post: 0
lircd: code:                   0000000000040004

lircd: WARNING: you are using an obsolete devinput config file: No such file or directory
lircd: WARNING: get the new version at http://lirc.sourceforge.net/remotes/devinput/lircd.conf.devinput: No such file or directory
lircd: repeat_flagp:           0
lircd: is_const(remote):       0
lircd: remote->gap range:      0 0
lircd: remote->remaining_gap:  0 0
lircd: signal length:          0
lircd: gap:                    0
lircd: extim. remaining_gap:   0 0
lircd: found: NUMPAD_0
lircd: 89318c8 0 0 0 0 1 1 0 0 1
lircd: devinput_rec
lircd: time 1335947152.988063  type 1  code 116  value 1
lircd: code 1007400000001
lircd: trying "Cyp_Se_WitheHome" remote
lircd: devinput_decode
lircd: pre: 0
lircd: code: 80010074
lircd: post: 0
lircd: code:                   0000000080010074

lircd: repeat_flagp:           0
lircd: is_const(remote):       0
lircd: remote->gap range:      0 0
lircd: remote->remaining_gap:  0 0
lircd: signal length:          0
lircd: gap:                    1839
lircd: extim. remaining_gap:   0 0
lircd: found: POWER
lircd: 89318c8 89318c8 89318c8 1 0 1 0 0 1 1
lircd: release_gap: 110000
lircd: writing to client 0
lircd: devinput_rec
lircd: time 1335947152.988065  type 1  code 116  value 0
lircd: code 1007400000000
lircd: trying "Cyp_Se_WitheHome" remote
lircd: devinput_decode
lircd: pre: 0
lircd: code: 10074
lircd: post: 0
lircd: code:                   0000000000010074

lircd: repeat_flagp:           0
lircd: is_const(remote):       0
lircd: remote->gap range:      0 0
lircd: remote->remaining_gap:  0 0
lircd: signal length:          0
lircd: gap:                    2534
lircd: extim. remaining_gap:   0 0
lircd: found: unknown
lircd: 89318c8 89318c8 89318c8 1 0 0 0 0 1 1
lircd: release_gap: 110000
lircd: writing to client 0
lircd: devinput_rec
lircd: time 1335947152.988078  type 0  code 0  value 0
lircd: code 00000000
lircd: forwarding: 0000 0000
Find first string with lirc code, from previous output it's:
Code:
lircd: code:                   0000000000040004
And second:
Code:
lircd: code:                   0000000000010074
Yes it is values for our lircd.conf file. Do that for each button and you will get your IR remote to work.

And finally when you prepare your own file, you can stop lirc in debug and run Lirc service:
"systemctl start lirc.service"

BTW In some reason lirc ignore "Media center" button from my IR remote. Maybe you will have such buttons too.

(dancing with myself )

Last edited by coozoo; 2nd May 2012 at 09:48 AM.
Reply With Quote
Reply

Tags
center, china, device, fedora, lirc, mce, media, remote, shop

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora 15 64 xmbc lirc remote mooreted Hardware & Laptops 2 27th July 2011 04:33 AM
LIRC Media Center Remote Troubles gregk Hardware & Laptops 0 27th April 2009 06:58 PM
How to Install My Media center Remote control Dr.AMA Hardware & Laptops 8 10th June 2008 01:11 AM
Fedora as Media Center arun_maurya Using Fedora 4 12th May 2008 05:38 AM
Fedora 7 as Media Center (MCE) wmdejen Using Fedora 17 22nd August 2007 02:10 PM


Current GMT-time: 12:29 (Thursday, 23-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat