jim-easterbrook / python-gphoto2

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

Apache2 connection to gphoto2 #112

Closed sjohns5 closed 3 years ago

sjohns5 commented 3 years ago

This page is for reporting problems with the Python interface to libgphoto2. If your question is about using libgphoto2 you should ask on the gphoto2 mailing list.

Your system What version of Python are you using? 3.8 What version of libgphoto2 have you installed? 2.5.25 How have you installed (or attempted to install) python-gphoto2? yes Your problem Please describe what you are trying to do and what goes wrong. A short Python script that shows the problem may be useful. Hi Jim,

I am able to successfully run gphoto2 via python but am running into an issue when trying to call the script from a virtual host, apache2, and am curious if you have ran into this issue before. I believe that it is a permissions issue on apache2, any thoughts?

Below is the error message that I am receiving. Thank you

Traceback (most recent call last): File "/usr/lib/cgi-bin/test.py", line 22, in camera.init() gphoto2.GPhoto2Error: [-7] I/O problem

jim-easterbrook commented 3 years ago

USB on virtual machines can often be problematic. If it works with the gphoto2 command line then it should work with python-gphoto2.

sjohns5 commented 3 years ago

Sorry I misspoke I am running it on a physical ubuntu device with the USB pulled in. Apache2 isnt able to call the gphoto2 command within python.

jim-easterbrook commented 3 years ago

The libgphoto2 documentation isn't much help about error -7. http://www.gphoto.org/doc/api/gphoto2-port-result_8h.html#a503f642aca99f5001d85af2c1c3805ae

I agree that it's probably a permissions problem, but I don't know anything about configuring Apache2 web servers to run Python, or giving web servers access to USB ports.

sjohns5 commented 3 years ago

Thanks jim, I was able to figure it out I had to change the permissions on the usb!