dead_prez
Posts: 6
Joined: Tue Dec 16, 2014 10:49 pm

LIRC in Raspbian Jessie

Tue Dec 16, 2014 10:59 pm

I'm using the GPIO pins to connect an IR receiver and an IR transmitter. I managed to get it fully working on Raspbian Wheezy. Based on the tutorial http://alexba.in/blog/2013/01/06/settin ... spberrypi/ after that I had to enter the command

Code: Select all

modprobe lirc_rpi softcarrier=0
to get a device under /dev/lirc0.

But I also wanted to use Docker which is not available for Wheezy so I switched to Jessie. However I'm having some issues there. If I use the

Code: Select all

modprobe lirc_rpi softcarrier=0
command than I get the response that the module is not available. So now I have the issue that I don't have /dev/lirc0 or a IR device under /dev/input. I had the same issue with Wheezy, but there I could use the command to get a device.

Is this module removed from the kernel? What would be the best solution to get my IR working again? Should I add the module to the kernel, or is there a better solution?

I've searched quite a bit for solutions, but couldn't get any working. Which might be due to the fact that I'm quite new to Lirc, kernel modules etc.

plugwash
Forum Moderator
Forum Moderator
Posts: 3552
Joined: Wed Dec 28, 2011 11:45 pm

Re: LIRC in Raspbian Jessie

Wed Dec 17, 2014 3:04 am

What kernels are you using?

dead_prez
Posts: 6
Joined: Tue Dec 16, 2014 10:49 pm

Re: LIRC in Raspbian Jessie

Wed Dec 17, 2014 7:09 am

Unfortunately I cannot access the Raspberry at the moment, I will check it this evening. But I did a netinstall (https://github.com/debian-pi/raspbian-ua-netinst) yesterday. So I assume the kernel is the latest version.

User avatar
DougieLawson
Posts: 37782
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: LIRC in Raspbian Jessie

Wed Dec 17, 2014 9:49 am

dead_prez wrote:Unfortunately I cannot access the Raspberry at the moment, I will check it this evening. But I did a netinstall (https://github.com/debian-pi/raspbian-ua-netinst) yesterday. So I assume the kernel is the latest version.
It won't be the very latest. Last time I installed ua-netinst it brought a custom built kernel with it. The first thing I did was sudo rpi-update to get the Foundation's leading edge development kernel.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

diederik
Posts: 393
Joined: Wed Mar 26, 2014 11:17 pm

Re: LIRC in Raspbian Jessie

Wed Dec 17, 2014 6:28 pm

dead_prez wrote:But I did a netinstall (https://github.com/debian-pi/raspbian-ua-netinst) yesterday. So I assume the kernel is the latest version.
It is the latest raspbian(.org) kernel, which is not the same as the kernel from the Raspberry Pi foundation.
Hence plugwash's question is quite relevant.

dead_prez
Posts: 6
Joined: Tue Dec 16, 2014 10:49 pm

Re: LIRC in Raspbian Jessie

Wed Dec 17, 2014 7:34 pm

plugwash wrote:What kernels are you using?
In Jessie I'm using the versions below which are not working. Do you also need the versions that work on Wheezy? I don't have it available at the moment, I would need to install Wheezy again on a SD card.

The kernel:
[email protected]:/dev# uname -r
3.12-1-rpi

The Lircd version:
[email protected]:/dev# lircd -version
lircd 0.9.0-pre1

The error I get:
[email protected]:/dev# modprobe lirc_rpi softcarrier=0
modprobe: FATAL: Module lirc_rpi not found.

Ok I just tried rpi-update and now I have the following kernel:
[email protected]:~# uname -r
3.12.34+

With that I can execute 'modprobe lirc_rpi softcarrier=0' and I have /dev/lirc0 again. The receiver is now working again, I still have to test the transmitter.

For my understanding, was my kernel for Jessie somehow older (and without the lirc_rpi module) than the one I was using for Wheezy? Or what went wrong according to you? Anyway thanks all for the quick help.

diederik
Posts: 393
Joined: Wed Mar 26, 2014 11:17 pm

Re: LIRC in Raspbian Jessie

Wed Dec 17, 2014 7:58 pm

You used the foundation kernel when you were on wheezy, which (apparently) has that module enabled, while the raspbian(.org) kernel (apparently) doesn't. By doing rpi-update you installed a foundation kernel and that made it work.
So for LIRC to work with the raspbian(.org) kernel, the kernel configuration needs to be changed.
So it's not about being older but a different configuration of the kernel.

plugwash
Forum Moderator
Forum Moderator
Posts: 3552
Joined: Wed Dec 28, 2011 11:45 pm

Re: LIRC in Raspbian Jessie

Thu Dec 18, 2014 8:08 am

If someone tells me what the config setting needed is i'll get it enabled in the raspbian kernels.

diederik
Posts: 393
Joined: Wed Mar 26, 2014 11:17 pm

Re: LIRC in Raspbian Jessie

Thu Dec 18, 2014 1:10 pm

I'm not sure whether it's the same or even related, but I've created a Raspbian bug about 1-wire support in the raspbian kernel, including the diff to the rpf kernel: https://bugs.launchpad.net/raspbian/+bug/1403865
That bug also references an issue wrt GPIO Hardware not working "out of the box" with the raspbian kernel, used by raspbian-ua-netinst.
It would be great if we could figure out what (else) is needed/useful to have enabled in the raspbian kernel for stuff relevant to the Raspberry Pi :)

dead_prez
Posts: 6
Joined: Tue Dec 16, 2014 10:49 pm

Re: LIRC in Raspbian Jessie

Thu Dec 18, 2014 1:39 pm

The configuration for lirc_rpi was made by ar0n who was also active on this forum. I found this one http://aron.ws/projects/lirc_rpi/ but I don't know if that's the same settings as in the kernel.

diederik
Posts: 393
Joined: Wed Mar 26, 2014 11:17 pm

Re: LIRC in Raspbian Jessie

Thu Dec 18, 2014 3:44 pm

I've created a couple of Gists of the various kernel configurations:
3.12-1-rpi raspbian(.org) kernel config
3.12.28+ #709 Raspberry Pi kernel config of 2014-09-09-wheezy-raspbian.zip
3.12.34+ #727 Raspberry Pi kernel config after running rpi-update on 2014-12-18

diederik
Posts: 393
Joined: Wed Mar 26, 2014 11:17 pm

Re: LIRC in Raspbian Jessie

Fri Dec 19, 2014 12:22 am

I think that the relevant difference between the kernel config between raspbian and rpf is the following:

Code: Select all

CONFIG_STAGING_MEDIA=y
CONFIG_LIRC_STAGING=y
CONFIG_LIRC_IGORPLUGUSB=m
CONFIG_LIRC_IMON=m
CONFIG_LIRC_RPI=m
CONFIG_LIRC_SASEM=m
CONFIG_LIRC_SERIAL=m
CONFIG_LIRC_SERIAL_TRANSMITTER=y
# CONFIG_LIRC_SIR is not set
# CONFIG_LIRC_ZILOG is not set
As far as I can tell, the patch is already part of the raspbian kernel source and with the above change in the kernel config, I think all the changes mentioned in http://aron.ws/projects/lirc_rpi/ are accounted for.

I don't know whether that also means it will work since, as I mentioned earlier, there are also differences wrt GPIO.
As I have no hardware to test it (and I may be a bit over my head with this), I would much appreciate it if others can chime in with this and/or test the changes.

EDIT:
Just compared the patch source code and the corresponding code in the raspbian kernel source and it's essentially the same.
The main difference is '0' and '1' replaced with a variable (invert), the list of valid GPIO pins, lower latency and a different implementation of the send_pulse_softcarrier function.

dead_prez
Posts: 6
Joined: Tue Dec 16, 2014 10:49 pm

Re: LIRC in Raspbian Jessie

Fri Dec 19, 2014 10:37 pm

Ok, so if the changes are already in the kernel than the lirc_rpi patch should not be necessary any longer? So the command modprobe lirc_rpi softcarrier=0 is not needed anymore? But if I didn't use the command, I didn't get a /dev/lirc0 device. Is there another way to get the device working under /dev?

diederik
Posts: 393
Joined: Wed Mar 26, 2014 11:17 pm

Re: LIRC in Raspbian Jessie

Fri Dec 19, 2014 10:42 pm

The source code itself is present in the kernel source. But when you don't enable it in the kernel configuration, it doesn't get compiled in or is not available as a module (which you can then modprobe to get it loaded).
But if the kernel configuration is changed as I described above, then you can load the kernel module and then /dev/lirc0 should be created.

dead_prez
Posts: 6
Joined: Tue Dec 16, 2014 10:49 pm

Re: LIRC in Raspbian Jessie

Sat Dec 20, 2014 12:09 am

And for loading the kernel module I would still have to use modprobe lirc_rpi softcarrier=0? Or another command?

diederik
Posts: 393
Joined: Wed Mar 26, 2014 11:17 pm

Re: LIRC in Raspbian Jessie

Sat Dec 20, 2014 12:15 am

Yes, you'd have to use the modprobe command.

diederik
Posts: 393
Joined: Wed Mar 26, 2014 11:17 pm

Re: LIRC in Raspbian Jessie

Mon Jan 12, 2015 12:37 am

There's a new raspbian(.org) kernel (version 3.12.9-1+rpi3) in which this should now be enabled.
Any feedback on this, would be much appreciated: https://bugs.launchpad.net/raspbian/+bug/1403865

beagile
Posts: 9
Joined: Tue Mar 03, 2015 9:24 pm

Re: LIRC in Raspbian Jessie

Tue Mar 03, 2015 10:22 pm

Hi dead_prez,

while I cannot help you with LIRC I just wanted to share that there is an easy option to get up and running with Docker on Raspbian.

We just released a new version of our Get-Docker-Up-And-Running-On-Your-Pi-In-No-Time SD card image.
It is based on Raspbian and includes a 3.18.8 kernel and the latest Docker 1.5.0 version.

You can find our image and information about how to use it here: http://blog.hypriot.com/heavily-armed-a ... -1-dot-5-0

Govinda
http://blog.hypriot.com

sirk98
Posts: 1
Joined: Mon Aug 28, 2017 2:17 pm

Re: LIRC in Raspbian Jessie

Mon Aug 28, 2017 2:31 pm

Hello,

I reopen this thread because I have some trouble using the latest raspbian jessie and lirc package.
I follow this guide

Code: Select all

https://www.hackster.io/austin-stanton/creating-a-raspberry-pi-universal-remote-with-lirc-2fd581
and I have build a simple receiving circuit without problem, but I can't use the irrecord function to store a new control configuration .

When I try to send command with control in the mode2 -d /dev/lirc0 I see that raspberry receive the commands through circuit and GPIO in PIN .

Code: Select all

sudo /etc/init.d/lirc stop
mode2 -d /dev/lirc0

pulse 83
space 402351
pulse 135
space 7085
But when I try to store a new configuration lirc seems to be not connected at receiving circuit and close the shell with this message :

Code: Select all

irrecord: no data for 10 secs, aborting
irrecord: gap not found, can't continue
I try with a fresh img, to update rpi via shell using also rpi-update, but with no luck .

Code: Select all

[email protected]:~ $ uname -r
4.9.45+
Can some one help me to repair this project ?

Best regards

SteveMann
Posts: 76
Joined: Sat Dec 08, 2012 10:39 pm

Re: LIRC in Raspbian Jessie

Tue Nov 07, 2017 6:49 pm

I am having the same problem. Have you found a solution?

sirk98 wrote:
Mon Aug 28, 2017 2:31 pm
Hello,

I reopen this thread because I have some trouble using the latest raspbian jessie and lirc package.
I follow this guide
SteveMann
Still a Novice after four years...

Return to “Raspbian”