When I try using RPIO PWM and os.system in the same script, the os.system part runs correctly, but the script basically shuts down after.
If I rem out the servo commands the os.system runs correctly and the script completes
I've tried various ways of running commands within Python but seem to get the same result. Have tried a fresh install of raspbian, also tried a model B.
Any thoughts?
Code: Select all
#!/usr/bin/env python
import time
import os
import ftplib
from RPIO import PWM
servo = PWM.Servo()
intPan = 600
intTilt = 1300
strPicName = "webcam"
strTempFilename = "/home/pi/" + strPicName + "Temp.jpg"
strFilename = "/home/pi/" + strPicName + ".jpg"
#print("############################## Pan and Tilt")
#servo.set_servo(23, intTilt)
#servo.set_servo(24, intPan)
time.sleep( 2 )
print("############################## Taking Photo")
os.system("fswebcam -d /dev/video0 -r 384x288 " + strFilename)
print("Finished")
print("############################## resetting")
servo.stop_servo(23)
servo.stop_servo(24)Code: Select all
--- Processing captured image...
Writing JPEG image to '/home/pi/webcam.jpg'.
shutting down dma channel 0
clear_channel: channel=0
Code: Select all
--- Processing captured image...
Writing JPEG image to '/home/pi/webcam.jpg'.
Finished
############################## resetting