I have an Edison (Yocto Poky on Sparkfun blocks) with a script running to detect button presses (using the GPIO block), which becomes unresponsive after some time (trying to pin down how long, but over an hour). The python script is below, based on an example from https://github.com/intel-iot-devkit/mraa/blob/master/examples/python/hello_isr.py https github.com/intel-iot-devkit/mraa/blob/master/examples/python/hello_isr.py :
# !/usr/bin/env python
subprocess.call("echo $(date) >> button_log.txt", shell=True)
pin = mraa.Gpio(32)
pin.isr(mraa.EDGE_BOTH, press, press)
I have another bash script that detects if button.py has ended, and restarts a new instance if so. This appears to work perfectly, and I've tested the button on an instance of button.py that was created by the bash script, and that worked ok.
Any idea why this can become unresponsive?
Which version of mraa are you using? I'm going to test your script with my Edison+Arduino Expansion Board (I don't have access to a GPIO block) and see if I get the same behavior.
Hi Peter. `mraa.getVersion()` in python returns `v0.7.2`.
I think however I've found the culprit - `pin.isrExit()` seems to hang the script, which prevents the process from ending and a fresh working one from starting up. Commenting it out seems to work.