You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using COHN mode following the cohn.py demo and then calling await gopro.http_command.set_shutter(shutter=Params.Toggle.ENABLE), the command hangs indefinitely and will never return. It actually does enable the shutter (i.e. start the video), but just the python method never resolves.
Using a keyboard interrupt shows it's stuck on this line
importasynciofromopen_goproimportParams, WiredGoPro, WirelessGoPro, proto# COHN setup from# https://github.com/gopro/OpenGoPro/blob/28efd7c0d9e1bc43343bed5274cf74f84a2cded1/demos/python/sdk_wireless_camera_control/open_gopro/demos/cohn.pywifi_ssid=''wifi_password=''# Start with Wifi Disabled (i.e. don't allow camera in AP mode).asyncwithWirelessGoPro(target='GoPro 1234', enable_wifi=False) asgopro:
assertgoproawaitgopro.ble_command.cohn_clear_certificate()
ifawaitgopro.is_cohn_provisioned:
print("COHN is already provisioned")
else:
assertawaitgopro.connect_to_access_point(wifi_ssid, wifi_password)
assertawaitgopro.configure_cohn()
print('Set up COHN! Disconnecting Bluetooth')
assert (awaitgopro.http_command.get_camera_state()).okprint("Successfully communicated via COHN!!")
# Based on# https://github.com/gopro/OpenGoPro/blob/28efd7c0d9e1bc43343bed5274cf74f84a2cded1/demos/python/sdk_wireless_camera_control/open_gopro/demos/video.pyassert (awaitgopro.http_command.load_preset_group(group=proto.EnumPresetGroup.PRESET_GROUP_ID_VIDEO)).okawaitgopro.http_command.set_shutter(shutter=Params.Toggle.ENABLE) # <-- HANGS HEREawaitasyncio.sleep(args.record_time) # <-- Never gets hereassert (awaitgopro.http_command.set_shutter(shutter=Params.Toggle.DISABLE)).ok
Expected behavior
Like in BLE or regular WiFi AP mode, I'd expect set_shutter(shutter=ENABLE) to return once the shutter is on (not hang), so that I can then proceed with waiting a set duration before calling set_shutter(shutter=DISABLE) to stop the shutter and end the video.
I confirmed that I was able to set_shutter(ENABLE), asyncio.sleep, and set_shutter(DISABLE) when using BLE commands, so this appears to be specific to COHN.
Hardware
Camera: HERO12 Black
Firmware version: H23.01.02.20.00
Python 3.10
open_gopro: 0.16.1
The text was updated successfully, but these errors were encountered:
@tcamise-gpsw Thanks for following up. Unfortunately I do not have the log files and am not working with the GoPro devices at this point, so can't easily run this again to produce a new set of them.
No worries, actually I am able to replicate this easily.
It's more or less the same problem as this pinned issue. Specifically the internal state management is not correctly reset / managed when the BLE connection drops after provisioning / connecting COHN. I'll do a little more investigating but will likely end up closing this as duplicate to be tracked with the pinned issue above which really needs to be dealt with soon.
Component
What is the bug in?
Describe the bug
When using COHN mode following the
cohn.py
demo and then callingawait gopro.http_command.set_shutter(shutter=Params.Toggle.ENABLE)
, the command hangs indefinitely and will never return. It actually does enable the shutter (i.e. start the video), but just the python method never resolves.Using a keyboard interrupt shows it's stuck on this line
OpenGoPro/demos/python/sdk_wireless_camera_control/open_gopro/gopro_wireless.py
Line 554 in 28efd7c
To Reproduce
Use the following Python code:
Expected behavior
Like in BLE or regular WiFi AP mode, I'd expect
set_shutter(shutter=ENABLE)
to return once the shutter is on (not hang), so that I can then proceed with waiting a set duration before callingset_shutter(shutter=DISABLE)
to stop the shutter and end the video.I confirmed that I was able to
set_shutter(ENABLE)
,asyncio.sleep
, andset_shutter(DISABLE)
when using BLE commands, so this appears to be specific to COHN.Hardware
open_gopro
: 0.16.1The text was updated successfully, but these errors were encountered: