chrisalanwest
Posts: 2
Joined: Fri Oct 11, 2013 5:48 pm

More than IR sensor for lirc_rpi?

Tue Oct 15, 2013 4:14 pm

Hi all, I'm wondering if any one can help.
I have lirc_rpi running on my pi perfectly and it's controlling everything as it should.
Only now I want to add some more IR LED's. So I've done some searches and I found this post:
http://www.raspberrypi.org/phpBB3/viewt ... &start=125
On the linked page an altered module is mentioned. It links to a file (lirc_rpi.c): http://harctoolbox.org/downloads/lirc_rpi.c.
I assume that this file has to be compiled and installed. This is where I come unstuck. I have searched high and low and installed goodness knows what on my Pi! I just can't find a clear and concise guide to talk me through step by step what exactly I need to do to compile and install that file!! Everything I seem to try fails and leads me in to some very complicated black holes.
Is anyone able to help me understand and talk me through what I need to do?
Any help would be greatly appreciated. Thanks in advance.

cira
Posts: 4
Joined: Thu Oct 17, 2013 1:47 am

Re: More than IR sensor for lirc_rpi?

Thu Oct 17, 2013 2:21 am

I am in the same place you are. I have never compiled a kernel before, but I did manage to get all of the sources together, insert the lirc_rpi.c file you linked too, that I found a couple of days ago myself, and compile everything up. So I am a little further along than you are. Currently I am at the point where I tried to install the module as a replacement to the existing module but I am getting an error saying "Unknown symbol in module". From the little bit of research I have done it looks like there may be a dependency I am missing, or something declared incorrectly in the file. Almost everything I find is in German talking about that code, and I don't speak or read German. If I get it figured out I'll let you know.

I do have a question for you though. Are you trying to control two devices that use the same remote config? Is that why you are trying to put two different transmitters on the pi? I am trying to do something a little different. I am trying to hook up two TSOP because one of my devices runs at 56khz and the other runs at 38khz so I have a clock issue with using a single receiver. I am also working to get the pi functioning as a repeater/extender in addition to being able to control all of my IR devices.

I found some examples where people are running multiple instances of the lircd but that just does not sound right and clean to me. That work around can be found over in the thread http://www.raspberrypi.org/phpBB3/viewt ... &start=125 which links to their code https://github.com/phillipsnick/rpi-linux

As far as compiling I used the tutorial over at raspbmc.com to cross compile on a Ubuntu machine. That can be found at http://www.raspbmc.com/wiki/technical/kernel/ It was not 100% clear to me since I have never compiled a kernel before but I eventually muddled my way through it. The thing I learned in the process is follow the directions to get your "Raspbmc builders root filesystem" setup first. The last step is to chroot to the new file system. From there you can use wget to download the build_kernel.sh script (which by the way their link on the page is broken, there are newer version build_kernel-3.6.sh or build_kernel-3.8.sh). The script will download all of the stuff you need and compile. You will just need to modify the script before you run it to pause somewhere before it starts the make process so you can copy in your updated lirc_rpi.c files into the source.

Maybe you will have better luck than I will. Or maybe someone will chime in with an answer. Either way I will let you know if I figure it out myself.

cira
Posts: 4
Joined: Thu Oct 17, 2013 1:47 am

Re: More than IR sensor for lirc_rpi?

Fri Oct 18, 2013 2:23 am

@chrisalanwest I managed to figure out and get the lirc_rpi.c file you linked to built, and in the process discovered it only has multiple output support not multiple input support like I wanted. So it won't work for me, but may work for you.

I assume you are running raspbmc kernel 3.6. I have attached the compiled kernel object. Just download it, copy it to your pi, and extract it. If you are running a different version of the kernel don't use this ko file. If you are unsure of your kernel version just run the command "uname -a" on your pi.

Assuming the lircd is running first kill the lircd

Code: Select all

sudo kill $(pidof lircd)
then unload the existing lirc_rpi module

Code: Select all

sudo rmmod lirc_rpi
Then load the new kernel object (assuming you are in the current directory that you saved the new lirc_rpi.ko, and you have your receiver on pin 18 and two IR LED circuits connected on pin 17 and 27)

Code: Select all

sudo insmod lirc_rpi.ko gpio_in_pin=18 gpio_out_pins=17,27
If you are feeling brave, the two sets of directions I linked to in the previous post will get you to a point where you can compile the module yourself. If you need some more help I can try to put together some detailed steps to build with those instructions. I assume you are in the same boat that I was a couple of days ago and compiling a kernel object is foreign.
Attachments
lirc_rpi.tar
(20.5 KiB) Downloaded 224 times

Return to “HATs and other add-ons”