Daemon script - Script Writing - CHDK Forum supplierdeeply

Daemon script

  • 3 Replies
  • 2315 Views
Daemon script
« on: 09 / April / 2015, 16:30:55 »
Advertisements
I am working on an application where I generally want the camera to work as normal as possible, with the possibility of a script spying/intervening at selected hook-points.

It seems that whenever I run a script, it takes full control over the camera. Is it possible to run the script as a daemon?

*

Offline reyalp

  • ******
  • 14114
Re: Daemon script
« Reply #1 on: 09 / April / 2015, 16:51:49 »
I am working on an application where I generally want the camera to work as normal as possible, with the possibility of a script spying/intervening at selected hook-points.

It seems that whenever I run a script, it takes full control over the camera. Is it possible to run the script as a daemon?
Not really, but you can write a script that passes most key presses through to the canon firmware. The test script posted in http://chdk.setepontos.com/index.php?topic=12244.0 and the contae script posted in http://chdk.setepontos.com/index.php?topic=11081.msg120840#msg120840 are examples.

Note that you cannot pass keys to CHDK in the same way, you would need to exit the script to interact with CHDK menus.
Don't forget what the H stands for.

Re: Daemon script
« Reply #2 on: 09 / April / 2015, 19:44:24 »
Is it possible to run the script as a daemon?
Well, technically it's possible to have a script exit CHDK <ALT> mode and run while the camera is in "normal" operations mode.   The script can also re-enter <ALT> mode.   See exit_alt()  and enter_alt().

Here's a simplistic example :
Code: [Select]
--[[
@title daemon
@chdk_version 1.3
--]]
i=1
sleep(1000)
exit_alt()
repeat
   sleep(1000)
   draw_string(50, 50, i , 257, 258, 2)
   i=i+1
until false

But as reyalp will be quick to point out,  that's a mode where the script and camera behavior is somewhat undefined.    So you would have to try that at your own risk.
« Last Edit: 09 / April / 2015, 20:06:32 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Daemon script
« Reply #3 on: 29 / April / 2015, 18:06:01 »
I made a small framework for this.

http://chdk.setepontos.com/index.php?topic=12351.new#new

So far I have only tried it wit a small demo example. But it seems to work neatly.

/HrClausen


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal