Mini-Help for a mini-lua script - Script Writing - CHDK Forum

Mini-Help for a mini-lua script

  • 28 Replies
  • 13165 Views
Mini-Help for a mini-lua script
« on: 04 / August / 2014, 18:37:25 »
Advertisements
I should like to set my ixus 125 in Long Shutter mode and Self-Timer at 10 secs via script.
So i tryed

Code: [Select]
--[[
@title Night_Scene
]]

capmode=require("capmode")
props=require("propcase")

capmode.set("SCN_LONG_SHUTTER")                -- mode
sleep(1000)                                    -- pause
set_prop(227, 2)                               -- Self-Timer 10 sec
sleep(1000)                                    -- pause
exit_alt()                                     -- done

The capmode "SCN_LONG_SHUTTER" works fine, the set_prop for self-timer doesn't   ???
According to the wiki PropertyCase page
227 should be the right # on DigicV cams.

Any help?
Thanks in advance

Re: Mini-Help for a mini-lua script
« Reply #1 on: 04 / August / 2014, 19:13:55 »
Off the top of my head, I suppose it's possible that prop 227 is "read-only".

Try this :

Code: [Select]
--[[
@title Night_Scene Test
]]

print("prop 227="..get_prop(227))
sleep(2000)
set_prop(227, 1)
print("prop 227="..get_prop(227))
sleep(1000)
set_prop(227, 2) 
print("prop 227="..get_prop(227))
sleep(1000) 

Another wild guess is that it has something to do with SCN_LONG_SHUTTER ?  Try your script without that line included?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Mini-Help for a mini-lua script
« Reply #2 on: 04 / August / 2014, 19:28:14 »
Off the top of my head, I suppose it's possible that prop 227 is "read-only".

Try this :

Code: [Select]
--[[
@title Night_Scene Test
]]

print("prop 227="..get_prop(227))
sleep(2000)
set_prop(227, 1)
print("prop 227="..get_prop(227))
sleep(1000)
set_prop(227, 2) 
print("prop 227="..get_prop(227))
sleep(1000) 

Another wild guess is that it has something to do with SCN_LONG_SHUTTER ?  Try your script without that line included?

Your test prints on display:

Code: [Select]
prop 227-0
prop 227-1
prop 227-2

Commenting out the capmode doesn't help

Re: Mini-Help for a mini-lua script
« Reply #3 on: 04 / August / 2014, 19:34:24 »
Try setting the self timer from the Canon menu to different settings and run this script after each :

Code: [Select]
--[[
@title Night_Scene Test2
]]
print("prop 227="..get_prop(227))
sleep(2000)
Ported :   A1200    SD940   G10    Powershot N    G16


Re: Mini-Help for a mini-lua script
« Reply #4 on: 04 / August / 2014, 19:42:28 »
Props are:

0 x off
1 x 2 sec
2 x 10 sec
3 x custom timer

Re: Mini-Help for a mini-lua script
« Reply #5 on: 04 / August / 2014, 19:51:01 »
Tried it on my A1200.  Can read the prop, set it, but the camera ignores what I set.  Just like you.

I'll play with it a bit more.

Incidentally,   the line at the top of your script that says :
Code: [Select]
props=require("propcase")lets you reference the various propcase values by name like this:

Code: [Select]
set_prop(props.TIMER_MODE,1)
get_prop(props.TIMER_MODE)

The available strings are on your SD card in the A/CHDK./LUALIB/GEN folder.

This has the advantage of letting your script work without modification on cameras that use different propsets.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Mini-Help for a mini-lua script
« Reply #6 on: 04 / August / 2014, 19:57:46 »
Thanks for your help WW
I'll play a bit more with those values tomorrow ... here it's time for bed now  :)

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Mini-Help for a mini-lua script
« Reply #7 on: 04 / August / 2014, 19:58:20 »
Do you also need to set 228 (TIMER_DELAY)?

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)
  g7x2 (1.01a, 1.01b, 1.10b)


Re: Mini-Help for a mini-lua script
« Reply #8 on: 04 / August / 2014, 20:21:15 »
Do you also need to set 228 (TIMER_DELAY)?
Phil.
I was going to try that but propset4 does not have a TIMER_DELAY value defined. 

Update 1 :  I read the value in 228 anyway and when timer mode is set to 2 in the Canon menu, it reads 10000.  Which sounds about right.

Update 2 : writing to both 227 & 228 has no apparent effect.
« Last Edit: 04 / August / 2014, 20:28:16 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline nafraf

  • *****
  • 1308
Re: Mini-Help for a mini-lua script
« Reply #9 on: 04 / August / 2014, 23:55:20 »
Some tests on sx160 (propset 5):
- TIMER_MODE = 4 if FaceSelf-Timer capture mode selected. This is not documented on propset5.h
- If TIMER_MODE = 3 (Custom) User can configure the number of shoots using Canon interface. That number is shown in propcase 377.  Maybe we can add to propset5.h:
Code: [Select]
#define PROPCASE_TIMER_SHOOTS                    377        // Number of shoots for TIMER_MODE=Custom

Writing to those propcase (TIMER_MODE, TIMER_DELAY, "TIMER_SHOOTS"), I did not see any effect.



 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal