ar0n
Posts: 20
Joined: Thu Jun 07, 2012 9:33 pm

Re: LIRC GPIO driver for homebrew adapter

Thu Nov 15, 2012 3:49 pm

rudiratlos wrote:Hi just upgraded wheezy to
Linux raspberrypi 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux
I'm not sure if this contains the lirc_rpi module. Check your module directory if you can find the module.
rudiratlos wrote: added to /etc/modules:
lirc_dev
lirc_rpi gpio_in_pin=18
lirc_rpi gpio_out_pin=23
These parameters should be on one line: lirc_rpi gpio_in_pin=18 gpio_out_pin=23

rudiratlos
Posts: 91
Joined: Tue May 01, 2012 8:47 am

Re: LIRC GPIO driver for homebrew adapter

Fri Nov 16, 2012 12:00 pm

I have no module directory: /lib/modules/3.2.27+/misc/

Has someone or can supply one a quick start guide, to get this up and running?

All what I did is:
upgraded to latest wheezy,
edited /etc/moduls
apt-get install lirc
reboot

What's missing?

ar0n
Posts: 20
Joined: Thu Jun 07, 2012 9:33 pm

Re: LIRC GPIO driver for homebrew adapter

Sat Nov 17, 2012 7:56 am

rudiratlos wrote:What's missing?
I've cehcked this release, and it seems that there is no module yet in the kernel package, so you have to recompile the kernel.

naicheben
Posts: 344
Joined: Sat Jan 28, 2012 12:28 pm
Contact: Website

Re: LIRC GPIO driver for homebrew adapter

Sat Nov 17, 2012 9:10 am

Or ask the maintainers of your distribution if or when the will release a kernel update including the lirc_rpi module

rudiratlos
Posts: 91
Joined: Tue May 01, 2012 8:47 am

Re: LIRC GPIO driver for homebrew adapter

Tue Nov 27, 2012 12:10 pm

Now it runs perfectly.
running (with root): rpi-update did it.

settings for the piggy-back board (with a mounted IR receiver):
root@raspberrypi:#uname -a
Linux raspberrypi 3.2.27+ #307 PREEMPT Mon Nov 26 23:22:29 GMT 2012 armv6l GNU/Linux
root@raspberrypi:#apt-get install lirc
edit /etc/modules accordingly:
root@raspberrypi:#cat /etc/modules:
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.
snd-bcm2835
spi-bcm2708
i2c-bcm2708
i2c-dev
lirc_dev
lirc_rpi gpio_in_pin=18 gpio_out_pin=23
root@raspberrypi:#
root@raspberrypi:# ls -l /dev/lir*
crw-rw---T 1 root video 250, 0 Nov 27 11:54 /dev/lirc0
root@raspberrypi:/etc# dmesg | grep lirc
[ 11.967987] lirc_dev: IR Remote Control driver registered, major 250
[ 12.058479] lirc_rpi: module is from the staging directory, the quality is unknown, you have ...
[ 12.076966] lirc_rpi lirc_rpi.0: lirc_dev: driver lirc_rpi registered at minor = 0
[ 12.103270] lirc_rpi: driver registered!
[ 13.063179] lirc_rpi: auto-detected active low receiver on GPIO pin 18
root@raspberrypi:#cat /etc/lirc/lircd.conf for Apple Remote Control:
begin remote

name Apple_A1294
bits 8
flags SPACE_ENC
eps 30
aeps 100

header 9077 4461
one 562 1668
zero 562 562
ptrail 563
repeat 9083 2240
pre_data_bits 16
pre_data 0x77E1
post_data_bits 8
post_data 0xE0
gap 40539
toggle_bit_mask 0x0

begin codes
KEY_UP 0x50
KEY_DOWN 0x30
KEY_LEFT 0x90
KEY_RIGHT 0x60
KEY_PLAY 0xFA 0xA0
KEY_MENU 0xC0
KEY_OK 0xA0
end codes

end remote

root@raspberrypi:#/etc/init.d/lirc restart
[ ok ] Stopping remote control daemon(s): LIRC:.
[ ok ] Loading LIRC modules:.
[ ok ] Starting remote control daemon(s) : LIRC :.


rudiratlos
Posts: 91
Joined: Tue May 01, 2012 8:47 am

Re: LIRC GPIO driver for homebrew adapter

Wed Nov 28, 2012 10:05 am

Hello,
here is a working lircd.conf for the silver apple remote. My previous one was wrong.

In rasbmc, just add this piece to /etc/lirc/lircd.conf
#########################################################
# this config file was automatically generated
# using lirc-0.9.0-pre1(default) on Wed Nov 28 10:17:35 2012
#
# contributed by
#
# brand: apple
# model no. of remote control: A1294
# devices being controlled by this remote:
#

begin remote

name apple_a1294
bits 8
flags SPACE_ENC|CONST_LENGTH
eps 30
aeps 100

header 9054 4472
one 561 1663
zero 561 567
ptrail 565
repeat 9055 2236
pre_data_bits 16
pre_data 0x77E1
post_data_bits 8
post_data 0xF1
gap 108151
toggle_bit_mask 0x0

begin codes
KEY_UP 0x50
KEY_DOWN 0x30
KEY_LEFT 0x90
KEY_RIGHT 0x60
KEY_PLAY 0xFA 0xA0
KEY_MENU 0xC0
KEY_OK 0x3A 0xA0
end codes

end remote
#########################################################

here is my /etc/lirc/hardware.conf
in raspbmc, there is no need to edit this file. Only if you experiment with a regular OS distribution.
########################################################
# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS="--uinput"

#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=false

#Try to load appropriate kernel modules
LOAD_MODULES=true

# Run "lircd --driver=help" for a list of supported drivers.
DRIVER="default"
# usually /dev/lirc0 is the correct setting for systems using udev
DEVICE="/dev/lirc0"
MODULES="lirc_rpi"

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

and finally do a
/etc/init.d/lirc restart

for testing:
root@raspberrypi:/etc/lirc# irw
and press some buttons on the apple remote. You should see an output like this:
0000000077e150f1 00 KEY_UP apple_a1294
0000000077e190f1 00 KEY_LEFT apple_a1294
0000000077e190f1 01 KEY_LEFT apple_a1294
0000000077e160f1 00 KEY_RIGHT apple_a1294
0000000077e160f1 01 KEY_RIGHT apple_a1294
0000000077e130f1 00 KEY_DOWN apple_a1294
0000000077e130f1 01 KEY_DOWN apple_a1294
0000000077e13af1 00 KEY_OK apple_a1294
0000000077e1faf1 00 KEY_PLAY apple_a1294
0000000077e1c0f1 00 KEY_MENU apple_a1294
0000000077e1c0f1 00 KEY_MENU apple_a1294

nry
Posts: 11
Joined: Sun Jul 22, 2012 12:29 pm

Re: LIRC GPIO driver for homebrew adapter

Thu Jan 03, 2013 11:52 pm

Hi

Not had chance to test this just yet but looks like it could be on to what I need to complete my project.

I want multiple ir senders and receivers running off a single rpi.

Is this at all possible with the driver?

Thanks

nry
Posts: 11
Joined: Sun Jul 22, 2012 12:29 pm

Re: LIRC GPIO driver for homebrew adapter

Thu Jan 03, 2013 11:53 pm

Sorry should have been clearer.

With the ability to send ir out on one led and not another

Also with the receivers, to handle the input independently from each other

alexbain
Posts: 6
Joined: Sun Jul 08, 2012 6:47 pm

Re: LIRC GPIO driver for homebrew adapter

Mon Jan 07, 2013 1:40 am

I wrote a blog post that describes everything I had to do and install and setup LIRC (hardware and software) on my RaspberryPi. I used this thread as a resource and wanted to share the post in case anyone else finds it useful.

http://alexba.in/blog/2013/01/06/settin ... spberrypi/

giocu
Posts: 5
Joined: Fri Jan 18, 2013 9:10 am

Re: LIRC GPIO driver for homebrew adapter

Fri Jan 18, 2013 9:22 am

Hi all,
I'm in trouble with the lirc configuration (I belive!) I bought and used an IR receiver and I configured lirc with irrecord using my SONY TV remote control. From irrecord I got a fair lircd.conf file that contains something similar to (don't look to the values because I don't remember precisely now and I recorded as first test only 3 buttons):

begin remote

name /home/pi/lircd.conf
bits 8
flags SPACE_ENC|CONST_LENGTH
eps 30
aeps 100

header 9054 4472
one 561 1663
zero 561 567


........ other lines .....

begin codes
KEY_VOLUMEUP 0x50
KEY_VOLUMEDOWN 0x30
KEY_MENU 0xA0
end codes

end remote


Now I'm trying to use the lircd.conf obtained with a classical example taken from http://www.lirc.org/html/configure.html ... onf_format. I created the .lircrc file that contains:

begin
remote = /home/pi/lircd.conf
button = KEY_MENU
prog = irexec
repeat = 0
config = echo "Hello world!"
end


than I launched irexec without luck because it can't recognize the KEY_MENU button pressing. I would add that no error occurs during the irrecord configuration neither during the execution of irexec or mode2.

Where am I wrong? How can I test that lirc recognize one of the three buttons I recorded? Any idea?

giocu
Posts: 5
Joined: Fri Jan 18, 2013 9:10 am

Re: LIRC GPIO driver for homebrew adapter

Sat Jan 19, 2013 3:48 pm

Solved by myself!
I have not replaced the /etc/lirc/lircd.conf with the one provided by irrecord, so I correctly did the remote control configuration but the system didn't see it... :roll:

blblb
Posts: 2
Joined: Sat Jan 26, 2013 5:42 pm

Re: LIRC GPIO driver for homebrew adapter

Sat Jan 26, 2013 5:44 pm

I have one question :> What frequency should the IR Receiver be? I have a 36kHz version + a XboX360 remote control (RC6) but it doesn't work?

Should I get a 38kHz one? I was under the impression that the remote control and the receiver should match.

blblb
Posts: 2
Joined: Sat Jan 26, 2013 5:42 pm

Re: LIRC GPIO driver for homebrew adapter

Mon Jan 28, 2013 9:09 pm

blblb wrote:I have one question :> What frequency should the IR Receiver be? I have a 36kHz version + a XboX360 remote control (RC6) but it doesn't work?

Should I get a 38kHz one? I was under the impression that the remote control and the receiver should match.
Well I just ordered 2 38kHz receviers for $2 from eBay so we'll see if that works. But I am still curious why it doesn't work with a 36kHz one.

syconiss
Posts: 2
Joined: Fri Feb 01, 2013 7:41 pm

Re: LIRC GPIO driver for homebrew adapter

Fri Feb 01, 2013 7:55 pm

Hi all just wanted to say great work ar0n this is by far the coolest thing i've got my pi to do so far :D

Patching the Kernel was a bit complicated for me so I found a tutorial using the newer ,already patched, Rasbian image at http://alexba.in/blog/2013/01/06/settin ... spberrypi/. Thought I would post it up if others like me are having problems.

I was also wondering if anyone has any better schematics for ir blasters. I used the first one on ar0n's site but on my set up it has really poor range (I have to have the ir LED positioned right in front of my sky box) I did look at the link ar0n provided here http://iguanaworks.net/products/series-transceiver/ but I've not got much experience with electronics and I have no idea how to implement this to the pi's GPIOs.

Any one got any ideas ? It would be greatly appreciated :P

alexbain
Posts: 6
Joined: Sun Jul 08, 2012 6:47 pm

Re: LIRC GPIO driver for homebrew adapter

Sun Feb 24, 2013 6:46 pm

syconiss wrote: I was also wondering if anyone has any better schematics for ir blasters. I used the first one on ar0n's site but on my set up it has really poor range (I have to have the ir LED positioned right in front of my sky box) I did look at the link ar0n provided here http://iguanaworks.net/products/series-transceiver/ but I've not got much experience with electronics and I have no idea how to implement this to the pi's GPIOs.

Any one got any ideas ? It would be greatly appreciated :P
Hey Syconiss. In the blog post I posted above (http://alexba.in/blog/2013/01/06/settin ... spberrypi/) I linked to some sample IR blaster schematics that worked well for me. The "TV-B-Gone" schematic in particular I found to be useful.

I also wanted to add another blog post I just wrote that describes how to create web interface for LIRC on the RaspberryPi. My approach uses two open source projects I created called lirc_node (https://github.com/alexbain/lirc_node) and lirc_web (https://github.com/alexbain/lirc_web). In my blog post I describe how to use these projects to boot a sample web application that controls LIRC from your phone/desktop. Controlling LIRC from my phone is a much better user experience than having to use the command line.

http://alexba.in/blog/2013/02/23/contro ... m-the-web/

Hopefully this helps someone else out there!

reibuehl
Posts: 6
Joined: Sat Jan 26, 2013 7:33 pm

Re: LIRC GPIO driver for homebrew adapter

Wed Mar 13, 2013 6:46 pm

I am trying to get the LIRC GPIO driver to work. The module loads fine, but if I try to start irw with irw /dev/lirc0, I only get the error message "connect: Connection refused".

If I watch the signal on the GPIO line with an oscilloscope, I see that the TSOP sends a different signal whenever I press a key on my remote.

Do you have any advice how to fix this?

dmesg:

Code: Select all

[  587.966582] lirc_dev: IR Remote Control driver registered, major 248 
[  587.972199] lirc_rpi: module is from the staging directory, the quality is unknown, you have been warned.
[  587.975886] lirc_rpi lirc_rpi.0: lirc_dev: driver lirc_rpi registered at minor = 0
[  587.975913] lirc_rpi: driver registered!
[  588.926899] lirc_rpi: auto-detected active high receiver on GPIO pin 18
Testing:

Code: Select all

root@raspberrypi:/etc/lirc# irw /dev/lirc0     
connect: Connection refused
root@raspberrypi:/etc/lirc# ls -l /dev/lirc*
crw-rw---T 1 root video 248, 0 Mär 13 18:49 /dev/lirc0
root@raspberrypi:/etc/lirc# lsmod
Module                  Size  Used by
lirc_rpi                7266  0 
lirc_dev               10156  1 lirc_rpi
bnep                   10574  2 
bluetooth             193568  7 bnep
rfkill                 18202  2 bluetooth
nfsd                  229441  2 
snd_bcm2835            15846  0 
snd_pcm                77560  1 snd_bcm2835
snd_page_alloc          5145  1 snd_pcm
snd_seq                53329  0 
snd_seq_device          6438  1 snd_seq
snd_timer              19998  2 snd_pcm,snd_seq
snd                    58447  5 snd_bcm2835,snd_timer,snd_pcm,snd_seq,snd_seq_device
joydev                  9316  0 
evdev                   9426  4 
leds_gpio               2235  0 
led_class               3562  1 leds_gpio
root@raspberrypi:/etc/lirc# cat /proc/interrupts
           CPU0       
  3:    3378745   ARMCTRL  BCM2708 Timer Tick
 32:    2961059   ARMCTRL  dwc_otg, dwc_otg_pcd, dwc_otg_hcd:usb1
 52:          0   ARMCTRL  BCM2708 GPIO catchall handler
 65:       7401   ARMCTRL  ARM Mailbox IRQ
 66:          1   ARMCTRL  VCHIQ doorbell
 75:          1   ARMCTRL
 77:      15587   ARMCTRL  bcm2708_sdhci (dma)
 83:         19   ARMCTRL  uart-pl011
 84:      36051   ARMCTRL  mmc0
FIQ:              usb_fiq
Err:          0
root@raspberrypi:/etc/lirc# 

oxivanisher
Posts: 1
Joined: Sun Mar 17, 2013 12:19 am

Re: LIRC GPIO driver for homebrew adapter

Sun Mar 17, 2013 12:20 am

I have the same problem. Any news on this?

Cheers, oxi

enptfb55
Posts: 1
Joined: Thu Mar 28, 2013 12:56 am

Re: LIRC GPIO driver for homebrew adapter

Thu Mar 28, 2013 1:24 am

Im having an issue with the lirc_rpi driver

when i use an apple remote lircd.conf everything works fine, but when i try using a samsung lircd.conf i get the following error
irsend send_once samsung power
irsend: command failed: send_once samsung power
irsend: transmission failed
Any ideas?

apple lircd.conf

Code: Select all

# default
begin remote

name Apple_A1294
bits 8
flags SPACE_ENC
eps 30
aeps 100

header 9077 4461
one 562 1668
zero 562 562
ptrail 563
repeat 9083 2240
pre_data_bits 16
pre_data 0x77E1
post_data_bits 8
post_data 0xE0
gap 40539
toggle_bit_mask 0x0

begin codes
KEY_UP 0x50
KEY_DOWN 0x30
KEY_LEFT 0x90
KEY_RIGHT 0x60
KEY_PLAY 0xFA 0xA0
KEY_MENU 0xC0
KEY_OK 0xA0
end codes

end remote

samsung lircd.conf

Code: Select all

# default
# this config file was automatically generated
# using lirc-0.8.2(samsung) on Sat Dec 22 08:38:51 2007
#
# contributed by Robert Schedel <r.schedel | yahoo.de>
#
# brand:                       Satelco (Samsung IrDA remote)
# model no. of remote control: RE49C
# devices being controlled by this remote: Satelco EasyWatch DVB-C
#
# Basically this should handle all remotes reporting as Samsung IrDA
# (0419:0001), but for now only the Satelco remote is tested.
# 

begin remote

  name  Samsung
  bits           32
  eps            30
  aeps          100

  one             0     0
  zero            0     0
  gap          203831
  pre_data_bits   0
  pre_data      0x0
  toggle_bit      0

      begin codes
### Standard keyboard report, type 1
          OK                       0x70028
          Right                    0x7004f
          Left                     0x70050
          Up                       0x70052
          Down                     0x70051

### Standard generic desktop report, type 3
          Power                    0x10001

### Propietary Samsung report, type 4
          Mute                     0xffcc0001
          Video_Archive            0xffcc0002
          1                        0xffcc0003
          2                        0xffcc0004
          3                        0xffcc0005
          Sleep                    0xffcc0006
          4                        0xffcc0007
          5                        0xffcc0008
          6                        0xffcc0009
          Last                     0xffcc000a
          7                        0xffcc000b
          8                        0xffcc000c
          9                        0xffcc000d
          Subtitle                 0xffcc000e
          Full                     0xffcc000f
          0                        0xffcc0010
          PIP                      0xffcc0011
          Timer                    0xffcc0012
          Source                   0xffcc0013
          TV_Menu                  0xffcc0014
          EPG                      0xffcc0015
          Text                     0xffcc0016
# gap 17..1b: probably cursor keys were previously planned here
          TV                       0xffcc001c
          Radio                    0xffcc001d
          DVD                      0xffcc001e
          Ch+                      0xffcc001f
          Menu                     0xffcc0020
          Vol+                     0xffcc0021
          Ch-                      0xffcc0022
          Back                     0xffcc0023
          Vol-                     0xffcc0024
          Play                     0xffcc0025
          Pause                    0xffcc0026
          Stop                     0xffcc0027
          Record                   0xffcc0028
          Prev                     0xffcc0029
          Rewind                   0xffcc002a
          Forward                  0xffcc002b
          Next                     0xffcc002c
          Red                      0xffcc002d
          Green                    0xffcc002e
          Yellow                   0xffcc002f
          Blue                     0xffcc0030
      end codes

end remote
hardware.conf

Code: Select all

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

#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=false

#Try to load appropriate kernel modules
LOAD_MODULES=true

# Run "lircd --driver=help" for a list of supported drivers.
DRIVER="default"
# usually /dev/lirc0 is the correct setting for systems using udev 
DEVICE="/dev/lirc0"
MODULES="lirc_rpi"

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

cleverca22
Posts: 202
Joined: Sat Aug 18, 2012 2:33 pm

Re: LIRC GPIO driver for homebrew adapter

Thu Mar 28, 2013 6:39 pm

any output in dmesg after it fails to transmit?

rudiratlos
Posts: 91
Joined: Tue May 01, 2012 8:47 am

Re: LIRC GPIO driver for homebrew adapter

Sun Apr 07, 2013 1:57 pm

Hi, is it possible to control 2 independent output gpio pins with lirc?
I have an IR transmitter and an 433MHz transmitter on my pcb. I want to control IR devices (like HiFi equipment) and powerswitches, that can be controlled in the 433MHz frequency band (e.g.: http://www.amazon.de/Elro-AB440S-3C-Fun ... B002QXN7X6 ).

So I need 2 lines in the /etc/modules file with gpio_out_pin:
lirc_rpi gpio_out_pin=23
lirc_rpi gpio_out_pin=21

how to achieve that?

cleverca22
Posts: 202
Joined: Sat Aug 18, 2012 2:33 pm

Re: LIRC GPIO driver for homebrew adapter

Sun Apr 07, 2013 8:23 pm

the driver would need to be modified to support multiple transmitters

rudiratlos
Posts: 91
Joined: Tue May 01, 2012 8:47 am

Re: LIRC GPIO driver for homebrew adapter

Mon Apr 08, 2013 2:54 pm

Hi ar0n, can you modify the driver for multiple transmitter support ?

Pirion
Posts: 1
Joined: Fri Sep 14, 2012 9:48 am

Re: LIRC GPIO driver for homebrew adapter

Mon Apr 15, 2013 11:15 am

I follow this tuto : http://alexba.in/blog/2013/01/06/settin ... spberrypi/

all seem good but I have a problem.
when I use irw my IR receiver understand my remote.
But when I want send signal with my IR led with :
Irsend SEND_ONCE SONY STANDBY nothing append, my TV doesn’t poweroff.
it seem that my ir led it's always switch on.
Have you got some idea?

nry
Posts: 11
Joined: Sun Jul 22, 2012 12:29 pm

Re: LIRC GPIO driver for homebrew adapter

Mon Jun 03, 2013 8:32 pm

+1 for multiple transmitters

Multiple receivers would be nice too for a IR routing project I am looking at doing :?

Return to “Add-ons”

Who is online

Users browsing this forum: No registered users and 6 guests