Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'd like to copy a firmware update file to my Canon 7D camera, connected via USB.

After it was auto-mounted by thunar + thunar-volman + gvfs-gphoto2 I tried the following:

$ cp eos7d-v205-win/7D000205.FIR /run/user/1000/gvfs/gphoto2\:host\=%5Busb%3A001%2C012%5D/
$ echo $?
0
$ ls /run/user/1000/gvfs/gphoto2\:host\=%5Busb%3A001%2C012%5D/
DCIM  MISC

So that went into a black hole.


The first time I try to copy it with Ctrl-c and Ctrl-v prints the following error message when pasting the file:

Error writing file.

-108: No such file or directory.

Do you want to skip it?

If I try again after that it simply crashes:

$ thunar
Segmentation fault (core dumped)
$ echo $?
139

The Gphoto 2 shell has an undocumented put function which I also tried:

$ sudo umount /run/user/1000/gvfs
$ gphoto2 --shell
gphoto2: {.../eos7d-v205-win} /> help put
Help on "put":

Usage: put [directory/]filename
Description:
        Upload a file

* Arguments in brackets [] are optional

So this function takes a single argument with an optional directory. Weird, but should be doable. Some attempts at making it work:

$ gphoto2 --shell
gphoto2: {.../eos7d-v205-win} /> ls
store_00010001/     
gphoto2: {.../eos7d-v205-win} /> put 7D000205.FIR                       

*** Error ***              
You need to specify a folder starting with /store_xxxxxxxxx/
*** Error (-1: 'Unspecified error') ***
gphoto2: {.../eos7d-v205-win} /> put /store_00010001/7D000205.FIR

*** Error ***              
PTP Access Denied
*** Error (-1: 'Unspecified error') ***
gphoto2: {.../eos7d-v205-win} /> put /store_00010001/MISC/7D000205.FIR

*** Error ***              
PTP Access Denied
*** Error (-1: 'Unspecified error') ***

Maybe it's not supported?


Digikam has an upload feature, but that just reported 'Failed to upload file "7D000205.FIR".' Running it from the shell produced no more information.


man gvfs-copy doesn't explicitly say it can't copy to a camera, but I can't figure out how:

$ gvfs-copy "file://${HOME}/7D000203.FIR" /run/user/1000/gvfs/gphoto2\:host\=%5Busb%3A004%2C006%5D/
Error copying file file:///[...]/7D000203.FIR: Error writing file: -1: Unspecified error
$ gvfs-copy "file://${HOME}/7D000203.FIR" file:///run/user/1000/gvfs/gphoto2\:host\=%5Busb%3A004%2C006%5D/
Error copying file file:///[...]/7D000203.FIR: Error opening file '/run/user/1000/gvfs/gphoto2:host=[usb:004,006]': No such file or directory
$ gvfs-copy "file://${HOME}/7D000203.FIR" gphoto2://host\=%5Busb%3A004%2C006%5D/
Error copying file file:///[...]/7D000203.FIR: The specified location is not mounted

gphoto2 says it should be possible to upload files to the camera:

$ gphoto2 --port usb: --abilities
Abilities for camera             : Canon EOS 7D                                
Serial port support              : no
USB support                      : yes
Capture choices                  :
                                 : Image
                                 : Preview
Configuration support            : yes
Delete selected files on camera  : yes
Delete all files on camera       : no
File preview (thumbnail) support : yes
File upload support              : yes

The gphoto2 manual says it supports "uploading" files. It doesn't work. Trying a command reported as working elsewhere:

$ gphoto2 --upload-file 7D000203.FIR --folder /store_00010001
*** Error ***              
PTP Access Denied
*** Error (-1: 'Unspecified error') ***       

For debugging messages, please use the --debug option.
Debugging messages may help finding a solution to your problem.
If you intend to send any error or debug messages to the gphoto
developer mailing list <gphoto-devel@lists.sourceforge.net>, please run
gphoto2 as follows:

    env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --upload-file 7D000203.FIR --folder /store_00010001

Please make sure there is sufficient quoting around the arguments.

After trying the debug command I get the following relevant log lines:

ptp_usb_getresp [usb.c:434] (0): PTP_OC 0x100c receiving resp failed: PTP Access Denied (0x200f)
put_file_func [library.c:5940](0): 'ptp_sendobjectinfo (params, &storage, &parent, &handle, &oi)' failed: 'PTP Access Denied' (0x200f)
gp_context_error            (0): PTP Access Denied
gp_camera_folder_put_file [gphoto2-camera.c:1248](0): 'gp_filesystem_put_file (camera->fs, folder, filename, type, file, context)' failed: -1
gp_camera_free              (2): Freeing camera...
gp_camera_exit              (2): Exiting camera ('Canon EOS 7D')...
ptp_usb_sendreq             (2): Sending PTP_OC 0x1003 / Close session request...
gp_port_write               (3): Writing 12 = 0xc bytes to port...
gp_port_write               (3): Wrote   12 = 0xc bytes to port: (hexdump of 12 bytes)
 0c 00 00 00 01 00 03 10-0c 00 00 00              ............    

Too many WTFs per minute. What do I need to do to copy a file to my camera in Arch Linux?

In case it's relevant: I tried copying the file on Windows 7, and it also fails:

You do not have permission to create this item.

share|improve this question

This question has an open bounty worth +50 reputation from l0b0 ending in 6 days.

This question has not received enough attention.

gvfs-copy should be able to do this, but there are no examples on how to actually use it with a real camera.

    
I'm not familiar with the tools you used, but it seems to me like you're trying to send your firmware in the device's standard storage area, where it would normally store media files and other kinds of user data. Shouldn't the firmware be stored differently, like an OS' first sections of code should be stored at byte 0 on a drive? –  John WH Smith yesterday
    
Does copying into the DCIM directory work? –  kyrias yesterday
    
Also, could you try running something like gphoto2 --port usb: --abilities? –  kyrias yesterday
    
@JohnWHSmith According to Canon the firmware files should be stored at the root of the camera filesystem. You can then instruct the camera to upgrade to that firmware file. –  l0b0 20 hours ago
    
@kyrias No, and I have to copy it to the root of the camera filesystem to perform a firmware upgrade. –  l0b0 20 hours ago

1 Answer 1

You can use gvfs-copy command. The syntax is:

gvfs-copy source-URI destination-URI

So this should work:

gvfs-copy file:///home/user/eos7d-v205-win/7D000205.FIR file:///run/user/1000/gvfs/gphoto2\:host\=%5Busb%3A001%2C012%5D/
share|improve this answer
    
Doesn't seem to work: Error copying file file:///[...]/7D000203.FIR: Error opening file '/run/user/1000/gvfs/gphoto2:host=[usb:004,005]': No such file or directory. I don't understand what the target syntax is supposed to be. I haven't found a single working example. –  l0b0 yesterday

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.