def test_all_cameras(numCams, width, height):
for i in range(0, numCams):
print(" cam %d : " % i, end="")
p = subprocess.Popen(
["sudo", "./snapshot", "/dev/null", "--dev", ("/dev/still%d" % i), "--format", "none", "--size", str(width), str(height), "--suspend", "--resume"],
stdout=subprocess.PIPE)
try:
(output, err) = p.communicate(timeout=30)
output_str = output.decode("utf-8")
if re.search(r"\*FULL\*", output_str, flags=re.MULTILINE):
print("OK")
elif re.search(r"\*INCOMPLETE\*", output_str, flags=re.MULTILINE):
print("INCOMPLETE")
else:
print("*** FAILED ***")
print("Kernel log:")
print(get_kern_log(10))
except subprocess.TimeoutExpired:
print("TIMEOUT")
# Read an image from each camera and save it to disk.
评论列表
文章目录