So I am trying to figure out the best way of reporting all GPIO pin interrupts. My plan is to capture the high and low interrupts and post that to a URL.

I haven't found many resources except for this http://raspi.tv/2013/how-to-use-interrupts-with-python-on-the-raspberry-pi-and-rpi-gpio-part-2

Is Python the best way? Also is there an easy way to report all pin interrupts for a pi?

I am new to linux and python, but I am picking things up quickly, I'm currently polling a Pi using the rest service WebPiIO, but would rather have the event driven from the pi itself back to a URL that I can work with from there.

Thanks in advance for any assistance.

1 Answer 1


It depends on how serious you are and the character of the interrupts.

Given that this is tagged with home automation I guess you don't have challenging requirements.

Python will never be the best way to monitor interrupts while it is a interpreted language. The interpreter will impose a limit of the order of 10,000 interrupts per second if you are running on the Pi.

Using C and Linux interrupts on the Pi you will probably be able to get around 25,000 interrupts per second before they start to be missed.

The "best" way is likely to be my pigpio library. Depending on the nature of the interrupts it'll handle 100k-500k per second and still leave time to do some processing. It also has a built-in socket interface so it can be used over the network. See piscope, a digital waveform viewer, for an example of monitoring Pi gpios remotely.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.