jim-easterbrook / python-gphoto2

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

ptpip #54

Closed emanuelelaface closed 5 years ago

emanuelelaface commented 6 years ago

Hi, sorry in advance if this is not the right place for this question. I wonder if it exists a way to use ptpip from the python library.

On a Canon M10 camera I am able to download all the photo from the command line simply with: gphoto2 --port ptpip:192.168.212.131:15740 -P

but I haven't find a way to specify the port from the python interface. Thanks for any help.

jim-easterbrook commented 6 years ago

The choose_camera.py example shows how to list all the connected cameras and choose one by port addr.

emanuelelaface commented 6 years ago

The choose_camera.py is capable to find the cameras connected through USB. What I am talking about is a camera connected via TCP/IP (for example via wifi) specifying the IP address and the port. The gphoto2 command line allows this using the --port flag, but I haven't find this possibility in the python wrapper.

jim-easterbrook commented 6 years ago

Can you pass an addr like ptpip:192.168.212.131:15740 to the Python port_info_list.lookup_path(addr)? The gphoto2 command source code is public, so it shouldn't be too hard to find how it's calling libgphoto2 functions to achieve this.