jim-easterbrook / python-gphoto2

Python interface to libgphoto2
GNU Lesser General Public License v3.0
359 stars 59 forks source link

gphoto2 - Canon EOS 4000D #70

Closed iblasi closed 5 years ago

iblasi commented 5 years ago

I was checking at libgphoto2 support (link) that the Canon EOS 4000D is available on gphoto2. In fact, I check that the las version 2.5.20 (link) is actually supporting it as it says in the README. After installing this package with pip sudo pip install -U -v gphoto2 I see that the last version 1.8.5 istalled and at the same time 2.5.17 of gphoto2 and 2.5.19 of libgphoto2 (looking at /usr/local/bin/gphoto2 and /usr/local/lib/libgphoto2 respectively). So I suupose that due to it, as they are not the last versions the initialization of the camera does not recognize the Canon EOS 4000D:

>>> import gphoto2 as gp
>>> gp.__version__
'1.8.5'
>>> camera = gp.check_result(gp.gp_camera_new())
>>> gp.check_result(gp.gp_camera_init(camera))
gphoto2.GPhoto2Error: [-105] Unknown model

Furthermore, it is clear that 4000D model is not supported as when I run gphoto2 --list-cameras, that camera does not appear on the list.

$ gphoto2 --list-cameras
...
    "Canon EOS 30D (PTP mode)"
    "Canon EOS 350D"
    "Canon EOS 350D (normal mode)"
    "Canon EOS 350D (PTP mode)"
    "Canon EOS 400D (PTP mode)"
    "Canon EOS 40D (PTP mode)"
    "Canon EOS 450D (PTP mode)"
    "Canon EOS 500D"
...

So, how can I update python-gphoto2 to use 2.5.20 or recongnize Canon EOS 4000D?

Just to add, the USB shows the camera and the PTPCamera has been killed to avoid

$ lsusb
Bus 020 Device 003: ID 0a5c:4500 Broadcom Corp. BRCM20702 Hub 
Bus 020 Device 006: ID 05ac:828f Apple Inc. Bluetooth USB Host Controller 
Bus 020 Device 023: ID 04a9:32d9 Canon Inc. Canon Digital Camera 
Bus 000 Device 001: ID 1d6b:IWPT Linux Foundation USB 3.0 Bus
jim-easterbrook commented 5 years ago

You need to update your installation of libgphoto2, then reinstall python-gphoto2. The installation builds python-gphoto2 to use the installed libgphoto2. (See also the README note in reinstalling: https://github.com/jim-easterbrook/python-gphoto2#reinstalling)

iblasi commented 5 years ago

@jim-easterbrook I install it and now I have both of them. I did all the steps and it worked! But the second time strangely again raises the same error. However, I restarted the camera and USB connection and I have been able to capture 20 images and still working. So, how can I check the lib that python-gphoto2 is using to be sure that the error won't appear again?

jim-easterbrook commented 5 years ago

python-gphoto2 uses whatever libgphoto2 is installed on your computer. It does not install or change libgphoto2. The command pkg-config --modversion libgphoto2 will tell you what version of libgphoto2 is installed. (This is the command that the python-gphoto2 installer uses to determine the library version.) Within Python you can use gphoto2.gp_library_version(0) to get the library version.

iblasi commented 5 years ago

Thank you. I checked the commands you've sent me and, yes, everything is correctly linked after forcing the reinstall with sudo pip install -v -U --force-reinstall gphoto2

$ pkg-config --modversion libgphoto2
2.5.20
$ python
>>> import gphoto2 as gp
>>> gp.gp_library_version(0)
['2.5.20', 'all camlibs', 'gcc', 'ltdl', 'EXIF']

I have tested it several times the Canon EOS 4000D, and it haven't failed recognizing the model. Thanks again.