4

I'm trying to build a TV remote control using Raspberry Pi, and I get the following error when I try to send a command:

pi@raspberrypi:~$ irsend SEND_ONCE Samsung_BN59-00937A KEY_POWER

irsend: command failed: SEND_ONCE Samsung_BN59-00937A KEY_POWER    
irsend: hardware does not support sending

I've built an IR circuit, which works fine when I test it using a simple blinking script:

#!/usr/bin/python
import RPi.GPIO as GPIO
import time
print "Starting blink test.."
GPIO.setwarnings(True)
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)
while True:
    GPIO.output(17, True)
    time.sleep(1)
    GPIO.output(17, False)
    time.sleep(1)

When I run this I can see the IR LED blinking using a camera LCD viewfinder. The circuit is wired according to this tutorial.

I set up LIRC following this tutorial.

My /etc/modules has these two lines in it:

lirc_dev
lirc_rpi gpio_in_pin=18 gpio_out_pin=17

My /boot/config.txt has this line in it:

dtoverlay=lirc-rpi,gpio_in_pin=18,gpio_out_pin=17

My /etc/lirc/hardware.conf looks like this:

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

My /etc/rc.local has this line in it:

modprobe lirc_rpi gpio_in_pin=18 gpio_out_pins=17

I also tried following the suggested answer from this question and added the file

/etc/modprobe.d/ir-remote.conf

with this line in it:

options lirc_rpi gpio_in_pin=18 gpio_out_pin=17

But I still get the same error with irsend. Please could somebody help me fix this? Thank you.

EDIT: This is the output of lsmod when I remove the lirc lines from /etc/modules, /etc/rc.local, and /etc/modprobe.d/ir-remote.conf:

pi@raspberrypi:~$ lsmod
Module                  Size  Used by
bnep                   10340  2 
hci_uart               17943  1 
btbcm                   5929  1 hci_uart
bluetooth             326105  22 bnep,btbcm,hci_uart
brcmfmac              186403  0 
brcmutil                5661  1 brcmfmac
cfg80211              427855  1 brcmfmac
rfkill                 16037  4 cfg80211,bluetooth
snd_bcm2835            20447  1 
snd_pcm                75762  1 snd_bcm2835
snd_timer              19288  1 snd_pcm
snd                    51908  5 snd_bcm2835,snd_timer,snd_pcm
bcm2835_gpiomem         3040  0 
bcm2835_wdt             3225  0 
lirc_rpi                6478  0 
uio_pdrv_genirq         3164  0 
uio                     8000  1 uio_pdrv_genirq
lirc_dev                8310  1 lirc_rpi
rc_core                16468  1 lirc_dev
i2c_dev                 5859  0 
fuse                   84037  3 
ipv6                  347594  46 
7
  • 1
    You should be using device tree so delete the lirc lines from /etc/modules, /etc/rc.local, and /etc/modprobe.d/ir-remote.conf. Then reboot and add the output of lsmod to your question.
    – joan
    Commented Dec 4, 2016 at 14:48
  • Thanks for replying, I removed the lines from the three files and added the output of lsmod. Commented Dec 4, 2016 at 16:13
  • Okay. I added the device tree entry, installed lirc, used your hardware.conf and downloaded a Samsung config file from LIRC home. It works for me. Sorry. Don't know what's wrong with your set up.
    – joan
    Commented Dec 4, 2016 at 18:12
  • Please could you explain how you added the device tree entry? I'm relatively new to this, and I could have done something wrong. Commented Dec 4, 2016 at 18:20
  • 1
    I just mean I added the line dtoverlay=lirc-rpi,gpio_in_pin=18,gpio_out_pin=17 to /boot/config.txt and rebooted.
    – joan
    Commented Dec 4, 2016 at 18:21

3 Answers 3

2

Verify that the service is starting correctly via

sudo /etc/init.d/lirc status

A common cause is a bad lircd.conf file.

1

I wrote some initial tricks in http://martinho.comuf.com.

But be attention on "UNCONFIGURED" lines in config files.

As I wrote there You have to remove all lines with word "UNCONFIGURED" in /etc/init.d/lirc

I don´t know why but a script look for that word even as comment.

Make backup of files before edit and dont´t forget to reboot after changes.

---I´m using a Raspberry PI3---

1
  • It would be nice to mention the page you link to isn't in English.
    – Phil
    Commented Nov 15, 2017 at 7:00
1

Check out this forum post: https://www.raspberrypi.org/forums/viewtopic.php?t=191425#p1213186

It mentions version 0.9.4 of lircd has a new config file format which is incompatible with the old, and that there is an included script (/usr/share/lirc/lirc-old2new) you can run which fixes it all up.

Solved my problem.

1
  • This solution is actualy working with Raspberry 3 B+ and LIRC 0.9.4 ! Commented Aug 15, 2018 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.