问题
I am trying to build the air conditioner control system, which will allow me to control the ac's using web app. So far I have done same thing with Arduino and it worked for this particular air conditioner. I could send and receive signal so I don't think there is any problems with hardware. So far irsend is not giving me any errors, but signal is not sent, although I tried some LED testing codes using python and it worked. Here is the /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.
lirc_dev
lirc_rpi gpio_out_pin=22
Here is the /etc/lirc/hardware.conf:
########################################################
# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
#
LIRCD_ARGS=""
#
# 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
#changed for true
LIRCD_CONF="/etc/lirc/lircd.conf"
LIRCMD_CONF=""
########################################################
And /boot/config.txt:
# For more options and information see
# http://www.raspberrypi.org/documentation/configuration/config-txt.md
# Some settings may impact device functionality. See link above for details
# Uncomment this to enable the lirc-rpi module
dtoverlay=lirc-rpi, gpio_out_pin=22
# Additional overlays and parameters are documented /boot/overlays/README
# Enable audio (loads snd_bcm2835)
dtparam=audio=on
Can anyone have any idea as in why is signal is not sent? The connection seems to be correct, 22 gpio, but for python code used 15 to check if its working:
#!/usr/bin/python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(15, GPIO.OUT)
for i in range(0,10):
GPIO.output(15,True)
time.sleep(0.5)
GPIO.output(15,False)
time.sleep(0.5)
print "Done"
GPIO.cleanup()
P.S. I tried to change 22 to 15, didn't work out. :(
回答1:
Found the error, Raspberry Pi was not reading my /etc/modules so when I saved the same data in /etc/modules-load.d/lirc_rpi.conf, it worked:
lirc_dev
lirc_rpi gpio_in_pin=22 gpio_out_pin=23
i2c-dev
来源:https://stackoverflow.com/questions/41280694/irsend-is-not-giving-errors-but-does-not-send-signal-on-raspbian