please choosego to mobile | Continue to access the PC version
View: 12570|Reply: 2

lirc

[Copy link]

11

threads

59

posts

326

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
326
Published in 2015-2-13 06:01:42 | Show all floors |Read mode
Edited by FransM at 2015-2-16 01:33

Hi,

I decided to see if I could get lirc running and add remote control support to my Pi.
I found I had to use the kernel module sunxi-cir (this is on fedora 21, 3.17.8 kernel),
modprobe sunxi-cir
did the trick.

I installed lirc and lirc-remotes
On fedora: yum sudo install lirc lirc-remotes
On ubuntu sudo apt-get install lirc (ubuntu does not seem to have a package lirc-remotes)

Next run the program
mode2
And press keys on your remote control.
You should see some data.

Next try to create some remote keymappings:
start the program:
irrecord -H devinput -d /dev/input/event1 myconf
and follow the instructions.
Iniitally e.g. add commands for KEY_1, KEY_2 and KEY_3
use
irrecord -l
to get a list of all possible keys.
If irrecord does not seem to do anything please try other event* files in /dev/input.
E.g. if you also connected a USB mouse and keyboard it may well be that you have to use /dev/input/event3

You may also try to find your remote in the lirc database:
http://lirc-remotes.sourceforge.net/remotes-table.html
but I did not have too much success with that, so I used the conf file I recorded with irrecord.

After running irrecord copy your new myconf.conf file to /etc/lirc/lircd.conf.

Next create a hardware.conf file with the following content:

# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS=""

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

#Don't start irexec, even if a good config file seems to exist.
START_IREXEC=true

#Try to load appropriate kernel modules
# if LOAD_MODULES=false , modules must be preloaded, i.e. during boot (/etc/modules)
LOAD_MODULES=true
MODULES="sunxi_cir"

# Run "lircd --driver=help" for a list of supported drivers.
DRIVER="devinput"

# usually /dev/lirc0 is the correct setting for systems using udev
DEVICE="/dev/input/event1"

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

Then start lircd with
service lircd start

Once you have done so run the program
irw
and press some keys you defined before on your remote (e.g. key 1)
You should see now that your key is detected.

Next is to make a simple /etc/lirc/lircrc file
My test file contans the following 10 lines:
begin
   button = KEY_1
   prog = irexec
   config = echo "This is key 1"
end
begin
   button = KEY_2
   prog = irexec
   config = echo "This is key 2"
end

Next run the program irexec (if not running already) and press key 1.
You should now see the text
This is key 1
on the console

After that fully configure your remote.


You can find more info on lirc on http://www.lirc.org/
and if you have questions or improvements feel free to follow up in this thread or catch me on #orangepi on freenode (my nick: eFfeM, best time to catch is is evenings CET)

Frans
You can also reach me on freenode irc, channel #orangepi username eFfeM
Published in 2015-2-13 08:54:20 | Show all floors
Frans,Thank you.

11

threads

59

posts

326

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
326
 Author| Published in 2015-2-16 01:34:36 | Show all floors
updated the start post with some instructions how to start lirc
You can also reach me on freenode irc, channel #orangepi username eFfeM
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list