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

error -105 GP_ERROR_MODEL_NOT_FOUND #181

Closed
andrewyguo opened this issue Oct 15, 2024 · 10 comments
Closed

error -105 GP_ERROR_MODEL_NOT_FOUND #181

andrewyguo opened this issue Oct 15, 2024 · 10 comments

Comments

@andrewyguo
Copy link

andrewyguo commented Oct 15, 2024

I am trying to use python-gphoto2 with my Sony A7M4 and I was getting the same errors as this issue.

I followed the advice and installed libgphoto2. I didn't comment out anything since I think there has already been a fix merged in. Please correct me if I am wrong.

Your system
Python 3.9.0

Ubuntu 22.04.5 LTS

What version of libgphoto2 have you installed?

$ pkg-config --modversion libgphoto2
2.5.31.1

How have you installed (or attempted to install) python-gphoto2?

Yes. I have installed following instructions here:
https://github.com/jim-easterbrook/python-gphoto2/blob/main/INSTALL.rst#local-libgphoto2

Your problem
However, I am now getting this error with my A7M4:

import gphoto2 as gp

error, camera = gp.gp_camera_new()


print("error after gp_camera_new: ", error)

error = gp.gp_camera_init(camera)
print("error after gp_camera_init: ", error)

Output:

error after gp_camera_new:  0
error after gp_camera_init:  -105

Which corresponds to GP_ERROR_MODEL_NOT_FOUND.

I was not getting this before. It was able to initialize the camera fine.

@jim-easterbrook
Copy link
Owner

Check the output of python -m gphoto2 to see which version of libgphoto2 you are using.

@andrewyguo
Copy link
Author

andrewyguo commented Oct 15, 2024

$ python -m gphoto2
python-gphoto2 version: 2.5.1
libgphoto2 version: 2.5.31.1, standard camlibs (SKIPPING docupen lumix), gcc, no ltdl, no EXIF
libgphoto2_port version: 0.12.2, iolibs: disk ptpip serial, gcc, no ltdl, no EXIF, no USB, serial without locking

@jim-easterbrook
Copy link
Owner

That shows it's using your local libgphoto2. You could try building an earlier version (that you know worked) and using that with python-gphoto2.

I don't think you have a python-gphoto2 bug though.

@andrewyguo
Copy link
Author

Thanks, let me see if I can revert to an older version of libgphoto2. I am curious how @ertdfgcvb was able to fix the issue earlier. Seems like they were also using v2.5.31 of libgphoto2

@jim-easterbrook
Copy link
Owner

-105 is also the error you get if there's no camera connected (e.g. if it's gone to sleep). Worth checking - I know how easy it can be to overlook the obvious.

@andrewyguo
Copy link
Author

andrewyguo commented Oct 15, 2024

@jim-easterbrook,

I made sure the camera is connected and awake. I have downgraded libgphoto to be v2.5.30. This is my gphoto version now:

$ python -m gphoto2
python-gphoto2 version: 2.5.1
libgphoto2 version: 2.5.30, standard camlibs (SKIPPING docupen), gcc, no ltdl, EXIF
libgphoto2_port version: 0.12.1, iolibs: disk ptpip serial usb usbdiskdirect usbscsi, gcc, no ltdl, EXIF, USB, serial without locking

However, I am still getting this when running python examples/camera-summary.py:

$ python examples/camera-summary.py 
WARNING: gphoto2: (gp_port_usb_close [libusb.c:309]) Invalid parameters: 'port && port->pl->dh' is NULL/FALSE.
WARNING: gphoto2: (gp_context_error) Could not detect any camera
Traceback (most recent call last):
  File "/home/ykguo/camera/python-gphoto2/examples/camera-summary.py", line 51, in <module>
    sys.exit(main())
  File "/home/ykguo/camera/python-gphoto2/examples/camera-summary.py", line 37, in main
    camera.init()
gphoto2.GPhoto2Error: [-105] Unknown model

When I run lsusb, I can see my camera.

$ lsusb
Bus 004 Device 005: ID 054c:0da7 Sony Corp. ILCE-7M4

But when I run gphoto2 --auto-detect, I get nothing:

$ ~/.local/bin/gphoto2 --auto-detect
Model                          Port                                            
----------------------------------------------------------

$ ~/.local/bin/gphoto2 --version 
gphoto2 2.5.28.1
This version of gphoto2 is using the following software versions and options:
gphoto2         2.5.28.1       gcc, popt(m), no exif, no cdk, no aa, no jpeg, no readline
libgphoto2      2.5.30         standard camlibs (SKIPPING docupen), gcc, no ltdl, EXIF
libgphoto2_port 0.12.1         iolibs: disk ptpip serial usb usbdiskdirect usbscsi, gcc, no ltdl, EXIF, USB, serial without locking

@andrewyguo
Copy link
Author

Another thing to note, I re-installed gphoto2 using the binary wheel:

$ pip3 install gphoto2 --user --only-binary :all:
$ $ python -m gphoto2
python-gphoto2 version: 2.5.1
libgphoto2 version: 2.5.31, standard camlibs, gcc, no ltdl, EXIF
libgphoto2_port version: 0.12.2, iolibs: disk ptpip serial usb1 usbdiskdirect usbscsi vusb, gcc, no ltdl, EXIF, USB, serial without locking

But I am getting a new error:

$ python examples/camera-summary.py 
Traceback (most recent call last):
  File "/home/ykguo/camera/python-gphoto2/examples/camera-summary.py", line 51, in <module>
    sys.exit(main())
  File "/home/ykguo/camera/python-gphoto2/examples/camera-summary.py", line 37, in main
    camera.init()
gphoto2.GPhoto2Error: [-7] I/O problem

@jim-easterbrook
Copy link
Owner

If gphoto2 --auto-detect doesn't recognise your camera then python-gphoto2 won't be able to do anything with it. This is not a python-gphoto2 bug.

@andrewyguo
Copy link
Author

I was thinking the same. Thanks for your help. I will look in the gphoto2 repository

@andrewyguo
Copy link
Author

for those who encounter a similar issue, the root of my issue was this:

gphoto/gphoto2#655

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

2 participants