supplierdeeply

SX20is won't enter shooting mode with chdkptp

  • 13 Replies
  • 2710 Views
SX20is won't enter shooting mode with chdkptp
« on: 01 / January / 2017, 23:35:41 »
Advertisements
I'm ultimately looking for full control of my SX20is (firmware 1.02b) on macOS 10.12. I installed CHDK successfully using STICK, and everything seems fine there.

I haven't found a version of chdkptp that works on mac (or at least not one that's just 'put this in the terminal and go'), so I set up a linux mint virtualbox vm to run it. The vm connects to my camera just fine, and I can also connect to it from chdkptp. The gui freezes after my first click (probably for another post), but I can use the cli for now.

Once the usb is plugged in, no matter how I power on the camera (power btn: click or hold, or play btn) I end up in playback mode, and can't switch to shooting mode. In the chdkptp cli, typing the 'rec' command yields 'ERROR: switch failed'.

A few theories:
1) I'm missing something obvious   <= probably this
2) Some issue with linux mint (I could try another OS/distro)
3) An issue with using chdkptp inside a vm
4) The SX20is doesn't like chdkptp

Any help would be greatly appreciated, as I'm unable to physically interact with the camera (disabled); so it's either tell someone which buttons to press to change settings or send commands through software.

Re: SX20is won't enter shooting mode with chdkptp
« Reply #1 on: 02 / January / 2017, 06:10:28 »
Once the usb is plugged in, no matter how I power on the camera (power btn: click or hold, or play btn) I end up in playback mode, and can't switch to shooting mode. In the chdkptp cli, typing the 'rec' command yields 'ERROR: switch failed'.
A typical problem with chdkptp and Linux is making sure that something in Linux (typically gphoto) does not grab the camera/USB port when you connect the camera.

On my Fedora box, if I issue the following command I can disable that :

Code: [Select]
pkill gvfs-gphoto2-vo

There is a tread that talks about how to do that more generically - Usage Notes : Linux
« Last Edit: 02 / January / 2017, 06:14:00 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 11496
Re: SX20is won't enter shooting mode with chdkptp
« Reply #2 on: 02 / January / 2017, 13:51:12 »
I suspect waterwingz is correct. One usual symptom of this problem is that the camera screen goes black after USB is connected.

Note that in the case of running in a VM, you'll also need to ensure the host doesn't attempt to access the camera. I'd assume this can be done, but the specifics will depend on your VM platform and host OS. I have used chdkptp successfully in virtualbox on windows, but in that case the libusb driver was already installed for the camera, so windows doesn't try to do anything with the camera on connect.
Don't forget what the H stands for.

Re: SX20is won't enter shooting mode with chdkptp
« Reply #3 on: 02 / January / 2017, 18:58:56 »
I suspect waterwingz is correct. One usual symptom of this problem is that the camera screen goes black after USB is connected.
Will the camera's screen always go black once accessed, or does that depend on the computer's os? I ask because the screen only goes black once I tell virtualbox to let my vm access the camera, not when it is physically plugged in to my mac. If the host os had accessed it, would the screen already be black before the vm accessed it?

Also @reyalp, are you the one who was working on a mac version of chdkptp or am I mistaken? I've seen your name elsewhere on the forum.
« Last Edit: 02 / January / 2017, 19:02:55 by allclay1993 »


*

Offline reyalp

  • ******
  • 11496
Re: SX20is won't enter shooting mode with chdkptp
« Reply #4 on: 02 / January / 2017, 20:09:31 »
Will the camera's screen always go black once accessed, or does that depend on the computer's os?  I ask because the screen only goes black once I tell virtualbox to let my vm access the camera, not when it is physically plugged in to my mac. If the host os had accessed it, would the screen already be black before the vm accessed it?
Most likely. The camera screen goes black when the camera receives some standard (non CHDK) PTP commands, and after that, you cannot switch to rec mode. This usually happens when the OS mounts the camera or starts some app to transfer pictures.

From your description, it sounds like you only need to adjust the configuration in the Linux guest OS. The Linux section of https://app.assembla.com/spaces/chdkptp/wiki/Install has some information, but the details depend on the distro and configuration.

Quote
Also @reyalp, are you the one who was working on a mac version of chdkptp or am I mistaken? I've seen your name elsewhere on the forum.
I am the main author of chdkptp, but I don't maintain a Mac version, because I don't have any Macs. Some people had it working in the past (see https://app.assembla.com/spaces/chdkptp/subversion/source/HEAD/trunk/README-OSX.TXT) but my impression is that recent versions of OSX have caused problems with USB access
Don't forget what the H stands for.

Re: SX20is won't enter shooting mode with chdkptp
« Reply #5 on: 02 / January / 2017, 21:02:44 »
So I just modified '60-libgphoto2-6.rules' according to this post, so hopefully that solves this issue. I'll check tomorrow.

Re: SX20is won't enter shooting mode with chdkptp
« Reply #6 on: 04 / January / 2017, 20:25:18 »
Ok, that didn't work. How can I determine what's grabbing the camera?

*

Offline srsa_4c

  • ******
  • 3689
Re: SX20is won't enter shooting mode with chdkptp
« Reply #7 on: 04 / January / 2017, 21:03:24 »
Ok, that didn't work. How can I determine what's grabbing the camera?
I'd try something like
Code: [Select]
ps aux | grep gphoto see if any libgphoto-related process is running.
Followed by what waterwingz was suggesting above.


Re: SX20is won't enter shooting mode with chdkptp
« Reply #8 on: 04 / January / 2017, 22:31:05 »
I'd try something like
Code: [Select]
ps aux | grep gphoto see if any libgphoto-related process is running.
I find that
Code: [Select]
ps -A | grep gph  is a little easier to read

Quote
Followed by what waterwingz was suggesting above.
FWIW, I've been having trouble lately with my attempts to kill or pkill the gphoto process.  On my latest system, they seems to respawn despite my attempts - and it didn't do that in the past.

This might take some more digging or finally puzzling out the udev rules.  Fortunately, I can download new CHDK images and scripts despite this - I just can't go into shooting mode via ptp.

 
Ported :   A1200    SD940   G10    Powershot N    G16

Re: SX20is won't enter shooting mode with chdkptp
« Reply #9 on: 04 / January / 2017, 23:31:01 »
I may have just found and fixed the issue, but am unable to test it right now. Based on what @reyalp said in this post on the same thread I referenced earlier:

My D10 and A540 however would still get accessed, no matter what I put in the rules. I verified that the rules were matching, but gphoto would still grab the cameras. After much headbanging, I realized these two cameras appear in /lib/udev/hwdb.d/20-libgphoto2-6.hwdb. Copying this to /etc/udev/hwdb.d/20-libgphoto2-6.hwdb, commenting out the section for each camera, and running udevadm hwdb --update seems to make them behave like the elph130.

The SX20is is also in that file, so hopefully that does it. Otherwise I'll give those commands a try.

Update: The combination of adding a udev rule to ignore all Canon cameras, and commenting out the section for my camera in 20-libgphoto2-6.hwdb seems to have worked. Maybe checking that file could be added to the documentation? There's a ton of Canon cameras in there.
« Last Edit: 05 / January / 2017, 16:43:25 by allclay1993 »

 

Related Topics