How to STOP script via USB remote?

  • 37 Replies
  • 3406 Views
*

Offline Paco

  • **
  • 77
How to STOP script via USB remote?
« on: 25 / June / 2016, 22:06:01 »
Advertisements

I am using CHDK 1.2 on a Canon A530 and I'm triggering the interval.bas script via USB. The problem is, I can start the script but can't stop it,  using the USB cable. I found the thread Remote USB trigger -start and stop script and tried the script posted by WaterwingZ without success. Is there a setting that enables stopping a script? If not, what code do I need to add to the script to get this functionality?










 

Re: How to STOP script via USB remote?
« Reply #1 on: 25 / June / 2016, 22:17:02 »

I am using CHDK 1.2 on a Canon A530 and I'm triggering the interval.bas script via USB. The problem is, I can start the script but can't stop it,  using the USB cable. I found the thread Remote USB trigger -start and stop script and tried the script posted by WaterwingZ without success. Is there a setting that enables stopping a script? If not, what code do I need to add to the script to get this functionality?
Once a script is running,  it takes a trivial amount of additional code to have it watch the USB remote status and halt the next time the remote is activated.

If you need help,  I can post a version of interval.lua to do that for you.

Edit 1 :  modified script attached.  Tested on my G10 with a USB remote switch.
Edit 2 :  slight change to script to make it more responsive
« Last Edit: 25 / June / 2016, 23:05:35 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline Paco

  • **
  • 77
Re: How to STOP script via USB remote?
« Reply #2 on: 26 / June / 2016, 04:29:03 »
Thanks for the quick reply. The script works well. I had to use M mode for best results.

Re: How to STOP script via USB remote?
« Reply #3 on: 26 / June / 2016, 07:16:47 »
I had to use M mode for best results.
Does "best results" mean best exposure or best performance of the remote?

I assume you mean best exposure as the script does not make any exposure settings.  When it runs, it simple takes a picture the exact same way as pressing the camera's shutter button.  So whatever exposure settings & shooting mode are set for the camera using the Canon controls are what you get.
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline Paco

  • **
  • 77
Re: How to STOP script via USB remote?
« Reply #4 on: 26 / June / 2016, 14:22:08 »
Actually I meant best performance of the remote but now I'm not so sure. 'Auto' required 2 USB on/off cycles to stop the script. 'M' and 'P' only required one when I briefly tested the script. Just now I tested all 3 modes and they all worked with just one cycle. However, earlier I ran the script for about 10 minutes using 'M' mode and it required 2 cycles to stop. So I don't know now if there is any benefit. BTW I set the interval to 0 if that matters.

Re: How to STOP script via USB remote?
« Reply #5 on: 26 / June / 2016, 14:25:28 »
Actually I meant best performance of the remote but now I'm not so sure. 'Auto' required 2 USB on/off cycles to stop the script. 'M' and 'P' only required one when I briefly tested the script. Just now I tested all 3 modes and they all worked with just one cycle. However, earlier I ran the script for about 10 minutes using 'M' mode and it required 2 cycles to stop. So I don't know now if there is any benefit. BTW I set the interval to 0 if that matters.
With the interval at zero, the camera will be really busy taking pictures, processing the images,  and writing to the SD card.  M and P mode might take less processing by the camera. But it's quite possible it will "miss" the occasional USB remote press.  I might be able to improve on that if I get a little spare time (haha). 

Did you try holding the USB switch down until you see the video stop?

Edit :
I updated the script but have no way to test it today.  Simple change should work better than the previous script ("famous last words").  Give it a shot and let me know?
« Last Edit: 26 / June / 2016, 14:51:32 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline Paco

  • **
  • 77
Re: How to STOP script via USB remote?
« Reply #6 on: 26 / June / 2016, 14:31:20 »
By 'down' do you mean closed (+5v)? If so, yes I tried that with no better results. But I think you are right about the processing time. That is what causes the misses.

Re: How to STOP script via USB remote?
« Reply #7 on: 26 / June / 2016, 14:39:15 »
By 'down' do you mean closed (+5v)? If so, yes I tried that with no better results. But I think you are right about the processing time. That is what causes the misses.
I added an updated script to my post just before this one.

But if you are telling me that keeping the +5V enabled does not stop the script eventually then there is something else weird going on.

Try the new version and report back?
« Last Edit: 26 / June / 2016, 14:41:58 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline Paco

  • **
  • 77
Re: How to STOP script via USB remote?
« Reply #8 on: 26 / June / 2016, 16:04:22 »
I tried the modified script but I am getting an 'Ukn Stat' error. I just tried the old one and it does stop if I leave the switch on.

Re: How to STOP script via USB remote?
« Reply #9 on: 26 / June / 2016, 16:06:06 »
I tried the modified script but I am getting an 'Ukn Stat' error. I just tried the old one and it does stop if I leave the switch on.
Always the risk in posting a script you can't test.  Leave it for now and I'll post an update later this week.  Sorry about that.
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics