is it possible to download images while a script is running? - page 5 - General Discussion and Assistance - CHDK Forum
supplierdeeply

is it possible to download images while a script is running?

  • 63 Replies
  • 3475 Views
*

Offline Mlapse

  • ****
  • 455
  • S95 S110
Re: is it possible to download images while a script is running?
« Reply #40 on: 28 / November / 2021, 17:14:09 »
Advertisements
with the a480 for years i connected it when in shoot to the computer, it would always revert to play and i could pull the images off..until i got large enough cards and shoots for the file limit.
thought canon designed it that way.
since i can't remember it ever leading to trouble i woudn't think it would hurt the cam.
and it's a test of what happens when the connection breaks or is hot plugged :)
the pc might, but won't do it anymore, promise.
frustration is a key ingredient in progress

*

Offline reyalp

  • ******
  • 13673
Re: is it possible to download images while a script is running?
« Reply #41 on: 28 / November / 2021, 17:16:45 »
with the a480 for years i connected it when in shoot to the computer, it would always revert to play and i could pull the images off.
thought canon designed it that way.
I'm sure Canon did, and it's totally fine if you're just using the camera manually. However, my experience is the automatic switch can cause problems with subsequent switches under CHDK control.
Don't forget what the H stands for.

*

Offline Mlapse

  • ****
  • 455
  • S95 S110
Re: is it possible to download images while a script is running?
« Reply #42 on: 30 / November / 2021, 17:09:05 »
IF ! grep == null do FOR /F  :)
since i had trouble writing some of this in bash i decided to try it in cmd first.
it only creates new folders on the pc and some text, it can sift through the SUIx.csv that i posted a while back.
but it does not work in batches or download yet....that needs some more thinking.
 
« Last Edit: 01 / December / 2021, 16:58:07 by Mlapse »
frustration is a key ingredient in progress

*

Offline Mlapse

  • ****
  • 455
  • S95 S110
Re: is it possible to download images while a script is running?
« Reply #43 on: 01 / December / 2021, 17:11:09 »
at first i was thinking of downloading with a set number of images between each download.
because that's easy to follow and write.
however, i was thinking that it would always have to be a 'safe' number because the system might be slow.
wouldn't you agree that using time to trigger the download is a better choice?
i went ahead and tested that...with echo that is
you need a pretty long csv since it's echos instead of downloading real files, but works.
have to solve "remember the last linenumber" and some other steps.
......and then it's close to finish with the cmd part.

if you set last_line=0, it starts at the beginning of the csv but won't stop at set time since i wanted to verify that it works.
« Last Edit: 02 / December / 2021, 05:11:36 by Mlapse »
frustration is a key ingredient in progress


*

Offline Mlapse

  • ****
  • 455
  • S95 S110
Re: is it possible to download images while a script is running?
« Reply #44 on: 02 / December / 2021, 05:14:40 »
tidied up the code a bit and made the skip line do it's job...and some more details.

« Last Edit: 02 / December / 2021, 14:54:55 by Mlapse »
frustration is a key ingredient in progress

*

Offline Mlapse

  • ****
  • 455
  • S95 S110
Re: is it possible to download images while a script is running?
« Reply #45 on: 02 / December / 2021, 14:58:46 »
last update, basic framework for the loop is complete.
I have included a fixed time for the reboot to happen, but a reboot that just goes when the daily download is done would also be possible.
what do you think?
« Last Edit: 04 / December / 2021, 09:27:40 by Mlapse »
frustration is a key ingredient in progress

*

Offline Mlapse

  • ****
  • 455
  • S95 S110
Re: is it possible to download images while a script is running?
« Reply #46 on: 04 / December / 2021, 09:27:29 »
i had good arguments for and against both.
created fixed_rbt that can be true or false and will activate the reboot at a set time or just reboot when the download cycle is complete.

normally i just name it sh and be done with it, but this time it's not that easy.

i'm out of ideas, so i guess this should cover the cmd part :)
« Last Edit: 04 / December / 2021, 14:07:01 by Mlapse »
frustration is a key ingredient in progress

*

Offline Mlapse

  • ****
  • 455
  • S95 S110
Re: is it possible to download images while a script is running?
« Reply #47 on: 04 / December / 2021, 13:36:05 »
sorry early downloader, a flaw was in the code, so i've uploaded a new one.
« Last Edit: 07 / December / 2021, 02:23:17 by Mlapse »
frustration is a key ingredient in progress


*

Offline Mlapse

  • ****
  • 455
  • S95 S110
Re: is it possible to download images while a script is running?
« Reply #48 on: 05 / December / 2021, 03:24:46 »
Putting this together, I'd probably go for something like this:
script uses usb_force_present(1) at startup to prevent USB connections from messing up play/rec state, and uses switch_mode_usb to ensure mode switching is compatible

time to get back to the cam script :)
started the script with:
usb_force_active(1)
since that put the cam in play at the start of script i added
switch_mode_usb(1)
but this means the display goes out, backlight stays on and i have to pull the battery to get it going.
cam specific problem or did i miss something?


« Last Edit: 05 / December / 2021, 03:26:31 by Mlapse »
frustration is a key ingredient in progress

*

Offline reyalp

  • ******
  • 13673
Re: is it possible to download images while a script is running?
« Reply #49 on: 05 / December / 2021, 13:42:09 »
started the script with:
usb_force_active(1)
since that put the cam in play at the start of script i added
switch_mode_usb(1)
but this means the display goes out, backlight stays on and i have to pull the battery to get it going.
cam specific problem or did i miss something?
I'm not clear what approach you're pursing at this point, but I again, I highly recommend not connecting USB (or making the camera think it's connected with force_usb_active) when the camera is in rec.

It's also likely you need some delay between force_usb_present and switch_mode_usb. On elph130, 100ms seems to be plenty going from play mode, while no delay failed to switch.

If you are allowing the camera to auto-switch to play due to sensing USB, that would need additional time.
Don't forget what the H stands for.

 

Related Topics