Go to advanced search

by metachris
Sat Mar 09, 2013 7:06 pm
Forum: Python
Topic: RPIO: An extension of RPi.GPIO with interrupts, PWM and more
Replies: 84
Views: 19973

Re: RPIO: An extension of RPi.GPIO with interrupt management

Does it work with Python 2? How exactly did you install RPIO? I think you may have installed the python2 module. In this case you'd need to install it for Python 3.
by metachris
Sat Mar 09, 2013 11:30 am
Forum: Python
Topic: RPIO: An extension of RPi.GPIO with interrupts, PWM and more
Replies: 84
Views: 19973

Re: RPIO: An extension of RPi.GPIO with interrupt management

No problem, and good luck with your endeavors! Be sure to get a good grasp on Python fundamentals. Go through some tutorials and read the Python docs, they're quite well organized. I can recommend this link to start off with: http://docs.python.org/2/tutorial/introduction.html Small tip at the end: ...
by metachris
Fri Mar 08, 2013 4:15 pm
Forum: Python
Topic: RPIO: An extension of RPi.GPIO with interrupts, PWM and more
Replies: 84
Views: 19973

Re: RPIO: An extension of RPi.GPIO with interrupt management

Here is an example code how to do something all 20 seconds: import time from threading import Thread import RPIO ... timeout_in_seconds = 20 def my_background_task(): while True: time.sleep(timeout_in_seconds) # your stuff goes here Thread(target=my_background_task).start() RPIO.wait_for_interrupts(...
by metachris
Fri Mar 08, 2013 4:00 pm
Forum: Python
Topic: RPIO: An extension of RPi.GPIO with interrupts, PWM and more
Replies: 84
Views: 19973

Re: RPIO: An extension of RPi.GPIO with interrupt management

There is a different way of doing interrupts without needing to know about threads yourself using RPi.GPIO. Details are here: http://code.google.com/p/raspberry-gpio-python/wiki/Inputs Ben, you've plugged your project already twice today in this thread :P Would be nice of you to at least put a litt...
by metachris
Fri Mar 08, 2013 3:51 pm
Forum: Python
Topic: RPIO: An extension of RPi.GPIO with interrupts, PWM and more
Replies: 84
Views: 19973

Re: RPIO: An extension of RPi.GPIO with interrupt management

Why would you stop waiting for interrupts to do other stuff (eg. the housekeeping you mentioned)? If you don't _always_ listen for interrupts, you might miss one! You talked about intruder alarm, fire alarm, etc... if you don't always listen, you might miss the interrupt while you do your "housekeep...
by metachris
Fri Mar 08, 2013 2:32 pm
Forum: Arch
Topic: Daily, Monthly, Weekly, etc cron jobs don't run
Replies: 25
Views: 9505

Re: Daily, Monthly, Weekly, etc cron jobs don't run

You could post the output of the command "crontab -l" to get further assistance.
by metachris
Fri Mar 08, 2013 2:24 pm
Forum: Python
Topic: RPIO: An extension of RPi.GPIO with interrupts, PWM and more
Replies: 84
Views: 19973

Re: RPIO: An extension of RPi.GPIO with interrupt management

If you want to do something at the same time as waiting for interrupts, you'll need to use a thread. You can also call RPIO.stop_waiting_for_interrupts() from a callback. You should probably only use `stop_waiting_for_interrupts()` when shutting down your program.
by metachris
Fri Mar 08, 2013 1:36 pm
Forum: Python
Topic: RPIO: An extension of RPi.GPIO with interrupts, PWM and more
Replies: 84
Views: 19973

Re: RPIO: An extension of RPi.GPIO with interrupt management

Okay now I understand. The solution is this: wait_for_interrupts() does not quit after the timeout, but runs indefinitely (until stop_waiting_for_interrupts()) is called. The timeout is just there to allow your app to quit the wait_for_interrupts() loop with the stop_waiting_for_interrupts() method.
by metachris
Fri Mar 08, 2013 12:53 pm
Forum: Python
Topic: RPIO: An extension of RPi.GPIO with interrupts, PWM and more
Replies: 84
Views: 19973

Re: RPIO: An extension of RPi.GPIO with interrupt management

Thank you for your help and guidance. Since most of my interrupts occur very rarely - at least I hope so: smoke detectors, intruder alarms - I need to do the following: first a call to stop_waiting_for_interrupts(), then wait_for_interrupts(epoll_timeout=60). Is that correct ? Because other way rou...
by metachris
Fri Mar 08, 2013 12:10 pm
Forum: Python
Topic: RPIO: An extension of RPi.GPIO with interrupts, PWM and more
Replies: 84
Views: 19973

Re: RPIO: An extension of RPi.GPIO with interrupt management

Hey, i am quite a newbie to python and have a question for understanding. Currently iam using big while, if, elif loops with sleep. This is getting very unhandable, because I try to use a gamepad for steering 2 motors. With my method I have delay times when pressing a button or moving a stick. Is y...
by metachris
Fri Mar 08, 2013 12:08 pm
Forum: Python
Topic: RPIO: An extension of RPi.GPIO with interrupts, PWM and more
Replies: 84
Views: 19973

Re: RPIO: An extension of RPi.GPIO with interrupt management

Sorry Chris, another probably silly question: I have setup waitforinterrupt with an epoll_timeout=60, since I want to regain control at least every minute in case nothing else happens. My problem is that the program is stuck in the waitforinterrupt routine. I have included a print statement right a...
by metachris
Thu Mar 07, 2013 5:57 pm
Forum: Python
Topic: RPIO: An extension of RPi.GPIO with interrupts, PWM and more
Replies: 84
Views: 19973

Re: RPIO: An extension of RPi.GPIO with interrupt management

To directly access the GPIOs, the process needs superuser privileges, there is no way around. But there are other ways than just sudo, most notably the SUID bit (http://en.wikipedia.org/wiki/Setuid).
by metachris
Wed Mar 06, 2013 9:40 am
Forum: Python
Topic: Advice: Python IRC Bot
Replies: 5
Views: 1733

Re: Advice: Python IRC Bot

Plugins should register handlers for specific triggers. Then the main app can easily start them when a specific event occurs. There is a lot of stuff on stackoverflow and google; search for "python plugins".
by metachris
Sun Mar 03, 2013 11:04 pm
Forum: Python
Topic: RPIO: An extension of RPi.GPIO with interrupts, PWM and more
Replies: 84
Views: 19973

Re: RPIO: An extension of RPi.GPIO with interrupt management

socket.close() is all you need to do; no further cleanup necessary.
by metachris
Fri Mar 01, 2013 8:17 pm
Forum: General discussion
Topic: New: `rpio-curses` , a GPIO user interface for the terminal
Replies: 13
Views: 4518

Re: New: `rpio-curses` , a GPIO user interface for the termi

Awesome! I'll add a check to rpio-curses for the next release.
by metachris
Fri Mar 01, 2013 7:56 pm
Forum: General discussion
Topic: New: `rpio-curses` , a GPIO user interface for the terminal
Replies: 13
Views: 4518

Re: New: `rpio-curses` , a GPIO user interface for the termi

Thanks for posting. This error might occur if the terminal is too small to draw everything on it... are you using a really small screen by any chance? Trying to find a way to reproduce...
by metachris
Fri Mar 01, 2013 5:32 pm
Forum: Python
Topic: Magpi Python tutorials
Replies: 21
Views: 2461

Re: Magpi Python tutorials

Edit: The code looks fine, if you use a hardware pull-up or -down resistor. Could you upload a drawing of your exact circuit? Probably 0 is your default state, so you could try to change if mybutton == False: to if mybutton == True: Do you have a pull-up or -down resistor in your wiring? Shameless p...
by metachris
Fri Mar 01, 2013 5:21 pm
Forum: Python
Topic: Magpi Python tutorials
Replies: 21
Views: 2461

Re: Magpi Python tutorials

silverfox0786 wrote:i did the set mode thing as an altrernate option
How did you set this? Can you post the full source code to http://gist.github.com?

RPi.GPIO has only two modes you can set: GPIO.BCM and GPIO.BOARD
by metachris
Fri Mar 01, 2013 4:23 pm
Forum: General discussion
Topic: New: `rpio-curses` , a GPIO user interface for the terminal
Replies: 13
Views: 4518

New: `rpio-curses` , a GPIO user interface for the terminal

Hey everyone! "rpio-curses" is a graphical user interface for the terminal to inspect and manipulate GPIOs, which I've just released as part of RPIO v0.8.4 . With rpio-curses you can see all GPIOs on the board with function and state, and change every possible parameter. The list is updated every se...
by metachris
Fri Mar 01, 2013 3:46 pm
Forum: Python
Topic: RPIO: An extension of RPi.GPIO with interrupts, PWM and more
Replies: 84
Views: 19973

Re: RPIO: An extension of RPi.GPIO with interrupt management

Alright, I've just released RPIO v0.8.4, which includes the following: "rpio-curses", a curses based GPIO inspection and manipulation tool Bugfix for "rpio --sysinfo" Bugfix for tcp callback parameter After installing/updating RPIO, the command "rpio-curses" is available on your system. Here are a f...
by metachris
Fri Mar 01, 2013 3:38 pm
Forum: Python
Topic: Magpi Python tutorials
Replies: 21
Views: 2461

Re: Magpi Python tutorials

The error message has a pretty good description of the problem: you need to call "GPIO.setmode(<your-mode>)", where <your-mode> is either RPIO.BCM or RPIO.BOARD.
by metachris
Fri Mar 01, 2013 1:19 pm
Forum: Python
Topic: RPIO: An extension of RPi.GPIO with interrupts, PWM and more
Replies: 84
Views: 19973

Re: RPIO: An extension of RPi.GPIO with interrupt management

- when I run several programs in parallel which are using the same GPIO-pins: do I need to make similar RPIO.setup() calls in every program or is a setup of global (for all programs under the same user id) nature ? - from an external source, I receive TCP-packets. At some time I know, that there wi...
by metachris
Fri Mar 01, 2013 1:17 pm
Forum: Python
Topic: RPIO: An extension of RPi.GPIO with interrupts, PWM and more
Replies: 84
Views: 19973

Re: RPIO: An extension of RPi.GPIO with interrupt management

print("socket %s: '%s'" % (socket.fileno(), val))
AttributeError: 'tuple' object has no attribute 'fileno'
Its an error in the programming on my side. I'll push an update in one or two hours. Sorry about that.
by metachris
Fri Mar 01, 2013 1:14 pm
Forum: Python
Topic: RPIO: An extension of RPi.GPIO with interrupts, PWM and more
Replies: 84
Views: 19973

Re: RPIO: An extension of RPi.GPIO with interrupt management

I'm working on DMA PWM right now. Its awesome -- I can produce really good pulses down to exactly 1 microsecond. With software PWM i can't seem to go below 100 microseconds. I've documented my tests with an oscilloscope on video and will post it with the RPIO update. It will be out in the next days ...
by metachris
Thu Feb 28, 2013 10:32 pm
Forum: Python
Topic: "No Module named WiringPi" error in Python
Replies: 6
Views: 9495

Re: "No Module named WiringPi" error in Python

I've been having problems installing wiringPi; kept getting build errors. Perhaps you weren't able to install it cleanly as well. Which command did you use to update it? As an alternative to wiringPi, you could use RPIO or RPi.GPIO . Both are very easy to use and can do what your example code does. ...

Go to advanced search