On setting focus on Canon A4000is - Script Writing - CHDK Forum

On setting focus on Canon A4000is

  • 13 Replies
  • 7662 Views
On setting focus on Canon A4000is
« on: 13 / July / 2015, 08:38:41 »
Advertisements
Hello. I am using Canon 4000is to take time-lapse pictures with CHDKPTP (connected to a Raspberry pi).

remoteshoot plus a call to curl to upload the image works quite well, but if I listen to the camera while it's waiting between pictures, there is a little tiny noise, that seems to be compatible to the autofocus continuously trying to track things. If I perform:

Code: [Select]
cli:execute('set_aflock(1)')
before starting the remoteshoot loop, the little noise disappears, and also some tests seem to suggest the focus stays put.

Ideally, I would like to set the focus at infinity no matter what, but after having tested set_mf and set_focus, it seems I cannot make them reliably work.

Maybe, I need to disable the "continuous af" feature? Can I do so using code? The camera is mounted inside a box and while not impossible, it's a real chore to remove it. And as I do not have a battery in the camera, I've seen settings can get lost if it stays powered off for a while. Thank you

*

Offline reyalp

  • ******
  • 14125
Re: On setting focus on Canon A4000is
« Reply #1 on: 13 / July / 2015, 16:53:46 »
The answer here: http://chdk.setepontos.com/index.php?topic=12455.0 applies to this as well (use luar set_aflock())

Quote
Maybe, I need to disable the "continuous af" feature? Can I do so using code? The camera is mounted inside a box and while not impossible, it's a real chore to remove it. And as I do not have a battery in the camera, I've seen settings can get lost if it stays powered off for a while. Thank you
Setting in the Canon menu are often "UI properties", which don't currently have a good interface in CHDK. See
 http://chdk.wikia.com/wiki/User:Srsa_4c/UI_properties

Note that if you can connect the camera USB to a machine with a display (including a remote X display or VNC on your pi), you can use chdkptp live view to navigate the menu. This will be very slow on a first generation pi. Obviously this isn't a good solution for resetting stuff in the operational setup, but for development it may be more convenient than physically accessing the screen.
Don't forget what the H stands for.

Re: On setting focus on Canon A4000is
« Reply #2 on: 15 / July / 2015, 12:23:38 »
Yes, even if having to resolve the lib dependencies to enable the GUI looks more of a chore than to remove the cam from the box ;)

I will try. In any case, returning to the first part of the post, and assuming I can in fact get access to the GUI, do you think I might be able to "discover" the IDs I want to be set and their value, to be able to setup a camera completely from a script?

thank you!

*

Offline reyalp

  • ******
  • 14125
Re: On setting focus on Canon A4000is
« Reply #3 on: 15 / July / 2015, 22:04:02 »
Yes, even if having to resolve the lib dependencies to enable the GUI looks more of a chore than to remove the cam from the box ;)
FWIW, I provide a pre-built GUI executable and the required libraries on https://www.assembla.com/spaces/chdkptp/documents

You must download both the chdkptp build and the library package (chdkptp-raspbian-libs-20140331.zip)

See also
https://www.assembla.com/code/chdkptp/subversion/nodes/HEAD/trunk/README-RASPI.TXT
https://www.assembla.com/code/chdkptp/subversion/nodes/HEAD/trunk/README-RASPI-LIBS.TXT

Quote
I will try. In any case, returning to the first part of the post, and assuming I can in fact get access to the GUI, do you think I might be able to "discover" the IDs I want to be set and their value, to be able to setup a camera completely from a script?
It's possible.
Don't forget what the H stands for.

Re: On setting focus on Canon A4000is
« Reply #4 on: 16 / July / 2015, 02:16:41 »
Yes I've found the pre-built libs and well - it was easy. Thanks.

I will now try to work on the options. It seems using a simple remote X environment works quite well.

Re: On setting focus on Canon A4000is
« Reply #5 on: 16 / July / 2015, 08:42:10 »
After several tests, unfortunately the application is very unstable (it looses the connection to the camera) if I try to press the buttons to go into P mode or macro/mountain settings, so I am not able to perform this operation "remotely".

*

Offline reyalp

  • ******
  • 14125
Re: On setting focus on Canon A4000is
« Reply #6 on: 16 / July / 2015, 15:39:54 »
After several tests, unfortunately the application is very unstable (it looses the connection to the camera) if I try to press the buttons to go into P mode or macro/mountain settings, so I am not able to perform this operation "remotely".
Does the camera crash?

Are there any USB related messages in the system logs? Errors in the chdkptp console?
Don't forget what the H stands for.

Re: On setting focus on Canon A4000is
« Reply #7 on: 16 / July / 2015, 16:45:06 »
What happens when I press "up" is:

the chdkptp gui window shows:
Code: [Select]
live timer update error
I/O errorlive timer update error
I/O errorERROR: I/O error

The syslog has:
Code: [Select]
Jul 16 20:40:26 cameraNord kernel: [  990.492330] usb 1-1.2: USB disconnect, device number 6
Jul 16 20:40:27 cameraNord kernel: [  991.752760] usb 1-1.2: new high-speed USB device number 7 using dwc_otg
Jul 16 20:40:27 cameraNord kernel: [  991.854739] usb 1-1.2: New USB device found, idVendor=04a9, idProduct=3243
Jul 16 20:40:27 cameraNord kernel: [  991.854815] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jul 16 20:40:27 cameraNord kernel: [  991.854836] usb 1-1.2: Product: Canon Digital Camera
Jul 16 20:40:27 cameraNord kernel: [  991.854853] usb 1-1.2: Manufacturer: Canon Inc.
Jul 16 20:40:27 cameraNord kernel: [  991.854873] usb 1-1.2: SerialNumber: 0DA1367F16ED4CD585945522A77C3762

The camera is in my opinion crashed as I need to turn it off an on again to be able to connect to it. Note that if I press the "menu" or "setting" buttons, those work correctly.

*

Offline reyalp

  • ******
  • 14125
Re: On setting focus on Canon A4000is
« Reply #8 on: 16 / July / 2015, 17:59:25 »
What happens when I press "up" is:
OK that sounds like a crash.
What have you done before pressing up (switched to rec mode, sent other key presses, other script commands?)

Can you do the same sequence from the CLI and see if it still crashes? Sending
=click'up'
should be equivalent to the "up" button in the GUI.

From what you've described, this seems more like CHDK triggering a firmware crash than something specific to live view.

If the camera is crashing, a romlog may help, see http://chdk.wikia.com/wiki/Debugging#Camera_crash_logs_.28romlog.29

Normally you would get this from the CHDK menu, but if your cameras physical controls aren't accessible, you should be able to use the romlog.lua script like

Code: [Select]
=loadfile('A/CHDK/SCRIPTS/TEST/romlog.lua')()
and then download a/romlog.log

Check that the date/time at the top of the romlog matches the time of the last crash, the romlog stays until it's overwritten, so if your problem doesn't trigger one you might see one from an older crash.
Don't forget what the H stands for.

Re: On setting focus on Canon A4000is
« Reply #9 on: 17 / July / 2015, 03:08:34 »
Can you do the same sequence from the CLI and see if it still crashes? Sending
=click'up'
should be equivalent to the "up" button in the GUI.

Yes;

Code: [Select]
# ./chdkptp.sh
___> connect
connected: Canon PowerShot A4000 IS, max packet size 512
con> rec
con 1> =click'up'
con 2> =click'up'
ERROR: I/O error


Note that when I issue the first "click" the camera already complains and goes into play mode. I issued a second click just to show that it's not connected anymore.

Quote from: reyalp
What have you done before pressing up (switched to rec mode, sent other key presses, other script commands?)

Yes I switched to rec mode and enabled the live view to show the display, nothing more than that.

I will now proceed and try to create the romlog.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal