Skip to content

Commit

Permalink
Fix COHN cert default value, useful for multiple camera
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanideaslab committed Nov 15, 2024
1 parent 3667cad commit 99f20c4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def parse_arguments() -> argparse.Namespace:
parser.add_argument("ssid", type=str, help="WiFi SSID to connect to.")
parser.add_argument("password", type=str, help="Password of WiFi SSID.")
parser.add_argument("url", type=str, help="RTMP server URL to stream to.")
parser.add_argument("identifier", type=str, help="GoPro identifier.")
parser.add_argument("--min_bit", type=int, help="Minimum bitrate.", default=1000)
parser.add_argument("--max_bit", type=int, help="Maximum bitrate.", default=1000)
parser.add_argument("--start_bit", type=int, help="Starting bitrate.", default=1000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,10 @@ async def wait_for_cohn_ready(_: Any, status: proto.NotifyCOHNStatus) -> None:
logger.info("Waiting for COHN to be connected")
await self.ble_command.cohn_get_status(register=True)
ip_address, password = await asyncio.wait_for(credentials.get(), timeout)
hardware_info = await self.ble_command.get_hardware_info()
serial_number = hardware_info.data.serial_number
cert = (await self.ble_command.cohn_get_certificate()).data.cert
self._cohn = CohnInfo(ip_address, "gopro", password, cert)
self._cohn = CohnInfo(ip_address, "gopro", password, cert,f"cohn_{serial_number}.crt")
logger.info(f"Using COHN Credentials: {self._cohn}")
return True
except TimeoutError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class CohnInfo:
username: str
password: str
certificate: str
cert_path: Path = Path("cohn.crt")
cert_path: Path

def __post_init__(self) -> None:
token = b64encode(f"{self.username}:{self.password}".encode("utf-8")).decode("ascii")
Expand Down

0 comments on commit 99f20c4

Please sign in to comment.