From your description, it sounds like the easiest way to do this would be to have your PC monitor the trigger signal, issue commands over a USB connection for all cameras to shoot, and then upload the images from each camera. No USB remote hardware cables required - simply enough USB hub connections to provide one cable per camera. All you need then is some I/O device for your PC to accept the signal.
I also have already thought about this way. But my problem was to merge the pc monitored signal with my chdkptp console. I open the chdkptp with "chdkptp.exe -i" in a .bat file in command mode. Here I run some commands in loops from .txt files with "source xxx.txt".But how can I run some commands automaticaly in depence of the monitored signal?
If it was me, I might try hacking a USB mouse button to the trigger signal and then check for mouse events from the Lua script. I'm sure there is a better way though. When I did my photobooth project, I ran chdkptp on a Raspberry Pi so monitoring a digital signal via the Pi's I/O was very easy. I actually wrote the main loop in C and had it issue individual commands over ptp by running individual instances for chdkptp for each command.
How can I check for mouse events from the Lua script?
local status, exit_type, ret = os.execute('wait_for_shoot_signal.exe')if status and exit_type == 'exit' and ret == 0 then mc:shoot({... shoot params ... })end
self:print_cmd_status_short(self:cmdwait('preshoot'))
Code: [Select]local status, exit_type, ret = os.execute('wait_for_shoot_signal.exe')if status and exit_type == 'exit' and ret == 0 then mc:shoot({... shoot params ... })endThis assumes you provide wait_for_shoot_signal.exe which monitors your hardware and returns success (0) when the signal arrives. You could have it return a different value if you want to cancel the shot.
Quote from: reyalp on 27 / March / 2019, 14:23:50Code: [Select]local status, exit_type, ret = os.execute('wait_for_shoot_signal.exe')if status and exit_type == 'exit' and ret == 0 then mc:shoot({... shoot params ... })endThis assumes you provide wait_for_shoot_signal.exe which monitors your hardware and returns success (0) when the signal arrives. You could have it return a different value if you want to cancel the shot.Thanks a lot for this!I wrote a small Skript and made an .exe out of it. If I use the lua code with my .exe the variables , status, exit_code and ret are nil. I tried different things to get a return here. How can I get a return in case the .exe exits? And store this info into a variable?
Thanks a lot for this!I wrote a small Skript and made an .exe out of it. If I use the lua code with my .exe the variables , status, exit_code and ret are nil. I tried different things to get a return here. How can I get a return in case the .exe exits? An dstore this info into a variable?
if I use the lua code with my .exe the variables , status, exit_code and ret are nil. I tried different things to get a return here.
What is the script you "made an .exe out of" ?Normally an .exe would be a windows executable, but you could use a batch file or any other program you can run from the command line with os.execute. If you are not using windows, then a shell script or native executable would be fine too.
Can you show the code you are using? The only reason I can think all would be nil is if you are trying to access them outside the scope of the local, like if you are doing each line with ! commands.
!local status, exit_type, ret = os.exeute('wait_for_shoot_signal.exe')!print(status)!print(exit_type)!print(ret)!if status and exit_type == 'nil' and ret == 0 then print("sucess") end
FWIW, the suggestion I added in edit ( remote_on_wait ) might be a better solution for you, I didn't remember that feature until after I wrote the first part.
Quote from: reyalp on 04 / April / 2019, 13:55:13What is the script you "made an .exe out of" ?Normally an .exe would be a windows executable, but you could use a batch file or any other program you can run from the command line with os.execute. If you are not using windows, then a shell script or native executable would be fine too.I wrote it in Java. Yes it is Windows executable and works fine. It also opens with "os.execute()". But I can`t get some returns.QuoteCan you show the code you are using? The only reason I can think all would be nil is if you are trying to access them outside the scope of the local, like if you are doing each line with ! commands.Yes I did it with '!'. Code: [Select]!local status, exit_type, ret = os.execute('wait_for_shoot_signal.exe')!print(status)!print(exit_type)!print(ret)!if status and exit_type == 'nil' and ret == 0 then print("sucess") endQuoteFWIW, the suggestion I added in edit ( remote_on_wait ) might be a better solution for you, I didn't remember that feature until after I wrote the first part.This would be with trigger over the USB Cable, right? I would prefer it, if the other solution would work because I have two separated systems. On for shoot and download (USB) and the oter for the trigger (over PC Input).
!local status, exit_type, ret = os.execute('wait_for_shoot_signal.exe')!print(status)!print(exit_type)!print(ret)!if status and exit_type == 'nil' and ret == 0 then print("sucess") end
!local status, exit_type, ret = os.execute('wait_for_shoot_signal.exe') print(status) print(exit_type)print(ret)
Started by POMAH General Help and Assistance on using CHDK stable releases
Started by reyalp « 1 2 » LUA Scripting
Started by Salvatore Chiarelli General Discussion and Assistance
Started by lapser « 1 2 3 4 5 » General Discussion and Assistance
Started by c_joerg « 1 2 » LUA Scripting