GiPio Wrong Input - Raspberry Pi Forums


hi all, new raspberry , python... have 2 wires coming out radio , put them inside gipio.
code written used trigger on web when radio gets input.
works wrong inputs on gpio (no radio signal process triggers itself). put "metal" on cable avoid interferences , 1mf capacitor parallel between wires. code :

code: select all

import time import httplib2 import rpi.gpio gpio  channel = 17  #imposto pin per la ricezione gpio.setmode(gpio.bcm) gpio.setup(channel, gpio.in, pull_up_down=gpio.pud_up)  #creo l'oggetto http h = httplib2.http(".cache")  def event_selettiva(channel):     resp, content = h.request("mywebsite", "get")  gpio.add_event_detect(channel, gpio.falling, callback=event_selettiva, bouncetime=4000)  while true:     time.sleep(0.1)      gpio.cleanup() 


don't know how solve... hope guys can me !
thank you

is 'old' radio?

have done vintage radio build (http://www.stuffaboutcode.com/2015/05/r ... build.html) , getting false triggers on edge detection due old switches, in end used analogue digital test if switch on.

there couple of other things try:

- introduce small delay in callback function , check see if value still low before updating website, may rid of false triggers
- instead of using edge detection, might getting tripped unnecessarily, continually read values gpio pin , use threshold have see @ least 5 low readings in row trigger update.

mart


raspberrypi



Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support