2016-12-22 28 views
0

我想建立空調控制系統,這將允許我控制ac的使用web應用程序。 到目前爲止,我已經做了與Arduino同樣的事情,它爲這個特定的空調工作。我可以發送和接收信號,所以我不認爲硬件有任何問題。 到目前爲止irsend不給我任何錯誤,但信號不發送,雖然我嘗試了一些使用Python的LED測試代碼,它的工作。 這裏是在/ etc /模塊:irsend不給錯誤,但不發送信號Raspbian

# /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:

######################################################## 
    # /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:

# 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,但對於Python代碼使用15檢查其工作:

#!/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() 

附:我試圖改變22日至15日,沒有工作。 :(

回答

0

發現錯誤,樹莓派不讀我的/ etc /模塊,所以當我保存在/etc/modules-load.d/lirc_rpi.conf相同的數據,它的工作:

lirc_dev 
lirc_rpi gpio_in_pin=22 gpio_out_pin=23 

i2c-dev