Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix COHN cert default value, useful for multiple camera #637

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading