Better console messages for the test script (also rename it)
Change-Id: I20af4f4d82287459d7283ab9fc7dbaaf910c51a1
diff --git a/check.py b/test.py
similarity index 75%
rename from check.py
rename to test.py
index a873687..a0943de 100644
--- a/check.py
+++ b/test.py
@@ -18,16 +18,17 @@
import vision
def usb_accelerator_connected():
- if subprocess.run(["lsusb", "-d", "18d1:9302"]).returncode == 0:
+ if subprocess.run(["lsusb", "-d", "18d1:9302"], capture_output=True).returncode == 0:
return True
- if subprocess.run(["lsusb", "-d", "1a6e:089a"]).returncode == 0:
+ if subprocess.run(["lsusb", "-d", "1a6e:089a"], capture_output=True).returncode == 0:
return True
return False
if __name__ == '__main__':
if not usb_accelerator_connected():
- print('Coral USB accelerator is not connected :(')
+ print('Coral USB Accelerator NOT found! :(')
sys.exit(1)
-
+
+ print('Coral USB Accelerator found.')
for frame in vision.get_frames():
pass
diff --git a/vision.py b/vision.py
index 8469a79..d0f1edb 100644
--- a/vision.py
+++ b/vision.py
@@ -81,6 +81,7 @@
cap = cv2.VideoCapture(0)
success, _ = cap.read()
if success:
+ print("Camera started successfully.")
break
if attempts == 0: