Go to advanced search

by yonubear
Sun Dec 01, 2013 6:41 pm
Forum: Python
Topic: run a function every x min
Replies: 21
Views: 6651

run a function every x min

I know this is a simple piece of code but I am sort of lost I need to run a function every 5min or so however I have had no luck in getting it to do what I want the biggest issue is I don't want it to sleep between runs I want it to simply run the function then return to the main code and simply do ...
by yonubear
Sun Dec 01, 2013 12:29 am
Forum: Automation, sensing and robotics
Topic: monitor 2 GPIO pins?
Replies: 0
Views: 361

monitor 2 GPIO pins?

ok I am kind of stuct I have been using the GPIO.add_event_detect to keep CPU time down until a pin is triggered but I am at a loss I need to monitor 2 pins and if both are false I need to perform an action but I can figure out how to code it if it helps I am using python.

Thanks,
Yonu
by yonubear
Tue Nov 26, 2013 1:55 am
Forum: Python
Topic: GPIO interrupts help.
Replies: 6
Views: 1944

Re: GPIO interrupts help.

well not sure if it was my problem but I took out the bouncetime parameter and it seems to have stopped so when I build the final PCB I will just but a capacitor in to debounce it.

Yonu
by yonubear
Mon Nov 25, 2013 2:56 pm
Forum: Python
Topic: GPIO interrupts help.
Replies: 6
Views: 1944

Re: GPIO interrupts help.

Quick question all is there a speed issue with the GPIO pins I was doing some testing to try and figure out what my code was falling out of sync and I noticed it i pressed the button I had wired for testing slowly it stays in sync if I press it rather quickly it falls out of sync.

Any ideas?

Yonu
by yonubear
Mon Nov 25, 2013 1:42 am
Forum: Python
Topic: GPIO interrupts help.
Replies: 6
Views: 1944

Re: GPIO interrupts help.

hey guys I need to pick a brain here I thought I had it working however I am getting a bunch of double triggers say it goes to close when the pins are shorted when they are opened about every 5th time instead of triggering open they give another closed here is the code I have in the callback I am ho...
by yonubear
Mon Nov 25, 2013 12:18 am
Forum: Python
Topic: GPIO interrupts help.
Replies: 6
Views: 1944

Re: GPIO interrupts help.

well I may have found a way to gewt what I needed I changed the add event detect to GPIO.BOTH and changed the callback to this it seems to work the way I want. just thought in case anyone later might want something similar I would post it def my_callback(channel): print "Pin 17 Door open" print "inp...
by yonubear
Sun Nov 24, 2013 11:37 pm
Forum: Python
Topic: GPIO interrupts help.
Replies: 6
Views: 1944

Re: GPIO interrupts help.

Thanks for the link however that made very little sense to me are you saying that I need to install that library just use the GPIO pins the way I had intended?

I did try GPIO.BOTH but wasn't able to figure out a way to trigger based on the state of the pin.

Thanks,
Yonu
by yonubear
Sun Nov 24, 2013 7:07 pm
Forum: Python
Topic: GPIO interrupts help.
Replies: 6
Views: 1944

GPIO interrupts help.

hi all on the suggestion of several people I have changed my coding from Lua to python so that I can use interrupts to cut down on cpu time however I need some help I know how to do interrupts for when the pin is shorted but how can I do one for when it opens back up. Example when door magnet switch...
by yonubear
Thu Nov 21, 2013 1:10 pm
Forum: Other programming languages
Topic: Lua cpu usage
Replies: 6
Views: 2395

Re: Lua cpu usage

Ok thanks would you know if there is a xpl module for Python? As I would prefer interuppts after reading about them
by yonubear
Thu Nov 21, 2013 12:29 am
Forum: Other programming languages
Topic: Lua cpu usage
Replies: 6
Views: 2395

Re: Lua cpu usage

ok actually I am running Raspbian with lua 5.1 installed and I compiled the GPIO module found here http://www.andre-simon.de/doku/rpi_gpio ... o_lua.html
the main reason I am using Lua is for the use of Xpl well that and all my other automation code for other software is in Lua
by yonubear
Wed Nov 20, 2013 9:15 pm
Forum: Other programming languages
Topic: Lua cpu usage
Replies: 6
Views: 2395

Lua cpu usage

question here for you Pi folks I have installed lua on my Pi to work with the GPIO I need to ask a stupid question I will be monitoring several reed switches so for CPU usage should I use while loops or if statements as about 80% of the time the status of the switches will not change. Sorry I know t...
by yonubear
Mon Nov 11, 2013 2:34 am
Forum: Networking and servers
Topic: xpl on pi?
Replies: 0
Views: 447

xpl on pi?

Sorry if this has came up before but I have not had much luck searching is there an xpl option for the PI I am hoping to be able to read and trigger the gpio pins using xpl.

Thanks
Yonu
by yonubear
Sun Sep 15, 2013 7:47 pm
Forum: Automation, sensing and robotics
Topic: Communicate with PI using TCP
Replies: 4
Views: 1032

Re: Communicate with PI using TCP

ok what I am trying to do is replace my old x10 sensors and modules that are no longer reliable in my guesthouse/storage building and my first thought is use a Pi and connect it to my girder setup using a TCP server so that they can talk back and fourth. when something changes.
by yonubear
Fri Sep 13, 2013 4:28 pm
Forum: Automation, sensing and robotics
Topic: Communicate with PI using TCP
Replies: 4
Views: 1032

Re: Communicate with PI using TCP

Thanks wasn't sure if something existed.
by yonubear
Thu Sep 12, 2013 11:34 pm
Forum: Automation, sensing and robotics
Topic: Communicate with PI using TCP
Replies: 4
Views: 1032

Communicate with PI using TCP

I just ordered a PI and I am trying to figure out how to code so that the pi will respond to tcp packets to that I can have it monitor several sensors for my HA system but I need to be able to get the pi to accept tcp packets from my girder setup and respond to them. I am just not sure where to star...

Go to advanced search