more G-Labs products

Author Topic: LIRC  (Read 3081 times)

July 16, 2014, 07:58:08 PM
Read 3081 times

Boeky

  • **
  • Information
  • Jr. Member
  • Posts: 31
Hi,

Today I got myself a TSOP 2238 which according to the datasheet is the same as the 4838 except the pinout (http://www.vishay.com/docs/82459/tsop48.pdf)

I tried several totorials changing /etc/modules, etc/init.d/lirc/hardware.conf, ...

Rebooting the Raspberry pi gives me following informatien so everything seems to work correctly so far.
Code: [Select]
[   11.172400] lirc_dev: IR Remote Control driver registered, major 248
[   11.255043] lirc_rpi: module is from the staging directory, the quality is unknown, you have been warned.
[   12.220397] lirc_rpi: auto-detected active low receiver on GPIO pin 18
[   12.226094] lirc_rpi lirc_rpi.0: lirc_dev: driver lirc_rpi registered at minor = 0
[   12.228962] lirc_rpi: driver registered!

Running the command "pi@homegenie ~ $ mode2 -d /dev/lirc0" results in a very fast output of pulses. When I disconnect the GPIO18 wire the pulses become pauses or unstable...

result of 5 seconds running :
Code: [Select]
pulse 80
pulse 40
pulse 43
pulse 37
pulse 41
pulse 86
pulse 50
pulse 26
pulse 39

// ANOTHER 500 LINES WITH PULSE X

pulse 20
pulse 20
pulse 20
pulse 20
space 9958  // DISCONNECTIONG GPIO18 WIRE
space 53
space 16
space 68
space 10
space 44
space 39
space 19
space 20
pulse 20
pulse 20
pulse 23
pulse 18
pulse 20
pulse 21
pulse 19
pulse 21
pulse 20
pulse 20
pulse 21
pulse 20
pulse 20
pulse 50
pulse 57
pulse 56
pulse 37
pulse 20
pulse 21
pulse 49
pulse 117
pulse 57
pulse 24
pulse 8031
pulse 167
pulse 39
pulse 81
pulse 29
pulse 29
pulse 27
pulse 25
pulse 12
pulse 40
pulse 35
pulse 27
pulse 51
pulse 33
pulse 14
pulse 20
pulse 20
pulse 25
pulse 34
pulse 28
pulse 27
space 28
space 21
space 31
space 29
space 27
space 13
space 43
space 19
space 86
space 9607
space 47
space 103
space 99
space 76
space 28
space 14
space 29
space 10
space 47
space 14
pulse 22
pulse 19
pulse 20
pulse 20
pulse 20
pulse 20
pulse 29
pulse 11
pulse 21
pulse 33
pulse 27
pulse 20
pulse 20
pulse 19
pulse 22
pulse 18
pulse 20
pulse 20
pulse 63

// ANOTHER 1500 LINES OF PULSE X OR PAUSE X

pulse 16
pulse 25
pulse 16
pulse 20
pulse 22
pulse 19
pulse 18
pulse 23

Anyone any idea what went wong here?
Can anyone provide me a step by step guide to install LIRC on Raspbian for Homgenie.

I'm also looking how to receive and send commands in a C# Program...


Thanks,
Christophe



July 17, 2014, 06:23:12 PM
Reply #1

jjr

  • *
  • Information
  • Newbie
  • Posts: 15
Hi  I presume you have it wired up correctly? With the left pin (when its facing you) goes to gpio18 middle pin ground and right pin 3.3v. It looks to me as if you have edited the wrong file, you wrote /etc/init.d/lirc/hardware.conf but you should be editing /etc/lirc/hardware.conf.
These are the steps i follow:

Lirc Setup

Step 1
Configuring LIRC by Editing the /etc/lirc/hardware.conf file:
  pi@raspberrypi~$  sudo nano /etc/lirc/hardware.conf
Copy and Paste the following text into it:

########################################################
# /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=""
########################################################

You may need to change Modules=?lirc_rpi? if you are using a usb IR ie: Modules=?mceusb?

Step 2
Check the kernel modules are loaded
pi@raspberrypi~$  sudo nano /etc/modules
It should look like this:
# /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
lirc_dev
lirc_rpi gpio_in_pin=18 gpio_out_pin=17

Step 3
Also check:
pi@raspberrypi ~ $ sudo cat /root/.lircrc
It should look like this:
begin
        prog = homegenie
        button = KEY_1
        repeat = 3
        config = KEY_1
end

Step 4
Restart LIRC:
  pi@raspberrypi~$  sudo /etc/init.d/lirc restart
Step 5
Enable lirc in HomeGenie by going to Configure->System and Interfaces and enable "LIRC Infrared Remotes"
Next add the remotes you would like to use.
Step 6
Once configured you may need to restart HomeGenie by Configure->Maintenance and Updates and selecting ?Service Restart?.
   HomeGenie will now be able to receive events from your IR remote and send events to our IR device (tv,amp,hvac ect). The easiest way to test this is to press a button on one of the remotes you have just added. If everything is working you should get an event popup box in the top right hand corner of HomeGenie.

Note that the IR control feature is currently available only for Linux and other standard LIRC capable systems. It is currently not supported in Windows.

Hope this helps
 


August 19, 2014, 07:08:53 PM
Reply #2

jjr

  • *
  • Information
  • Newbie
  • Posts: 15
Hi i just came across the same problem when i connected a new wifi dongle into my new rpi b+. It must be some sort of emi which i need to investigate further. Try using a shield between your ir receiver and your wifi dongle, or just use lan. Which is what im doing for now. This is what lirc say about it:

Checking module based receivers
NOTE: This section only applies if your device requires a lirc_[driver] kernel module.
Before you start using lirc, you should check if your receiver is working, and if there is IR interference. Possible sources of interference include monitors/televisions (especially plasma displays), fluorescent lamps and direct or ambient sunlight. Start the following command to display raw receiver input.
# mode2 -d /dev/lirc0
If you press buttons on any IR remote, you should see a series of pulses and spaces. If there is very frequent output without pressing buttons on your remote, your receiver suffers from interference. You want to avoid such interference, e.g. by placing the receiver behind or under your plasma tv.
If you can't make out where the interference is coming from, you can try to put a cardboard roll right in front of the receiving diode, so that it only gets light from a specific direction. Invoke mode2 as above. Then point at different locations till you receive IR noise.

Here's is another good article on disturbance
http://www.vishay.com/docs/80072/disturan.pdf

Let me know how you get on