diff --git a/demos/python/sdk_wireless_camera_control/open_gopro/wifi/adapters/wireless.py b/demos/python/sdk_wireless_camera_control/open_gopro/wifi/adapters/wireless.py index 42902d7e..4e4453ed 100644 --- a/demos/python/sdk_wireless_camera_control/open_gopro/wifi/adapters/wireless.py +++ b/demos/python/sdk_wireless_camera_control/open_gopro/wifi/adapters/wireless.py @@ -697,6 +697,18 @@ def connect(self, ssid: str, password: str, timeout: float = 15) -> bool: location_manager = CLLocationManager.alloc().init() location_manager.startUpdatingLocation() + # Get the current authorization status for Python + max_wait = 60 + for i in range(1, max_wait): + authorization_status = location_manager.authorizationStatus() + if authorization_status == 3 or authorization_status == 4: + print("Python has been authorized for location services") + break + if i == max_wait-1: + exit("Unable to obtain authorization, exiting") + time.sleep(1) + + # Load CoreWLAN framework objc.loadBundle('CoreWLAN', bundle_path='/System/Library/Frameworks/CoreWLAN.framework',