gphoto / gphoto2

The gphoto2 commandline tool for accessing and controlling digital cameras.
GNU General Public License v2.0
703 stars 116 forks source link

Canon EOS 5Ds - no shutter counter available in gphoto2 #81

Open Thrill-Kill opened 7 years ago

Thrill-Kill commented 7 years ago

Hi gphoto support team,

I am struggling to read out the shutter count on my Canon EOS 5Ds Camera. The camera is recognized in Ubuntu and I am even able to capture images etc. But the shutter counter will not start.

Do you have an idea what is wrong? I already tried multiple computers including different USB 2/USB3 ports. Is it a problem that the camera has a USB 3.0 port itself?

You can find the reports attached. Thanks for your help!

Kind regards Dawid

config.txt my-logfile fro shuttercounter command.txt my-logfile.txt summary.txt

msmeissn commented 7 years ago

d1ac would be the shuttercount value ... while it is reported, it has no content in the trace.

I am not sure this is possible.

joelcomp1 commented 5 years ago

anyone find a work around to this? I find this very useful as well.

msmeissn commented 5 years ago

I looked at the attached logfiles and the d1ac property is reported as empty.

I also looked over the other properties and none show out as containing shuttecount level values.

You can try:

Take a before logfile : gphoto2 --debug --debug-logfile=before.log --list-config

take say 10 pictures switch off camera / switch it back on to make sure it stores the value

Take a after logfile : gphoto2 --debug --debug-logfile=after.log --list-config

and attach both here

joelcomp1 commented 5 years ago

Sure so just so you know i have 6 cameras attached to this PC so the debug seems to show all 6. But the one I used was port usb:012,007.

after.log before.log

Took 10 pictures in between. hopefully that helps!

msmeissn commented 5 years ago

This does not show anything changing in this area.

I did some research, stumbled over some things but cant reproduce it with my 750D.

You could however try:

gphoto2 --set-config opcode=0x905f,0x0017 --debug --debug-logfile=905f-0017.log gphoto2 --set-config opcode=0x905f,0x000d --debug --debug-logfile=907f-000d.log

and attach them here?

joelcomp1 commented 5 years ago

sure see attached. 905f-0017.log 907f-000d.log

evripidis commented 5 years ago

Hello!

I have the same issue here. The option /main/status/shuttercounter does not even listed on my terminal.

The other commands seems to work ok.

I am using a 77D.

GrzegorzDrozd commented 3 years ago

Hi,

Same issue with Canon EOS 200 D. Attached are before and after logs (please note only 4 pictures apart). before.log after.log

msmeissn commented 3 years ago

nothing shines out of the diff between those.

can you try gphoto2 --wait-event=1s --set-config opcode=0x9127,0xd1ac --wait-event=1s --debug --debug-logfile=d1ac.log

and attach d1ac.log here?

NaJager commented 2 years ago

[...] You can try:

Take a before logfile : gphoto2 --debug --debug-logfile=before.log --list-config

take say 10 pictures switch off camera / switch it back on to make sure it stores the value

Take a after logfile : gphoto2 --debug --debug-logfile=after.log --list-config

and attach both here

Doing this I found that on a Canon EOS 5D IV the generated logfile has a hex value that changes by the exact amount of pictures taken in between the two log files. In my case on line 1698:

0040 00 00 00 00 07 01 19 63-06 01 00 64 08 00 00 00 .......c...d....

Changed to

0040 00 00 00 00 07 01 19 68-06 01 00 83 08 00 00 00 .......j........

After 5 photos, and to

0040 00 00 00 00 07 01 19 6a-06 01 00 83 08 00 00 00 .......j........

after another 2 photos.

Because I don't expect the shuttercount to be in the 100-millions, but we're still talking about a camera that was used often, my assumption is that the shuttercount is 01 19 6a => 72042 in this case

Having never used gphoto, a Canon camera or anything to do with hex code before I'm not 100% sure about this being the correct number, though it does seem like a logical outcome

msmeissn commented 2 years ago

can you specify some more lines of this hexdump before the quoted lines?

NaJager commented 2 years ago

0.115338 gp_port_read (3): Reading 84 = 0x54 bytes from port... 0.115499 gp_port_read (3): Read 84 = 0x54 bytes from port: (hexdump of 84 bytes) 0000 ff 1f 00 00 01 00 01 01-a0 10 00 88 00 00 60 20 .............. 0010 00 01 01 00 00 04 01 04-e5 00 00 00 00 00 00 01 ................ 0020 01 fd 00 00 00 00 01 00-00 00 00 00 00 00 00 00 ................ 0030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 0040 00 00 00 00 07 01 19 6a-06 01 00 83 08 00 00 00 .......j........ 0050 00 00 00 00 - ....`

msmeissn commented 2 years ago

can you quote also the 2 hexblocks before this hexblock?

NaJager commented 2 years ago

The two blocks above are about 700 lines total, so I'll just give you the whole file. From line 1698 up should be what you were asking for after.log

msmeissn commented 2 years ago

usually little endian is used. so 01066a if you want to be sure, you can take 170 pictures so it wraps into the next byte to see which is incremented.

Can you do gphoto2 --wait-event=20s --debug --debug-logfile=xx.og

and half press the shutter button, turn the lens a bit, so it gets more events to untangle the OLC info?

Can check that later.

NaJager commented 2 years ago

It incremented to 01 1a 36, which seems about right to me Here's the log file: 5DMIVlog.log

msmeissn commented 2 years ago

thanks! the OLCInfo is a binary blob with a careful handcrafted and reverse engineered parser... and its close to the end of the blob, so it might take a bit to do it right.

gphoto2 --wait-event=100 should report some OLC infos already, but i doubt it givesthe right one here, the offsets later are probably not ok

msmeissn commented 2 years ago

can you also do the following:

gphoto2 --wait-event=1s --set-config opcode=0x913d,0x1000 --wait-event=1s --debug --debug-logfile=0x1000.log gphoto2 --wait-event=1s --set-config opcode=0x913d,0x0800 --wait-event=1s --debug --debug-logfile=0x0800.log gphoto2 --wait-event=1s --set-config opcode=0x913d,0x0400 --wait-event=1s --debug --debug-logfile=0x0400.log gphoto2 --wait-event=1s --set-config opcode=0x913d,0x0200 --wait-event=1s --debug --debug-logfile=0x0200.log gphoto2 --wait-event=1s --set-config opcode=0x913d,0x0100 --wait-event=1s --debug --debug-logfile=0x0100.log gphoto2 --wait-event=1s --set-config opcode=0x913d,0x0080 --wait-event=1s --debug --debug-logfile=0x0080.log

and attach the logfiles?

If you want, you can also step down to 0x0001

NaJager commented 2 years ago

Here ya go!

0x1000.log 0x0800.log 0x0400.log 0x0200.log 0x0100.log 0x0080.log 0x0060.log 0x0040.log 0x0020.log 0x0010.log 0x0005.log 0x0001.log

msmeissn commented 2 years ago

i just added to current libgphoto2 GIT a option to do this in one run

gphoto2 --set-config testolc=1 --debug --debug-info=olc.log

if you can send the olc.log ?

msmeissn commented 2 years ago

ah sorry, missed your previous comment. no specific need.

in the 0x1000 block is the shuttercount stuff I think 1.059027 ptp (2): event 0: EOS event OLCInfoChanged (size 24) 1.059040 ptp (2): 0: 14 / 4 byte size / 1.059049 ptp (2): 1: 00 1.059058 ptp (2): 2: 00 1.059067 ptp (2): 3: 00

1.059076 ptp (2): 4: 00 / 4 byte type mask / 1.059085 ptp (2): 5: 10 1.059094 ptp (2): 6: 00 1.059104 ptp (2): 7: 00

1.059110 ptp (2): 8: 07 / content starts here / 1.059116 ptp (2): 9: 01 1.059122 ptp (2): 10: 1a 1.059128 ptp (2): 11: 36 1.059134 ptp (2): 12: 06 1.059140 ptp (2): 13: 01 1.059146 ptp (2): 14: 00 1.059152 ptp (2): 15: 64