diff --git a/BabbleApp/camera.py b/BabbleApp/camera.py index f6450d8..5019810 100644 --- a/BabbleApp/camera.py +++ b/BabbleApp/camera.py @@ -86,7 +86,8 @@ class Camera: self.config.capture_source is not None and self.config.capture_source != "" ): - if "COM" in str(self.config.capture_source): + ports = ("COM", "/dev/ttyACM") + if any(x in str(self.config.capture_source) for x in ports): if ( self.serial_connection is None or self.camera_status == CameraState.DISCONNECTED @@ -150,7 +151,7 @@ class Camera: if should_push and not self.capture_event.wait(timeout=0.02): continue if self.config.capture_source is not None: - ports = ("COM", "/dev/tty") + ports = ("COM", "/dev/ttyACM") if any(x in str(self.config.capture_source) for x in ports): self.get_serial_camera_picture(should_push) else: diff --git a/BabbleApp/camera_widget.py b/BabbleApp/camera_widget.py index cd21f21..8477094 100644 --- a/BabbleApp/camera_widget.py +++ b/BabbleApp/camera_widget.py @@ -319,8 +319,10 @@ class CameraWidget: # if value not in self.camera_list: # self.config.capture_source = value # if "COM" not in value: - ports = ("COM", "/dev/tty") + ports = ("COM", "/dev/ttyACM") + print(f"Value: {value}") if any(x in str(value) for x in ports): + print("SERIAL PORT") self.config.capture_source = value else: cam = get_camera_index_by_name(value) # Set capture_source to the UVC index. Otherwise treat value like an ipcam if we return none @@ -344,7 +346,7 @@ class CameraWidget: and ".mp4" not in value and "udp" not in value and "COM" not in value - and "/dev/tty" not in value + and "/dev/ttyACM" not in value and value not in self.camera_list ): # If http is not in camera address, add it. self.config.capture_source = (