问题描述
我正在尝试构建空调控制系统,这将使我能够控制使用Web应用程序的交流电.到目前为止,我已经使用Arduino做过同样的事情,并且它适用于这种特定的空调.我可以发送和接收信号,所以我认为硬件没有任何问题.到目前为止,irsend并没有给我任何错误,但是没有发送信号,尽管我使用python尝试了一些LED测试代码,但仍然有效.这是/etc/modules:
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
这是/etc/lirc/hardware.conf:
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=""
########################################################
和/boot/config.txt:
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
任何人都可以知道为什么不发送信号吗?连接似乎是正确的,22 gpio,但是对于使用15的python代码检查其是否正常工作:
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.我尝试将22更改为15,但没有解决. :(
P.S. I tried to change 22 to 15, didn't work out. :(
推荐答案
发现错误,Raspberry Pi无法读取我的/etc/modules,因此当我将相同的数据保存在/etc/modules-load.d/lirc_rpi中时. conf,它起作用了:
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
这篇关于irsend没有给出错误,但是没有在Raspbian上发送信号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!