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

Directory becomes "empty" after 1st access resulting in "PTP No Device (-52)" error #1069

Open
Sija opened this issue Dec 27, 2024 · 6 comments

Comments

@Sija
Copy link
Contributor

Sija commented Dec 27, 2024

Describe the bug
When accessing a directory with device unplugged (via gp_camera_folder_list_folders), I'm getting PTP No Device (-52) error on the 1st try, but then on subsequent calls it returns successfully with an empty directory structure.

Name the camera
I've seen it happen on many cameras (PTP Generic, Canon)

libgphoto2 and gphoto2 version
libgphoto2 2.5.31

@msmeissn
Copy link
Contributor

msmeissn commented Jan 2, 2025

if the camera is not present usually the api would not work anymore, it works only with the camera avaiable ...

not sure i fully understand your usecase

@Sija
Copy link
Contributor Author

Sija commented Jan 3, 2025

Regardless of the use case, I'd expect consistency - i.e. returning the same error on every call.

@pppanghu77
Copy link

How did you manage to call gp_camera_folder_list_folders without initializing the camera first? It seems like gp_camera_init would fail if no camera is plugged in, right?

@Sija
Copy link
Contributor Author

Sija commented Jan 8, 2025

@pppanghu77 Camera is already initialized at that point.

@pppanghu77
Copy link

How was the camera initialized without being plugged in? Do you have a demo example?

@Sija
Copy link
Contributor Author

Sija commented Jan 8, 2025

Camera is initialized while it's being plugged. It's as easy as turning it off/unplugging it afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants