Focus bracketing scripts sometimes stops at "shoot" command - page 3 - Script Writing - CHDK Forum supplierdeeply

Focus bracketing scripts sometimes stops at "shoot" command

  • 76 Replies
  • 11751 Views
*

Offline lapser

  • *****
  • 1093
Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #20 on: 23 / December / 2012, 09:42:14 »
Advertisements
The script in #8 did´t work without the two sleep commands, so its not only shoot that has my problem...
I will see if I can narrow it down somehow.
What are the conditions that have to be met, to make a succesful shoot ?
Flash ready, focus ready etc .
Is it possible to print them in the script to see whats different when the script stops ?
http://chdk.wikia.com/wiki/CHDK_Scripting_Cross_Reference_Page

Take a look at the lens functions section at the above link. You may need to wait for get_focus_ok after you do set_focus.

There's also a section in the enhanced photo operations menu called "bracketing in continuous mode." Unfortunately, it doesn't do anything on my sx260 unless I'm in manual focus mode. Unfortunately, what it does in manual focus mode is shut down the camera.

To see what's happening, try adding a print statement right before the sleep in your wait loop. You could try waiting for get_focus_ok instead of get_shooting. There's also a get_flash_ready function. Your wait loop needs to wait for get_flash_ready, get_focus_ok, and get_shooting.

EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #21 on: 23 / December / 2012, 10:23:06 »
What are the conditions that have to be met, to make a succesful shoot ?
FWIW,  the shoot() command does a half press, waits for the PROPCASE_SHOOTING to indicate the camera is ready, then waits for PROPCASE_IS_FLASH_READY to indicate the flash is ready.  Once that's done,  it does a full press.

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline lapser

  • *****
  • 1093
Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #22 on: 29 / December / 2012, 12:45:25 »
@skrylten,

Will you try installing the attached test version of CHDK on your camera and see if the original "shoot" version of your script works?

Will you also install the attached NewClick.lua script and try that? First, it shoots pictures as fast as possible with shoot_full_only. Press <set> to move on to the next test.

The second test is just a loop of shoot calls with no delay. Try that with your flash on and see if it works. Press <menu> to exit the script.

After testing, just install your original version of CHDK again.

Thanks!

EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #23 on: 30 / December / 2012, 05:27:59 »
@lapser
Installed your testversion, but both my script and NewClick.lua still randomly stops at the shoot command
:(
I have noticed one strange thing :
When the script stops, I interrupt it with a key press. If I start it again, it loops twice for every shoot .
For every stop, it loops one more time, for every shoot.
It doesn´t behave like this, if I interrupt a "running" script.


Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #24 on: 30 / December / 2012, 09:54:59 »
More testing using this loop that seems to work with flash...
---------------------------------
  for s=1 to n
   press "shoot_half"
   do
      sleep 50
   until get_shooting = 1
   click "shoot_full_only"
   release "shoot_half"
   get_focus f
   get_dof d
   g=f+d*2/3
   set_focus g
   sleep 1500   
   print g,d
   if g>50000 then s=n
   if d<0 then s=n
  next s
----------------------------
I used a "print get_flash_ready,get_shooting,get_focus_ok" between each line to se what happens during the script.
- A print between    click "shoot_full_only" and  release "shoot_half" sometimes crashes the camera
- All 3 parameters are always the same.
- They are 1 after  press "shoot_half" until  sleep 1500, otherwise 0.
- If I replace the sleep 1500 with a wait for get_shooting=0 , the parameters sometimes change from 1 to 0 somewhere between these lines   
   click "shoot_full_only"
   release "shoot_half"
   get_focus f
   get_dof d
   g=f+d*2/3
   set_focus g
as a result the script loops without making a succesful photo.

*

Offline lapser

  • *****
  • 1093
Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #25 on: 30 / December / 2012, 19:10:46 »
OK, thanks. I'm re-working the whole thing, so I'll post something when I get it working.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

*

Online philmoz

  • *****
  • 3156
    • Photos
Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #26 on: 31 / December / 2012, 04:31:16 »
More testing using this loop that seems to work with flash...
---------------------------------
  for s=1 to n
   press "shoot_half"
   do
      sleep 50
   until get_shooting = 1
   click "shoot_full_only"
   release "shoot_half"
   get_focus f
   get_dof d
   g=f+d*2/3
   set_focus g
   sleep 1500   
   print g,d
   if g>50000 then s=n
   if d<0 then s=n
  next s
----------------------------
I used a "print get_flash_ready,get_shooting,get_focus_ok" between each line to se what happens during the script.
- A print between    click "shoot_full_only" and  release "shoot_half" sometimes crashes the camera
- All 3 parameters are always the same.
- They are 1 after  press "shoot_half" until  sleep 1500, otherwise 0.
- If I replace the sleep 1500 with a wait for get_shooting=0 , the parameters sometimes change from 1 to 0 somewhere between these lines   
   click "shoot_full_only"
   release "shoot_half"
   get_focus f
   get_dof d
   g=f+d*2/3
   set_focus g
as a result the script loops without making a succesful photo.

Can you try it with the attached version please.

One thing to keep in mind if you are using flash is that after a few shots the flash recharge time will increase significantly. On my G1X I get about 10-12 shots in quick succession at low flash power then the recharge time goes to about 8 seconds between shots. So it can look like the script has hung in the shoot command; but it may just be waiting for the flash to charge.

I believe there may be one scenario where 'shoot' can hang; but I think it is very rare, although using flash seems to increase the likelihood. The attached version should fix it - if the issue is what I think it is then the script should not hang; but it may skip shots.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #27 on: 31 / December / 2012, 05:31:48 »
Thanks philmoz !

First I will attach the logfiles of what is happening with my two scripts with the old version, before I test your version.

Manual Mode, with flash, power adapter connected.
Code: [Select]
rem Leif Karlsson
@title Test Focus bracketing
@param n Max number of steps
@default n 300

sleep 2000

print_screen 2

  for s=1 to n
  print "A",get_shooting,get_flash_ready,get_focus_ok
   shoot
     print "B",get_shooting,get_flash_ready,get_focus_ok
   get_focus f
     print "C",get_shooting,get_flash_ready,get_focus_ok
   get_dof d
     print "D",get_shooting,get_flash_ready,get_focus_ok
   g=f+d*2/3
     print "E",get_shooting,get_flash_ready,get_focus_ok
   set_focus g
     print "F",get_shooting,get_flash_ready,get_focus_ok
   print g,d
     print "G",get_shooting,get_flash_ready,get_focus_ok
   if g>50000 then s=n
     print "H",get_shooting,get_flash_ready,get_focus_ok
   if d<0 then s=n
     print "I",get_shooting,get_flash_ready,get_focus_ok
  next s
 
 print_screen 0

end

Logfile (green "loop" is succesful photo)

A 0 0 0 B 0 0 0 C 0 0 0 D 0 0 0 E 0 0 0 F 0 0 0 851 3 G 0 0 0 H 0 0 0 I 0 0 0
A 0 0 0 B 0 0 0 C 0 0 0 D 0 0 0 E 0 0 0 F 0 0 0 853 3 G 0 0 0 H 0 0 0 I 0 0 0
A 0 0 0 B 0 0 0 C 0 0 0 D 0 0 0 E 0 0 0 F 0 0 0 854 3 G 0 0 0 H 0 0 0 I 0 0 0
A 0 0 0 B 0 0 0 C 0 0 0 D 0 0 0 E 0 0 0 F 0 0 0 856 3 G 0 0 0 H 0 0 0 I 0 0 0
A 0 0 0 B 0 0 0 C 0 0 0 D 0 0 0 E 0 0 0 F 0 0 0 858 3 G 0 0 0 H 0 0 0 I 0 0 0

A 0 0 0
Here the script stops, but I think its still running (waiting for some condition in the shoot command ?)
If I interrupt it (pressing the button) and starts it again. It looks the same but only every second loop gives a succesful photo.
A 0 0 0 B 0 0 0 C 0 0 0 D 0 0 0 E 0 0 0 F 0 0 0 888 3 G 0 0 0 H 0 0 0 I 0 0 0
A 0 0 0 B 0 0 0 C 0 0 0 D 0 0 0 E 0 0 0 F 0 0 0 890 3 G 0 0 0 H 0 0 0 I 0 0 0
A 0 0 0 B 0 0 0 C 0 0 0 D 0 0 0 E 0 0 0 F 0 0 0 892 3 G 0 0 0 H 0 0 0 I 0 0 0
A 0 0 0 B 0 0 0 C 0 0 0 D 0 0 0 E 0 0 0 F 0 0 0 893 3 G 0 0 0 H 0 0 0 I 0 0 0
A 0 0 0 B 0 0 0 C 0 0 0 D 0 0 0 E 0 0 0 F 0 0 0 894 3 G 0 0 0 H 0 0 0 I 0 0 0
A 0 0 0 B 0 0 0 C 0 0 0 D 0 0 0 E 0 0 0 F 0 0 0 896 3 G 0 0 0 H 0 0 0 I 0 0 0
A 0 0 0 B 0 0 0 C 0 0 0 D 0 0 0 E 0 0 0 F 0 0 0 898 3 G 0 0 0 H 0 0 0 I 0 0 0
A 0 0 0 B 0 0 0 C 0 0 0 D 0 0 0 E 0 0 0 F 0 0 0 900 3 G 0 0 0 H 0 0 0 I 0 0 0
A 0 0 0 B 0 0 0 C 0 0 0 D 0 0 0 E 0 0 0 F 0 0 0 902 4 G 0 0 0 H 0 0 0 I 0 0 0
A 0 0 0 B 0 0 0 C 0 0 0 D 0 0 0 E 0 0 0 F 0 0 0 905 5 G 0 0 0 H 0 0 0 I 0 0 0
A 0 0 0
Here the script stops again ...


Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #28 on: 31 / December / 2012, 06:39:57 »
Next script, but without sleep 1500 to provoce the error...
Code: [Select]
rem Leif Karlsson
@title Test Focus bracketing flash
@param n Max number of steps
@default n 300

sleep 2000

print_screen 1

  for s=1 to n
  print "A",get_shooting,get_flash_ready,get_focus_ok
   press "shoot_half"
  print "B",get_shooting,get_flash_ready,get_focus_ok
   do
      sleep 50
   until get_shooting = 1
  print "C",get_shooting,get_flash_ready,get_focus_ok
   click "shoot_full_only"
  print "D",get_shooting,get_flash_ready,get_focus_ok
   release "shoot_half"
  print "E",get_shooting,get_flash_ready,get_focus_ok
   get_focus f
  print "F",get_shooting,get_flash_ready,get_focus_ok
   get_dof d
  print "G",get_shooting,get_flash_ready,get_focus_ok
   g=f+d*2/3
  print "H",get_shooting,get_flash_ready,get_focus_ok
   set_focus g
  print "I",get_shooting,get_flash_ready,get_focus_ok
rem   sleep 1500   
   print g,d
  print "J",get_shooting,get_flash_ready,get_focus_ok
   if g>50000 then s=n
  print "K",get_shooting,get_flash_ready,get_focus_ok
   if d<0 then s=n
  print "L",get_shooting,get_flash_ready,get_focus_ok
  next s
 
 print_screen 0

end

Manual Mode, with flash, power adapter connected.

Logfile (green "loop" is succesful photo)

A 0 0 0 B 0 0 0 C 1 1 1 D 1 1 1 E 0 0 0 F 0 0 0 G 0 0 0 H 0 0 0 I 0 0 0 822 3 J 0 0 0 K 0 0 0 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 D 1 1 1 E 1 1 1 F 1 1 1 G 1 1 1 H 1 1 1 I 1 1 1 825 5 J 1 1 1 K 1 1 1 L 1 1 1
A 1 1 1 B 0 0 0 C 1 1 1 D 1 1 1 E 0 0 0 F 0 0 0 G 0 0 0 H 0 0 0 I 0 0 0 828 5 J 0 0 0 K 0 0 0 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 D 1 1 1 E 0 0 0 F 0 0 0 G 0 0 0 H 0 0 0 I 0 0 0 831 5 J 0 0 0 K 0 0 0 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 D 1 1 1 E 1 1 1 F 1 1 1 G 1 1 1 H 1 1 1 I 1 1 1 833 5 J 1 1 1 K 1 1 1 L 1 1 1
A 0 0 0 B 0 0 0 C 1 1 1 D 1 1 1 E 0 0 0 F 0 0 0 G 0 0 0 H 0 0 0 I 0 0 0 836 5 J 0 0 0 K 0 0 0 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 D 1 1 1 E 0 0 0 F 0 0 0 G 0 0 0 H 0 0 0 I 0 0 0 839 5 J 0 0 0 K 0 0 0 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 D 1 1 1 E 1 1 1 F 1 1 1 G 1 1 1 H 1 1 1 I 1 1 1 842 5 J 1 1 1 K 1 1 1 L 1 1 1
A 1 1 1 B 0 0 0
Here the camera crashes, black screen, but can be restarted by power on/off

Now with the sleep 1500
A 0 0 0 B 0 0 0 C 1 1 1 D 1 1 1 E 1 1 1 F 1 1 1 G 1 1 1 H 1 1 1 I 1 1 1 823 5 J 0 0 0 K 0 0 0 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 D 1 1 1 E 1 1 1 F 1 1 1 G 1 1 1 H 1 1 1 I 1 1 1 826 5 J 0 0 0 K 0 0 0 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 D 1 1 1 E 1 1 1 F 1 1 1 G 1 1 1 H 1 1 1 I 1 1 1 829 5 J 0 0 0 K 0 0 0 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 D 1 1 1 E 1 1 1 F 1 1 1 G 1 1 1 H 1 1 1 I 1 1 1

Evrey loop succesful until the camera crashes...

With sleep 1500 but without print "D"
A 0 0 0 B 0 0 0 C 1 1 1 E 1 1 1 F 1 1 1 G 0 0 0 H 0 0 0 I 0 0 0 823 5 J 0 0 0 K 0 0 0 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 E 1 1 1 F 1 1 1 G 1 1 1 H 1 1 1 I 1 1 1 826 5 J 0 0 0 K 0 0 0 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 E 1 1 1 F 1 1 1 G 1 1 1 H 1 1 1 I 1 1 1 829 5 J 0 0 0 K 0 0 0 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 E 1 1 1 F 1 1 1 G 1 1 1 H 1 1 1 I 1 1 1 832 5 J 0 0 0 K 0 0 0 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 E 1 1 1 F 1 1 1 G 1 1 1 H 1 1 1 I 1 1 1 835 5 J 0 0 0 K 0 0 0 L 0 0 0

This is the version thats stable and never(?) stops. During this test it missed in the first loop (haven´t seen this before)

Without sleep 1500 and without print "D"
Crashes in the first loop during 3 tests ...

Without sleep 1500 and without more print commands ...
A 0 0 0 B 0 0 0 C 1 1 1 E 1 1 1 G 1 1 1 I 1 1 1 1059 7 L 1 1 1
A 1 1 1 B 1 1 1 C 1 1 1 E 0 0 0 G 0 0 0 I 0 0 0 1062 7 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 E 0 0 0 G 0 0 0 I 0 0 0 1066 7 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 E 1 1 1 G 1 1 1 I 1 1 1 1069 7 L 1 1 1
A 1 1 1 B 1 1 1 C 1 1 1 E 0 0 0 G 0 0 0 I 0 0 0 1073 7 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 E 0 0 0 G 0 0 0 I 0 0 0 1078 7 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 E 1 1 1 G 1 1 1 I 1 1 1 1082 7 L 1 1 1
A 1 1 1 B 1 1 1 C 0 0 0 E 0 0 0 G 0 0 0 I 1 1 1 1086 7 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 E 0 0 0 G 0 0 0 I 0 0 0 1090 7 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 E 0 0 0 G 0 0 0 I 0 0 0 1095 7 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 E 1 1 1 G 1 1 1 I 1 1 1 1099 7 L 1 1 1
A 1 1 1 B 1 1 1 C 1 1 1 E 0 0 0 G 0 0 0 I 0 0 0 1103 7 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 E 0 0 0 G 0 0 0 I 0 0 0 1107 7 L 0 0 0
A 0 0 0 B 0 0 0 C 1 1 1 E 1 1 1 G 1 1 1 I 1 1 1 1111 7 L 1 1 1
A 1 1 1 B 1 1 1
Really strange, but this script seems to crash instead of just stop, when I use several print-commands...


Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #29 on: 31 / December / 2012, 07:10:37 »
@philmoz

I´m impressed ! You are spot on.

I used your version with my first script (with shoot) to make a 276 shot stack (with flash).
It never stopped , but skipped ca 5 shots as you suspected.

Great work !
Whats the solution ?

/Leif K

 

Related Topics