Remote shooting - LUA Scripting - CHDK Forum supplierdeeply

Remote shooting

  • 1 Replies
  • 2037 Views
Remote shooting
« on: 24 / December / 2019, 02:47:46 »
Advertisements
Hi

I'm very new and I'm trying to implement exposure control and remote shooting in LUA. On exposure control, I'm trying to take ideas from the KAP UAV script. But I can't seem to find any work on implementing remote shooting in LUA. Anyone here know of a good reference for implementing remote shooting?

Thanks in advance.

*

Offline reyalp

  • ******
  • 14082
Re: Remote shooting
« Reply #1 on: 24 / December / 2019, 03:54:42 »
First, I'm assuming by "remote shooting" you mean shoot and save the file directly over PTP, like the chdkptp "rs" command. If you just mean trigger a shot using PTP, the answer is different.

The simple way to remoteshoot from chdkptp lua is just to execute the remoteshoot cli command, like
Code: [Select]
cli:execute('rs')
You can use Lua string.format or concatenation set options, like
Code: [Select]
cli:execute(string.format('rs -tv=%d -svm=%d',some_tv_val,some_iso_val))
cli:execute catches any errors, and returns a status and possibly a message, which you should do something with if you want to know when things go wrong. You can use cli:print_status to do this, like
Code: [Select]
cli:print_status(cli:execute('rs'))


The multilapse.lua script at https://github.com/alesanmanoweb/multilapse-CHDK is an example of a script that uses this approach.

If you want to code the lower level bits yourself, it's rather more complicated. You can look at the code for the remoteshoot command in cli.lua, and the rsint command in rsint.lua. Both of these rely on camera side code in rlibs.lua.

rsint might be the more applicable to your case. Regular remoteshoot is intended to shoot one or more shots with settings determined in advance. rsint runs a camera side script that listens for messages which tell it to shoot, or execute other code.

BTW, you've posted related questions in quite a few different topics. Many forums encourage finding exactly the right sub-forum and topic for each post, but here we often find it works better if you just use one thread for everything related to your project. The discussion wander, but it's easier to follow. Traffic here is low enough the regulars will likely see post.
Don't forget what the H stands for.

 

Related Topics