Hi!
I've created a lirc driver for the RPi. With this you can simply use an IR receiver and interface it with a gpio pin. The driver is based on the lirc_serial driver and measures the pulse/space widths and sends the to the lirc subsystem.
Howto and patch here: http://aron.ws/projects/lirc_rpi/
Aron
Re: LIRC GPIO driver for homebrew adapter
Sounds great.
I am actually looking for a solution to send IR using the Pi as ir blaster.
Here http://www.irblaster.info/blog/2007/04/ ... outer.html they said that it should be possible with the GPIO pins from the Pi.
Some code could be found in the openwrt software.
Can anybody be of some help?
I am actually looking for a solution to send IR using the Pi as ir blaster.
Here http://www.irblaster.info/blog/2007/04/ ... outer.html they said that it should be possible with the GPIO pins from the Pi.
Some code could be found in the openwrt software.
Can anybody be of some help?
Re: LIRC GPIO driver for homebrew adapter
Sending IR signals can be done ... you need to modify the source a little bit. Maybe when I have a little time I will modify it (next week maybe) ...
Re: LIRC GPIO driver for homebrew adapter
That would be great.
Looking forward to it. Gives us a 35$ ethernet ir blaster
Looking forward to it. Gives us a 35$ ethernet ir blaster

Re: LIRC GPIO driver for homebrew adapter
Hi Aron,
this sounds great, I just downloaded the toolchain, lirc and your patch I will give it a go tonight. Im also interested in using rpi for blasting. I will take a look at how this feat is implemented in the other lirc drivers maybe its straight forward to support a gpio instead of the DTR of the serial port.
How do you plan to deploy this new module on your target or are you hoping this will be included in the lirc project? Which distribution are you planning to use it on?
Best regards
Martin
this sounds great, I just downloaded the toolchain, lirc and your patch I will give it a go tonight. Im also interested in using rpi for blasting. I will take a look at how this feat is implemented in the other lirc drivers maybe its straight forward to support a gpio instead of the DTR of the serial port.
How do you plan to deploy this new module on your target or are you hoping this will be included in the lirc project? Which distribution are you planning to use it on?
Best regards
Martin
AMOTE - a LIRC client for Android. Build your own Android-based universal remote.
Re: LIRC GPIO driver for homebrew adapter
I don't really know ... I created a sepparate module because in my opinion this does not belong to lirc_serial because it does not use serial. The lirc_gpio is used by tv cards. I plan to create binary packages so peaople can install this quickly. As of mergin it with something, I'm open and I'm willing to maintain the code.
Re: LIRC GPIO driver for homebrew adapter
I agree, this totally belongs to its own driver, I meant I would look at the serial driver for inspiration of how to support the blaster function.
AMOTE - a LIRC client for Android. Build your own Android-based universal remote.
Re: LIRC GPIO driver for homebrew adapter
I already have a Pi 
And my soldering skills are not too bad.
I just need a list of electronic pieces and can help to test.

And my soldering skills are not too bad.
I just need a list of electronic pieces and can help to test.
Re: LIRC GPIO driver for homebrew adapter
You only need an IR receiver module.mredeker wrote:I already have a Pi
And my soldering skills are not too bad.
I just need a list of electronic pieces and can help to test.
Re: LIRC GPIO driver for homebrew adapter
OpenELEC howto can be found on my site.
Re: LIRC GPIO driver for homebrew adapter
I succesfully crosscompiled lirc with arons patches:
1. Followed the steps at http://elinux.org/RPi_Kernel_Compilation (cloned to /home/rpi/linux)
2. Downloaded and patched lirc according to arons recipe
3. ./configure --host=arm-linux-gnueabi --with-driver=rpi --with-kerneldir=/home/rpi/linux
4. make ARCH=arm
5. Copied irrecord, lirc_dev.ko, lirc_rpi.ko to target
6. insmodded the ko's, killed the running lircd and executed "irrecord irrecord -d /dev/lirc0 /home/pi/lircd.conf" (this was on a PI running the raspbmc distribution)
1. Followed the steps at http://elinux.org/RPi_Kernel_Compilation (cloned to /home/rpi/linux)
2. Downloaded and patched lirc according to arons recipe
3. ./configure --host=arm-linux-gnueabi --with-driver=rpi --with-kerneldir=/home/rpi/linux
4. make ARCH=arm
5. Copied irrecord, lirc_dev.ko, lirc_rpi.ko to target
6. insmodded the ko's, killed the running lircd and executed "irrecord irrecord -d /dev/lirc0 /home/pi/lircd.conf" (this was on a PI running the raspbmc distribution)
AMOTE - a LIRC client for Android. Build your own Android-based universal remote.
Re: LIRC GPIO driver for homebrew adapter
@mredeker: If you are looking for blasters, I am going to try the amplified transmitter found at http://www.lirc.org/transmitters.html. I haven't looked too much into it yet so I don't know if it needs modification to be used with the raspberry pi GPIO pins though.
AMOTE - a LIRC client for Android. Build your own Android-based universal remote.
Re: LIRC GPIO driver for homebrew adapter
@mba: Thanks for checking it out ... I'm sorry for the typo, I've corrected the compile instructions on the site. Also the blaster should work that way. I will also check it out at the weekend...
Re: LIRC GPIO driver for homebrew adapter
no problem, so you saw my other desperate post regarding cross-compilation 
Are you looking into the blaster part at the moment? Or should I take a crack at it? Im looking at lirc_serial for inspiration and it doesn't seem too scary, I think with the right chisel it could be transformed into a rpi gpio blaster, or do have other drivers as preferred inspiration source?

Are you looking into the blaster part at the moment? Or should I take a crack at it? Im looking at lirc_serial for inspiration and it doesn't seem too scary, I think with the right chisel it could be transformed into a rpi gpio blaster, or do have other drivers as preferred inspiration source?
AMOTE - a LIRC client for Android. Build your own Android-based universal remote.
Re: LIRC GPIO driver for homebrew adapter
Hi there,
Any news on that ?
Is there way to connect emiter and/or receiver on GPIO and use it with lirc ?
Thanks for your work
Any news on that ?
Is there way to connect emiter and/or receiver on GPIO and use it with lirc ?
Thanks for your work
Re: LIRC GPIO driver for homebrew adapter
@mba, @davy39: yes and I think I've got it to work. I still need to test a few things... I will publicate the driver and the interface tomorrow.
Re: LIRC GPIO driver for homebrew adapter
Couldn't expect better !
Many thanks
Many thanks
Re: LIRC GPIO driver for homebrew adapter
Done. Please check it out. 

Re: LIRC GPIO driver for homebrew adapter
Many thanks ! I'll try it as soon I receive my board...
In your blaster scheme, according to what you say in the description of the default configuration, shouldn't it be PIN11 - GPIO17 instead of PIN12 |(GPIO18) ?
In your blaster scheme, according to what you say in the description of the default configuration, shouldn't it be PIN11 - GPIO17 instead of PIN12 |(GPIO18) ?
Re: LIRC GPIO driver for homebrew adapter
Of course ... thanks for the correction!davy39 wrote:Many thanks ! I'll try it as soon I receive my board...
In your blaster scheme, according to what you say in the description of the default configuration, shouldn't it be PIN11 - GPIO17 instead of PIN12 |(GPIO18) ?

Re: LIRC GPIO driver for homebrew adapter
I applied your new patch and lirc compiled nicely, but it seems you have removed the module parameters gpio_in_pin and gpio_out_pin, its not possible to specify these parameters on the command line.
pi@raspbmc:~$ sudo insmod lirc_rpi.ko gpio_in_pin=0 gpio_out_pin=1
insmod: error inserting 'lirc_rpi.ko': -1 Unknown symbol in module
pi@raspbmc:~$ sudo insmod lirc_rpi.ko gpio_in_pin=0 gpio_out_pin=1
insmod: error inserting 'lirc_rpi.ko': -1 Unknown symbol in module
AMOTE - a LIRC client for Android. Build your own Android-based universal remote.
Re: LIRC GPIO driver for homebrew adapter
Can you please redownload/reapply the patch now? Also this is not an invalid module parameter error. Can you send me the "dmesg | grep lirc" output after the insmod has been run ?mba wrote:I applied your new patch and lirc compiled nicely, but it seems you have removed the module parameters gpio_in_pin and gpio_out_pin, its not possible to specify these parameters on the command line.
pi@raspbmc:~$ sudo insmod lirc_rpi.ko gpio_in_pin=0 gpio_out_pin=1
insmod: error inserting 'lirc_rpi.ko': -1 Unknown symbol in module
Thanks!
Re: LIRC GPIO driver for homebrew adapter
No it doesn't sound like it, but it is. Insmodding without parameters work, adding the gpio_in_pin/gpio_out_pin doesn't work- see below. I think the patch is not applied correctly or the patch itself is broken. For some reason large parts of the patch isn't applied. The last line in lirc_rpi.c after patching is the closing } of the function static void set_use_dec(void *data).
pi@raspbmc:~$ sudo insmod lirc_rpi.ko
pi@raspbmc:~$ sudo rmmod lirc_rpi.ko
pi@raspbmc:~$ sudo insmod lirc_rpi.ko gpio_in_pin=0 gpio_out_pin=1
insmod: error inserting 'lirc_rpi.ko': -1 Unknown symbol in module
dmesg output
lirc_dev: IR Remote Control driver registered, major 252
lirc_rpi: module license 'unspecified' taints kernel.
Disabling lock debugging due to kernel taint
lirc_rpi: Unknown parameter `gpio_in_pin'
lirc_rpi: Unknown parameter `gpio_in_pin'
pi@raspbmc:~$ sudo insmod lirc_rpi.ko
pi@raspbmc:~$ sudo rmmod lirc_rpi.ko
pi@raspbmc:~$ sudo insmod lirc_rpi.ko gpio_in_pin=0 gpio_out_pin=1
insmod: error inserting 'lirc_rpi.ko': -1 Unknown symbol in module
dmesg output
lirc_dev: IR Remote Control driver registered, major 252
lirc_rpi: module license 'unspecified' taints kernel.
Disabling lock debugging due to kernel taint
lirc_rpi: Unknown parameter `gpio_in_pin'
lirc_rpi: Unknown parameter `gpio_in_pin'
AMOTE - a LIRC client for Android. Build your own Android-based universal remote.
Re: LIRC GPIO driver for homebrew adapter
You were right. l re-generated the patch, please check it out now. Maybe because of my home machine has memory problems, the patch was not generated well... Sorry for that.mba wrote:No it doesn't sound like it, but it is. Insmodding without parameters work, adding the gpio_in_pin/gpio_out_pin doesn't work- see below. I think the patch is not applied correctly or the patch itself is broken. For some reason large parts of the patch isn't applied. The last line in lirc_rpi.c after patching is the closing } of the function static void set_use_dec(void *data).
pi@raspbmc:~$ sudo insmod lirc_rpi.ko
pi@raspbmc:~$ sudo rmmod lirc_rpi.ko
pi@raspbmc:~$ sudo insmod lirc_rpi.ko gpio_in_pin=0 gpio_out_pin=1
insmod: error inserting 'lirc_rpi.ko': -1 Unknown symbol in module
dmesg output
lirc_dev: IR Remote Control driver registered, major 252
lirc_rpi: module license 'unspecified' taints kernel.
Disabling lock debugging due to kernel taint
lirc_rpi: Unknown parameter `gpio_in_pin'
lirc_rpi: Unknown parameter `gpio_in_pin'
Last edited by ar0n on Sat Jun 16, 2012 7:47 am, edited 1 time in total.
Re: LIRC GPIO driver for homebrew adapter
Applying the rest of the patch manually makes the difference 
pi@raspbmc:~$ sudo insmod lirc_dev.ko
pi@raspbmc:~$ sudo insmod lirc_rpi.ko gpio_in_pin=0 gpio_out_pin=1
pi@raspbmc:~$ lsmod
Module Size Used by
lirc_rpi 4512 0
lirc_dev 8728 1 lirc_rpi
fuse 49448 1

pi@raspbmc:~$ sudo insmod lirc_dev.ko
pi@raspbmc:~$ sudo insmod lirc_rpi.ko gpio_in_pin=0 gpio_out_pin=1
pi@raspbmc:~$ lsmod
Module Size Used by
lirc_rpi 4512 0
lirc_dev 8728 1 lirc_rpi
fuse 49448 1
AMOTE - a LIRC client for Android. Build your own Android-based universal remote.