gopro / OpenGoPro

An open source interface specification to communicate with a GoPro camera with accompanying demos and tutorials.
https://gopro.github.io/OpenGoPro/
MIT License
632 stars 145 forks source link

Issue with Provisioning COHN on GoPro 12 #457

Closed Aashyk-Mohaiteen closed 3 weeks ago

Aashyk-Mohaiteen commented 5 months ago

This issue was found while running the demo file: demos/python/sdk_wireless_camera_control/open_gopro/demos/cohn.py

I ran the demo file for provisioning and test the GoPro for COHN and ran into this issue:

image

Seems like the password string is not being written to the BLE characteristic and only first character is being written

To Reproduce Steps to reproduce the behavior: Run this in command prompt: python cohn.py --ssid wifi-ap --password password

Expected behavior Expected the GoPro 12 to be provisioned successfully

Hardware

tcamise-gpsw commented 4 months ago

That is quite an odd error. I've only ever seen this is an anomaly in bleak. Is this actually repeatable? If so, can you post the entire log file (i.e. gopro_demo.log)?

joelA11 commented 4 months ago

when i reduce the size of SSID, it passes, and check if youve given enough ip address range in ur router gateway. It works.

Fougl commented 2 months ago

I get exactly the same error, any solutions yet? @joelA11 dont quite understand what you did there. @tcamise-gpsw should I send you the log file?

tcamise-gpsw commented 1 month ago

I'm still not able to reproduce this. Also fwiw I did push a pretty major update of the SDK this week. Can @Fougl or someone try again and post the complete log here of the failure? To clarify I want the gopro_demo.log file; not just the console log.

joelA11 commented 1 month ago

I get exactly the same error, any solutions yet? @joelA11 dont quite understand what you did there. @tcamise-gpsw should I send you the log file?

Reduce the size of SSID and restrict the password to minimum characters. Also check if you've give enough ip address range in router.

The bleak module that works has some constraints with passing the ssid and password as a sequence, which has the length restriction, so it's advised to have the ssid length minimal to pass with password along.

tcamise-gpsw commented 1 month ago

@joelA11 Can you provide some more info on this bleak limitation? Where do you see this?

I'm not convinced this is the problem since the Python SDK is fragmenting each packet into a maximum size of 20 bytes

Thanks

tcamise-gpsw commented 1 month ago

I think I figured out what is going on here and it is a bug on the GoPro side. It has nothing to do with Bleak.

It is triggered by the size of the command, which is itself triggered by the sizes of ssid and password. I can replicate the issue by sending any command that takes more than one packet (20 bytes) and uses the general header. So any command that is between 20 and 31 bytes will trigger this. If however, I always use the extended header regardless of the packet size, the bug does not occur.

I'll update the Python SDK and documentation to always use extended headers.

tcamise-gpsw commented 1 month ago

The fix has been merged and released in v0.16.1

tcamise-gpsw commented 3 weeks ago

Reopening becuase this also needs to be fixed in the tutorials.