fs007
Posts: 14
Joined: Mon Aug 18, 2014 6:34 am

Bug in RPIO.PWM ?

Wed Sep 10, 2014 7:48 pm

the following code does not work as exspected:

Code: Select all

#!/usr/bin/python
import subprocess
import time
import RPIO
from RPIO import PWM

PWM.setup()
# .. doing some PWM commands ....
PWM.cleanup()

subprocess.call("ls")
time.sleep(3)
print("abcd")
The script crashes (returns to the shell) without any error message after "ls" is executed (NOT showing "abcd").
If i comment out the lines with PWM... , the script works as expected, showing "abcd" (=running to the end).
I need both PWM and script shall continue to run after subprocess call . How can i make this work ?
Last edited by fs007 on Thu Sep 11, 2014 7:38 am, edited 1 time in total.

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Bug in RPIO.PWM ?

Thu Sep 11, 2014 6:21 am

Why is

Code: Select all

PWM.cleanup()
where you have put it?
Should it not be at the end of the script?
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

fs007
Posts: 14
Joined: Mon Aug 18, 2014 6:34 am

Re: Bug in RPIO.PWM ?

Thu Sep 11, 2014 7:38 am

PWM.cleanup() should be at the end of PWM operations, so it need not be at the end of the script.
But even if you put it there, the problem of script aborting after doing a subprocess call persists. Just try the sample code.

User avatar
joan
Posts: 15094
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Bug in RPIO.PWM ?

Thu Sep 11, 2014 7:47 am

If I remember rightly it is a bug in RPIO. If I'm right it's something to do with the SIGCHLD signal not been handled.

My pigpio Python module offers similar functionality.

Return to “Python”