Anthony.E
Posts: 1
Joined: Sun Sep 10, 2017 3:06 am

LIRC not working on Raspbian Stretch Raspberry Pi

Sun Sep 10, 2017 3:22 am

I cant get LIRC working on Raspberry Pi with Raspbian Stretch, tried several times with fresh OS installs but no luck, I get stuck when i run:

$ sudo /etc/init.d/lirc stop

I get "command not found" but it seems to work when i run:

$ sudo /etc/init.d/lircd stop

[....] Stopping lircd (via systemctl): lircd.serviceWarning: Stopping lircd.service, but it can still be activated by:
lircd.socket
. ok

When I run mode2 I always get "Partial read 8 bytes",

$ mode2 -d /dev/lirc0

Using driver devinput on device /dev/lirc0
Trying device: /dev/lirc0
Using device: /dev/lirc0
Partial read 8 bytes on /dev/lirc0

Any help would be appreciated, I've been stuck for a few days ^^

gspatzenegger
Posts: 1
Joined: Sun Sep 10, 2017 4:16 pm

Re: LIRC not working on Raspbian Stretch Raspberry Pi

Sun Sep 10, 2017 4:19 pm

I have exactly the same issue with a TSOP IR sensor.
I reinstalled jessie, now everything works fine. Seems to be a bug in stretch.

drgeoff
Posts: 13818
Joined: Wed Jan 25, 2012 6:39 pm

Re: LIRC not working on Raspbian Stretch Raspberry Pi

Sun Sep 10, 2017 6:48 pm

Doesn't Stretch use systemd instead of the init stuff in Jessie?

https://gist.github.com/houtianze/59b89 ... 4bd86e6ee7
Quis custodiet ipsos custodes?

hoshri
Posts: 2
Joined: Mon Sep 11, 2017 6:47 am

Re: LIRC not working on Raspbian Stretch Raspberry Pi

Mon Sep 11, 2017 6:57 am

When installing LIRC on stretch you get version 0.9.4 which has different services structure and configuration. Most documentation I found don't match this version. But to shut down the services you can use:
sudo systemctl stop lircd.socket
sudo systemctl stop lircd.service

I wasn't able to make my IR receiver work with this version.
When running sudo cat /sys/kernel/debug/gpio I don't see the GPIO allocation for IR in and out.

hoshri
Posts: 2
Joined: Mon Sep 11, 2017 6:47 am

Re: LIRC not working on Raspbian Stretch Raspberry Pi

Mon Sep 11, 2017 7:23 am

The service structure and configuration was changed in LIRC 0.9.4.
Use:
sudo systemctl stop lircd.socket
sudo systemctl stop lircd.service

Unfortunately I didn't manage to make it work yet but at least you get response when using mode2.

EitanR
Posts: 1
Joined: Sun Sep 17, 2017 10:47 pm

Re: LIRC not working on Raspbian Stretch Raspberry Pi

Sun Sep 17, 2017 10:51 pm

gspatzenegger wrote:
Sun Sep 10, 2017 4:19 pm
I have exactly the same issue with a TSOP IR sensor.
I reinstalled jessie, now everything works fine. Seems to be a bug in stretch.
Where can I find the Jessie image?
I can only see jessie as ISO file.

Thanks.

User avatar
rpdom
Posts: 22792
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: LIRC not working on Raspbian Stretch Raspberry Pi

Mon Sep 18, 2017 5:31 am

EitanR wrote:
Sun Sep 17, 2017 10:51 pm
Where can I find the Jessie image?
I can only see jessie as ISO file.
https://www.raspberrypi.org/downloads/raspbian/ has the image files for the Raspberry Pi, both Lite and full Desktop version.
The ISO file is for PCs.

marcelkordek
Posts: 1
Joined: Mon Sep 18, 2017 6:48 pm

Re: LIRC not working on Raspbian Stretch Raspberry Pi

Mon Sep 18, 2017 6:58 pm

Hi,
according to the instruction located at "/usr/share/doc/lirc/README.Debian.gz":
## 0.9.4 disruptive update

The configuration is so much changed that updating from 0.9.0 requires
manual intervention. This could be done using the update scripts or as
a completely manual process. Many users will always need some manual steps.
There is script to "convert" the configuration:

Code: Select all

sudo /usr/share/lirc/lirc-old2new.sh
after that you can reboot your pi order simply restart LIRC:

Code: Select all

sudo killall lirc
systemctl start lidcd.socket lircd.service
After that LIRC is running fine for me.

Marcel

andyCapone
Posts: 1
Joined: Tue Oct 03, 2017 12:41 pm

Re: LIRC not working on Raspbian Stretch Raspberry Pi

Tue Oct 03, 2017 12:47 pm

Thank you Marcel, your solution worked for me, at least partially. After following your advice, I don't get the "partial read 8 bytes" error anymore. If I run irw to see what button I pressed however, I don't get any output. Instead, there is a warning in my syslog saying "Notice: repeat code without last_code received". Any ideas?

pbeery
Posts: 1
Joined: Tue Oct 10, 2017 5:51 am

Re: LIRC not working on Raspbian Stretch Raspberry Pi

Tue Oct 10, 2017 5:56 am

I also have stretch. I've gotten mode2 to work. But irw ignores all key presses. No error messages just no response. I tried bypassing irw with ncat -U (plus socket name) but ncat wasn't found. Looking forward to this being fixed.

midijunkie
Posts: 1
Joined: Mon Oct 16, 2017 1:55 pm

Re: LIRC not working on Raspbian Stretch Raspberry Pi

Mon Oct 16, 2017 1:57 pm

Hi,
how did you get mode2 to work? I'm still getting the Partial read 8 bytes on /dev/lirc0.
Greetings,
Philipp

edit: mode2 works! had to use my gpios right. followed http://raspberrypiguide.de/howtos/raspb ... io-how-to/ with wiringPi. but irw doesnt recognize anything :roll:

and how do I set-up another IR-transmitter? I'm totally lost there? another service?

radneran
Posts: 2
Joined: Sat Nov 04, 2017 12:59 am

Re: LIRC not working on Raspbian Stretch Raspberry Pi

Sat Nov 04, 2017 5:12 am

mode2 works but irsend always gives me

transmission failed
Error running command: Input/output error

Anyone has any idea whats wrong?

DropbearNinja
Posts: 4
Joined: Wed Nov 08, 2017 2:03 pm

Re: LIRC not working on Raspbian Stretch Raspberry Pi

Wed Nov 08, 2017 2:05 pm

Did anyone find a solution to getting LIRC working on stretch?

Best I can get is 'Partial read 8 bytes on /dev/lirc0'
cat /sys/kernel/debug/gpio doesn't show my pins :(

raf610
Posts: 2
Joined: Sat Dec 06, 2014 9:11 pm

Re: LIRC not working on Raspbian Stretch Raspberry Pi

Fri Nov 10, 2017 10:01 pm

Hi Marcel,
after
sudo killall lirc
systemctl start lidcd.socket lircd.service
my pi give me this
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Autenticazione richiesta per avviare 'lidcd.socket'.
Multiple identities can be used for authentication:
1. ,,, (pi)
2. root
Choose identity to authenticate as (1-2):

and after 1 (pi) and password

==== AUTHENTICATION FAILED ===
Failed to start lidcd.socket: Access denied
See system logs and 'systemctl status lidcd.socket' for details.
Same thing with root.
Could you help me?

derders
Posts: 25
Joined: Sun Apr 02, 2017 5:26 pm

Re: LIRC not working on Raspbian Stretch Raspberry Pi

Mon Nov 13, 2017 8:42 pm

followed this guide and it worked for me

https://gist.github.com/prasanthj/c15a5 ... 22c95378b

after sudo irrecord -d /dev/lirc0 ~/lircd.conf it placed the configured file in /home/pi/name_of_remote.lirc.conf

I had an already configured file from Jessie and after replacing /etc/lirc/lircd.conf + sudo /etc/init.d/lircd restart
it works like it should

semireg
Posts: 1
Joined: Mon Nov 20, 2017 4:55 am

Re: LIRC not working on Raspbian Stretch Raspberry Pi

Mon Nov 20, 2017 4:56 am

The name of the script is sudo /usr/share/lirc/lirc-old2new

pintoXD
Posts: 1
Joined: Thu Mar 22, 2018 6:32 pm

Re: LIRC not working on Raspbian Stretch Raspberry Pi

Thu Mar 22, 2018 6:36 pm

DropbearNinja,

Dude, checkout the below. I had the same problem than you, but with a couple of searchs in found a tutorial that help me:
http://www.instructables.com/id/Raspber ... al-Remote/

donbrew
Posts: 87
Joined: Sun Sep 04, 2016 2:32 pm

Re: LIRC not working on Raspbian Stretch Raspberry Pi

Thu Jul 19, 2018 8:17 pm

For Raspbian Stretch NOT Raspbian Jessie, Wheezy or earlier

First, with lirc 0.9.4 ignore any reference to changing the files modules and hardware. A. they don't exist and B. 0.9.4 doesn't use them.
I am not having a lot of success,
All you should need to do is:

Undo all of the fiddling you have done following outdated tutorials.
make sure dtoverlay=lirc-rpi is in /boot/config.txt and is not commented out
install Lirc and ir-keytable with apt-get

Code: Select all

sudo apt-get install lirc ir-keytable
edit /etc/lirc/lir_options.conf. driver=default, device=/dev/lirc0
either make your own Lircd.conf or get one from http://lirc-remotes.sourceforge.net/remotes-table.html
Place that lircd.conf file into /etc/lirc/lircd.conf.d
the name does not matter, any file ending in .conf will be loaded


reboot

You might need to do some fiddly stuff like rename the devinput.conf file in lircd.conf.d and edit the ~/.kodi/userdata/Lircmap.xml for Kodi.
Ignore any instructions you see about using init.d or systemd. Use systemctl instead.

You won't be wasting your time exploring /usr/share/lirc.

If you are uprading from Jessie try

Code: Select all

sudo bash /usr/share/lirc/lirc-old2new

Return to “Troubleshooting”