NOTE! This site uses cookies and similar technologies.

If you not change browser settings, you agree to it.

I understand

Welcome, Guest
Username: Password: Remember me

TOPIC: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot

Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 3 years 10 months ago #1

  • roadkill
  • roadkill's Avatar
  • Offline
  • Senior Boarder
  • Posts: 120
  • Thank you received: 13
  • Karma: 5
All info is now obsolete and is to remain here only for reference, all you need to do now is create the autostart.sh file with the following lines:
#!/bin/sh
modprobe lirc_rpi

to create the file
echo "modprobe lirc_rpi" > .config/autostart.sh
chmod +x .config/autostart.sh

These patches have been integrated into upstream kernel and were
also updated to use libgpio which is much better than settings pins directly
I will cease compiling once integrated into official OpenELEC.tv
github.com/OpenELEC/OpenELEC.tv/issues/1295

these patches works for me...
linux-3.6.3-605-lirc_rpi-0.2.patch
lirc-0.9.0-027-lirc_rpi-0.2.2.patch
maybe a couple of "y" will be required during compilation


new patch version using libgpio without accessing the pins directly
linux-3.6.6-605-lirc_rpi_libgpio.patch

the /storage/.config/autostart.sh should contain the commands needed to run the daemon with it's new configuration
touch /storage/.config/autostart.sh
chmod +x /storage/.config/autostart.sh
vi /storage/.config/autostart.sh
#!/bin/sh
(kill -9 $(pidof lircd); \
modprobe lirc_rpi; \ #for new libgpio version
/usr/sbin/lircd --driver=default --device=/dev/lirc0 --uinput --output=/var/run/lirc/lircd --pidfile=/var/run/lirc/lircd-lirc0.pid /storage/.config/lircd.conf; \
)&
If you're having inconsistencies with the above script you can use this one which is slower but works every time
#!/bin/sh
(modprobe lirc_rpi; \
while [ ! -e /var/run/lirc/lircd-lirc0 ]; do
	 sleep 1; \
done
if [ -h /var/run/lirc/lircd ]; \
	then logger autostart: lircd socket already linked! ;\
else
	logger autostart: linking lircd socket ... ; \
	rm /var/run/lirc/lircd; \
	ln -s /var/run/lirc/lircd-lirc0 /var/run/lirc/lircd; \
fi)&

also the lircd.conf should contain the config for the remote you're using...
lircd.conf for Mac Mini Remote
lircd.conf for MCE USB Remote
lircd.conf original XBOX Remote
lircd.conf XBOX 360 Remote

Pre-defined lircd.conf files for most remotes can be obtained here from the lirc project

I also keep an almost daily build with the above modifications:
OpenELEC-RPi.arm-devel-20121028220217-r12290.tar.bz2
OpenELEC-RPi.arm-devel-20121029170908-r12322.tar.bz2
OpenELEC-RPi.arm-devel-20121031185244-r12350.tar.bz2 :whistle:
OpenELEC-RPi.arm-devel-20121101221249-r12350.tar.bz2
OpenELEC-RPi.arm-devel-20121103142644-r12352.tar.bz2
OpenELEC-RPi.arm-devel-20121105172853-r12369.tar.bz2
OpenELEC-RPi.arm-devel-20121106191907-r12383.tar.bz2
OpenELEC-RPi.arm-devel-20121108015341-r12431.tar.bz2
OpenELEC-RPi.arm-devel-20121110154556-r12434.tar.bz2 - new driver using libgpio

OpenELEC-RPi.arm-devel-20121112073614-r12457.tar.bz2 - Last Compile patch has gone official!
OpenELEC-RPi.arm-devel-20121211200741-r12692.tar.bz2 - just for Ben
OpenELEC-RPi.arm-devel-20130127200033-r13108.tar.bz2 - More Recent Build Due to Requests

OpenELEC-RPi.arm-devel-20130204012132-r13161.img.zip - Pre-Prepared image file no configuration needed! compatible remotes XBOX, XBOX360, MS MCE RC6
How to install openELEC on the Raspberry Pi with Windows

Github repository if you prefer to compile yourself OpenELEC.tv with RPi Lirc

For anyone who is interested here is the link to the original project

Ready to go ;)

Raspberry Pi Rev2 512MB
CuBox-i4Pro
Last Edit: 3 years 5 months ago by roadkill.
The administrator has disabled public write access.
The following user(s) said Thank You: active89, switcher, navster

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 3 years 10 months ago #2

  • active89
  • active89's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 17
  • Karma: 0
Hello.
Great work!
I am seaching a lot for getting ir iver gpio work.
Please can you explane how to add the patch before compiling?
Or can i apply patch to already running openelec?
I am just a beginner, so few details would be nice.

Hope you have time for describing.

Thanks, chris
Last Edit: 3 years 10 months ago by active89.
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 3 years 10 months ago #3

  • roadkill
  • roadkill's Avatar
  • Offline
  • Senior Boarder
  • Posts: 120
  • Thank you received: 13
  • Karma: 5
compilation from git is needed to apply the patches
simply add the patches to the source tree

packages/linux/patches/
packages/sysutils/remote/lirc/patches/

if you don't want to compile you can simply grab the binary build

but you should check the wiki
Building and Installing OpenELEC for Raspberry Pi
Raspberry Pi Rev2 512MB
CuBox-i4Pro
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 3 years 10 months ago #4

  • active89
  • active89's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 17
  • Karma: 0
Thanks.
I will try it in the afternoon.
Do i not have to ad some lines in a config file or so to tell openelec which patches to compile?

I already know the wiki. but there aren't patches used
The administrator has disabled public write access.

Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 3 years 10 months ago #5

  • lrusak
  • lrusak's Avatar
  • Offline
  • Moderator
  • Posts: 4407
  • Thank you received: 758
  • Karma: 641
It already checks for patches. So if they are there it will use them :)
<-- Hit me with some karma if I've helped you out :)

The administrator has disabled public write access.
The following user(s) said Thank You: active89

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 3 years 10 months ago #6

  • DmitrySh
  • DmitrySh's Avatar
  • Offline
  • Junior Boarder
  • Posts: 65
  • Thank you received: 2
  • Karma: 0
Maybe we can ask developers to implement this patches in their future builds as feature request? Where can we do this?
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 3 years 10 months ago #7

  • vicbitter
  • vicbitter's Avatar
  • Offline
  • Gold Boarder
  • Posts: 966
  • Thank you received: 175
  • Karma: 64
roadkill wrote:
these patches works for me...

linux-3.6.3-605-lirc_rpi-0.2.patch

lirc-0.9.0-027-lirc_rpi-0.2.2.patch

maybe a couple of "y" will be required during compilation

the /storage/.config/autostart.sh should contain the commands needed to run the daemon with it's new configuration
touch /storage/.config/autostart.sh
chmod +x /storage/.config/autostart.sh
vi /storage/.config/autostart.sh
#!/bin/sh
(killall lircd; \
/usr/sbin/lircd --driver=default --device=/dev/lirc0 --uinput --output=/var/run/lirc/lircd --pidfile=/var/run/lirc/lircd-lirc0.pid /storage/.config/lircd.conf; \
)&
also the lircd.conf should contain the config for the remote you're using...

I also keep an almost daily build with the above modifications - OpenELEC-RPi.arm-devel-20121029170908-r12322.tar.bz2

Ready to go ;)


You need to add the following to the bottom of projects/RPi/linux/linux.arm.conf
#Add LIRC support
CONFIG_LIRC_RPI=y
CONFIG_IR_LIRC_CODEC=y

For anyone who is interested here is the link to the original project...
Last Edit: 3 years 10 months ago by vicbitter.
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 3 years 10 months ago #8

  • roadkill
  • roadkill's Avatar
  • Offline
  • Senior Boarder
  • Posts: 120
  • Thank you received: 13
  • Karma: 5
I updated the github repo with the changes from the original OpenELEC.tv project with my changes
so if you want to compile you can use the repository directly
OpenELEC.tv with RPi Lirc

this is an easier solution until an upstream patches will be integrated..

vicbitter: thanks, the lines were added to the github repo
Raspberry Pi Rev2 512MB
CuBox-i4Pro
Last Edit: 3 years 10 months ago by roadkill.
The administrator has disabled public write access.
The following user(s) said Thank You: active89

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 3 years 10 months ago #9

  • active89
  • active89's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 17
  • Karma: 0
So, i just installed your build.

Where can i say which remote i want to use??
(i should use the mce config)

I don't know if the driver is loaded correctly:
If i try:
dmesg | grep lirc_rpi
i don't get a message.
And when i try
# mode2 -d /dev/lirc0
i just get a message:
mode2: could not get file information for /dev/lirc0
mode2: default_init(): No such file or directory


Did i make sth wrong?

edit:
I just found out, that i have no file like:
/storage/.config/autostart.sh
which should contain the above changes.
Whats wrong here?
Last Edit: 3 years 10 months ago by active89.
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 3 years 10 months ago #10

  • roadkill
  • roadkill's Avatar
  • Offline
  • Senior Boarder
  • Posts: 120
  • Thank you received: 13
  • Karma: 5
/storage/.config/autostart.sh
is on the storage partition, simply create it
touch /storage/.config/autostart.sh
chmod +x /storage/.config/autostart.sh
vi /storage/.config/autostart.sh
#!/bin/sh
(killall lircd; \
/usr/sbin/lircd --driver=default --device=/dev/lirc0 --uinput --output=/var/run/lirc/lircd --pidfile=/var/run/lirc/lircd-lirc0.pid /storage/.config/lircd.conf; \
)&

/storage/.config/lircd.conf should contain the remote config
Raspberry Pi Rev2 512MB
CuBox-i4Pro
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 3 years 10 months ago #11

  • roadkill
  • roadkill's Avatar
  • Offline
  • Senior Boarder
  • Posts: 120
  • Thank you received: 13
  • Karma: 5
/storage/.config/autostart.sh is on the storage partition, simply create it
touch /storage/.config/autostart.sh
chmod +x /storage/.config/autostart.sh
vi /storage/.config/autostart.sh
#!/bin/sh
(killall lircd; \
/usr/sbin/lircd --driver=default --device=/dev/lirc0 --uinput --output=/var/run/lirc/lircd --pidfile=/var/run/lirc/lircd-lirc0.pid /storage/.config/lircd.conf; \
)&

/storage/.config/lircd.conf should contain the remote config
Raspberry Pi Rev2 512MB
CuBox-i4Pro
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 3 years 10 months ago #12

  • active89
  • active89's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 17
  • Karma: 0
thanks for response!

I created autostart.sh
I also created the lircd.conf with following inside:
# table rc6_mce, type: RC6
0x800f0400 KEY_NUMERIC_0
0x800f0401 KEY_NUMERIC_1
0x800f0402 KEY_NUMERIC_2
0x800f0403 KEY_NUMERIC_3
and so on

is this so correkt??

Ok, dmesg now works!

but mode2 doesnt work:
root ~ # mode2 -d /dev/lirc0
mode2: could not open /dev/lirc0
mode2: default_init(): Device or resource busy

What's wrong now??

Hope you can help me!
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 3 years 10 months ago #13

  • vicbitter
  • vicbitter's Avatar
  • Offline
  • Gold Boarder
  • Posts: 966
  • Thank you received: 175
  • Karma: 64
active89 wrote:
thanks for response!

I created autostart.sh
I also created the lircd.conf with following inside:
# table rc6_mce, type: RC6
0x800f0400 KEY_NUMERIC_0
0x800f0401 KEY_NUMERIC_1
0x800f0402 KEY_NUMERIC_2
0x800f0403 KEY_NUMERIC_3
and so on

is this so correkt??

Ok, dmesg now works!

but mode2 doesnt work:
root ~ # mode2 -d /dev/lirc0
mode2: could not open /dev/lirc0
mode2: default_init(): Device or resource busy

What's wrong now??

Hope you can help me!

You need to killall lircd before running mode2...
The administrator has disabled public write access.
The following user(s) said Thank You: active89

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 3 years 10 months ago #14

  • active89
  • active89's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 17
  • Karma: 0
Great!
It works!!

Thanks so much guys!
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 3 years 10 months ago #15

  • DmitrySh
  • DmitrySh's Avatar
  • Offline
  • Junior Boarder
  • Posts: 65
  • Thank you received: 2
  • Karma: 0
Hi, today TSOP4838 was attached to RPi and las build from this thread (OpenELEC-RPi.arm-devel-20121031185244-r12350.tar) was uploaded to RPi.
Create autostart.sh as described in first post
#!/bin/sh
(killall lircd;
/usr/sbin/lircd --driver=default --device=/dev/lirc0 --uinput --output=/var/run/lirc/lircd
--pidfile=/var/run/lirc/lircd-lircd0.pid /storage/.config/lircd.conf;
)&

No output in dmesg | grep lirc_rpi

Here output of dmesg
12.039284] input: lircd as /devices/virtual/input/input0
[   27.458604] bcm2835-cpufreq: switching to governor ondemand
[   27.458633] bcm2835-cpufreq: switching to governor ondemand<6>[ 1107.338176] input: lircd as /devices/virtual/input/input1
[ 1129.103109] input: lircd as /devices/virtual/input/input2
My IR receiver not work?

maybe someone can provide lircd.conf for Harmony remote? Is this file must be on place for correct driver work (dmesg output)?

try modprobe here output
root / # modprobe lirc_rpi debug=1
FATAL: Module lirc_rpi not found.
Last Edit: 3 years 10 months ago by DmitrySh.
The administrator has disabled public write access.
Moderators: lrusak