gphoto2 icon indicating copy to clipboard operation
gphoto2 copied to clipboard

Gphoto2 copies files from HDD instead of camera

Open bossredman opened this issue 7 years ago • 7 comments

Hi, I am using Gphoto2 with a raspberry Pi to make a portable device for backing up photos from a camera. I have a bash script that runs --autodetect to find teh camera. It then creates a new folder on the backup media. Then runs --get-all-files.sh . Everything works fine if I use a USB stick as the backup media. --autodetect just detects the camera & the photos are copied from the camera to the USB stick.

Problems arise when I use a portable HDD drive (with powered hub) as the backup media.

--auto-detect detects both the camera and the HDD: (both as 'Mass Storage Camera' when camera is connected as USB Mode: PC) or ( Camera as 'Camera Model Name' and HDD as 'Mass Storage Camera' when camera is connected as USB Mode: PTP) & it eitherway it proceeds to copy photos from the HDD back to the HDD instead of from the camera to the HDD.

Even if I filter the --auto-detect to screen for just the camera, it detects just the camera OK but again copies the files from the HDD instead of the camera. It's almost like it can't cope with 2 devices

gphoto2 v2.5.6 libgphoto2 v 2.5.4 libgphoto2_port 0.12.0

Fairly new to all this stuff - so any ideas pls.

bossredman avatar Sep 08 '16 10:09 bossredman

try:

gphoto2 --port usb: --get-all-files

that will select the first usb camera. (and not the disk: based storage)

msmeissn avatar Sep 08 '16 11:09 msmeissn

Thank you so much. Now working. This has been driving me nuts for a couple of days now.

Could I now take the opportunity to ask whether it is possible to count the amount of files on the camera, write that to a variable. Then upon completion of the copy process, again count the files copied & compare that to the original value?

bossredman avatar Sep 08 '16 11:09 bossredman

gphoto2 --port usb: -L --stdout would list the files , pipe into "wc -l" for instance and after download "ls|wc -l" and compare those.

msmeissn avatar Sep 08 '16 11:09 msmeissn

Hi again,

So this may seem like a dumb question, but got it working in bash. How do I get gphoto to run via python. Is the syntax the same?

Eg what would be the equivalent in python for the bash :: sudo gphoto2 --auto-detect

Can amyone recommend good reference material on the web. Just can't seem to find any for python.

bossredman avatar Sep 11 '16 08:09 bossredman

I got a similar problem. I just started using gphoto2 to see about moving files from the Canon 1dx mark ii to the computer. gphoto2 detects a hard drive on the computer as a "Mass Storage Camera". This HDD is a spinning rust drive that been on the system for 5 years at least as a normal ext4 hard drive. Is there any resean gphoto2 should scan for HDD at all? Due to this "disk:/home/techwolf/Media2" any program that uses gphoto errors out with "*** Error (-105: 'Unknown model') ***"

Techwolf avatar Jun 13 '19 02:06 Techwolf

it usually is some kind of helper for plugged in SD Cards ... it will look for "DCIM" folder in the base of the mounted filesystem.

You can remove the disk.so port driver, or directory camlib to remove it from libgphoto2.

msmeissn avatar Jun 13 '19 05:06 msmeissn

Just wanted to let you know that I had an encounter with this issue tonight. Something was mounted as a "Mass storage device" with port "disk:/boot" and I was then unable to access the camera connected via USB. Even when specifying which camera or port I wanted to use I only ended up with Unsupported configuration or "the camera does not support this..." Finally after finding this thread and renaming the disk.so file I was able to get it to work.

Something to be looked at and adressed ? Or did I mess something up myself ?

EDIT: There was noting else plugged into my usb ports, neither before or during.

grelle avatar Feb 13 '22 19:02 grelle