jim-easterbrook / python-gphoto2

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

[-7] I/O problem when I'm trying put file into camera - Raspberry Pi3B+ #108

Closed kelerek closed 3 years ago

kelerek commented 3 years ago

Hi Jim,

I have a problem with sending file into camera on my Raspberry Pi3B+. When I'm using func:
try: gp.check_result(self.camera.folder_put_file(self.camera_folder_path, self.pic_up, gp.GP_FILE_TYPE_NORMAL, self.convert_to_camera_file, self.context))

except Exception as e: print("Upload Error: "+ str(e))

After using that func I'm receiving this error: [-7] I/O problem.

Have you some advices how can I solve this problem?

jim-easterbrook commented 3 years ago

If an operation fails (e.g. it's not supported) the USB connection (or other connection) could be left in an undefined state. Resetting the connection might help (maybe a camera.exit camera.init cycle) but you might need to unplug the camera or even reset it.

kelerek commented 3 years ago

After a few attempts I didn't find solution.
I can't only send back picture to camera, because USB has some problem with sending back. Program was showing this "[-7] I/O problem" error until reset camera by taking out battery. My camera has ability "sending files to camera".

jim-easterbrook commented 3 years ago

Have you tried doing it with the gphoto command? If this doesn't work then there is probably a bug in the driver for your camera, or no one has successfully "reverse engineered" the USB commands to do it. Try asking on the gphoto mailing list.