@@ -53,16 +56,15 @@ class Connection(projctl.WithLogger):
...
@@ -53,16 +56,15 @@ class Connection(projctl.WithLogger):
pass
pass
ifnotself.connected:
ifnotself.connected:
ifnotself.logged_connection_error:
ifnotself.logged_connection_error:
# projctl.database.log_event(
# message=f"Could not establish serial connection to Projector{'' if tries == 1 else ' after '+str(tries)+' tries'}!",
# event_type=projctl.EventType.server,
# problematic=True,
# )
self.logged_connection_error=True
self.logged_connection_error=True
# Exponential backoff
# Exponential backoff
backoff_time=min(120,tries*tries)
backoff_time=min(120,tries*tries)
ports=[]
forbaseinself.port_bases:
ports.append(f"{base}0 to {base}9")
ports=f'({", ".join(ports)})'
self.log_fatal(
self.log_fatal(
f"Error: Could not connect to any of the {len(self.potential_ports)} USB-Serial Ports ({self.port_base}0 to {self.port_base}9): Try {tries}, waiting {backoff_time}s before retrying"
f"Error: Could not connect to any of the {len(self.potential_ports)} USB-Serial Ports {ports}: Try {tries}, waiting {backoff_time}s before retrying"