gphoto / libgphoto2

The libgphoto2 camera access and control library.
GNU Lesser General Public License v2.1
1.06k stars 325 forks source link

Help! Canon PowerShot SX720HS Zoom Control #316

Open luffecn opened 6 years ago

luffecn commented 6 years ago

Hi msmeissn, Thank you very much for your great work! I use gphoto2 to control PowerShot SX720H, but it does not work. So I captured the data between the app(Camera Connect) and the camera. The 0xD055(PTP_DPC_CANON_EOS_PowerZoomPosition) command can control the camera's zoom, but it did not work through usb control. Is there any difference between PTP/IP and PTP/USP? Thank you very much!

msmeissn commented 6 years ago

how exactly do you try it?

what is reported by: gphoto2 --summary gphoto2 --get-config d055

if --get-config d055 returns something, you can also try gphoto2 --set-config d055=value from d055 range to see if zoom happens.

The option is currently bnot yet hooked up for configuration, but with known values we can hook it up.

luffecn commented 6 years ago

summary.log get_config_d055.log set_config_d055.log

Because gphoto2 is not support this model(SX720HS) yet, so I wrote a program to control it. I follow the steps below to control the camera.

  1. opensession
  2. set PTP_OC_CANON_EOS_SetRemoteMode(0x9114) = 0x15
  3. set PTP_OC_CANON_EOS_SetEventMode(0x9115) = 0x02
  4. set PTP_DPC_CANON_EOS_EVFOutputDevice(0xD1b0) = 0x08, then the camera‘s lens begins to stretch out.
  5. use PTP_DPC_CANON_EOS_PowerZoomPosition(0xd055) to control the lens. The camera returns PTP_RC_OK(0x2001), but it does not move.
msmeissn commented 6 years ago

The camera is using Canon EOS M style capture, so it should be possible to hook everything in.

I have adjusted current libgphoto2 GIT to include checks that will do steps 1-4 (as they are the same as EOS M)

luffecn commented 6 years ago

I have updated my library files, but when I capture a image, the camera seems to be crashed. Details at capture_image.log

msmeissn commented 6 years ago

and your progrqms set evt outputdevice does not crash? exactly what bytes do you send?

luffecn commented 6 years ago

yes,my program is not crashed. Below is the correspondence between command and hexadecimal. 1.opensession hex:10000000010002100000000001000000 2.set PTP_OC_CANON_EOS_SetRemoteMode(0x9114) = 0x15 hex:10000000010014910100000015000000 set PTP_OC_CANON_EOS_SetEventMode(0x9115) = 0x02 hex:10000000010015910200000002000000 set PTP_DPC_CANON_EOS_EVFOutputDevice(0xD1b0) = 0x08 hex:0c0000000100109103000000 hex:1800000002001091030000000c000000b0d1000008000000

msmeissn commented 6 years ago

i changed a bit to make it align more with your camera (we did a setremotemode 0x1 instead of 0x15)

I also ordered a SX720HS from ebay for tsting :)

msmeissn commented 6 years ago

so if you can test current git, and see if it helps :/

luffecn commented 6 years ago

yes, it can capture an image:) capture_image.log I will try other features.

luffecn commented 6 years ago

Hi msmeissn, I still can't find a way to control SX720HS's zoom through usb. Do you have any suggestions? Thanks. get_config_d055.log set_config_d055.log

msmeissn commented 6 years ago

so, current git will see the powerzoom as "zoom", but currently setting it seems not to work :/

luffecn commented 5 years ago

yes, it does not work on ptp/usb, but it works on ptp/ip. I don't know why.

msmeissn commented 5 years ago

perhaps a camera limitation itself. there is some more weirdness, like it does not show the option on the second gphoto2 call and so :/ but at least other configurations work now with libgphoto2. were you able to get a liveview over ptp/iop?

luffecn commented 5 years ago

I only get a liveview over ptp/usb:) The capture data over ptp/ip from camera's mobile app.

luffecn commented 5 years ago

PTP_DPC_CANON_EOS_PowerZoomPosition works on the SX740HS, but it moves really slowly. PTP_DPC_CANON_EOS_PowerZoomSpeed seems not to work.

msmeissn commented 5 years ago

the speed might be the speed of the zooming... what values did you try setting?

do you have the id of the 740HS and debugging info so I can add it?

luffecn commented 5 years ago

summary.log capture_image.log I tried these values below. 0x00 0x48 0x4b 0x4d 0x50 0x53 0x55 0x58 0x5b 0x5d 0x60 0x63 0x65 0x68 0x6b 0x6d 0x70 0x73 0x75 0x78 0x7b 0x7d 0x80 0x83 0x85 0x88 The default value is 0x68.

msmeissn commented 5 years ago

are these the ones you tried for powerzoomposition or speed? is the value of position related to the focal length that results out of it?

luffecn commented 5 years ago

These ones I tried for speed. The position values range from 0d to 127d. Position command works but speed not.

Johnnygde commented 4 years ago

After some hours of testing, I would like to know if anybody managed to use the zoom function on either the SX720 or the SX740 yet. If it would definately work with a 740, I am willing o buy one, but I like my 720 very much.

What I need would be the following:

The only thing I achieved was capturing an image. Once I tried the wifi ptpip connection, using Entangle, it was possible to set the zoom to 127 (full zoom), but nothing in between or no option to set it back to 0 again.

I am using the latest version available with the gphoto updater ( gphoto2 2.5.23.1 - libgphoto2 2.5.26 )

If there is any option to use at least the zoom function like within the App, please let me know. In case that is not possible (yet) with a 720 or not guaranteed that it works with the 740, maybe someone could suggest an alternative compact superzoom camera that definately works with gphoto2 ?

many thanks in advance

Regards, John

gabrielesartor commented 3 years ago

Hi everyone, I'd like to buy the sx720hs or sx740hs, but I'd like to understand which one is more compatible with libgphoto2. I just need to set the zoom, capture the image and download it on Linux via USB. Any news on this topic? Thank you in advance!