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

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

  • 63 Replies
  • 2350 Views
*

Offline Mlapse

  • ****
  • 377
  • S95 S110
Re: is it possible to download images while a script is running?
« Reply #60 on: 06 / December / 2021, 12:26:08 »
Advertisements
 :(  :'(  i'm sorry. it's just testing, i understand the cam has to be started in play.

any new connection will fail when in record.
so starting the script without the pc being connected at that moment will fail to connect when the pc comes online?
but if it is connected at (re)boot when in play it won't fail even if it would disconnect for a moment after initial connection and as a result chdkptp can reconnect even when in record?

and the reason my script needs 70 seconds because after starting the script there are some things that apparently keep the cam busy for a few moments before it starts it's 1 minute lens retraction timer.

« Last Edit: 06 / December / 2021, 12:53:08 by Mlapse »
frustration is a key ingredient in progress

*

Offline reyalp

  • ******
  • 13502
Re: is it possible to download images while a script is running?
« Reply #61 on: 06 / December / 2021, 15:54:07 »
:(  :'(  i'm sorry. it's just testing, i understand the cam has to be started in play.

any new connection will fail when in record.
so starting the script without the pc being connected at that moment will fail to connect when the pc comes online?
No. If you start the camera in play, use force_usb_active, and later start the PC (or connect the cable), it should work (at least it seems like it should from my limited testing). Assuming you do all your mode switching with switch_mode_usb, it should work whether the camera is in rec or play.

Quote
but if it is connected at (re)boot when in play it won't fail even if it would disconnect for a moment after initial connection and as a result chdkptp can reconnect even when in record?
Maybe part of the confusion is there are two different things: Camera detecting changes in +5v state, and an actual USB and PTP protocol connection.

Camera detecting +5v going high when the camera is in rec is the problem. I was referring to this as "connection" earlier.

With force_usb_active, you make the camera detect +5v in playback before it can cause a problem, no matter whether there is actually +5v there or not.

You should be able to subsequently make PTP connections.

Quote
and the reason my script needs 70 seconds because after starting the script there are some things that apparently keep the cam busy for a few moments before it starts it's 1 minute lens retraction timer.
Again, if you start in play the lens should not be extended, so this should not matter. Unless I'm missing something...
Don't forget what the H stands for.

*

Offline Mlapse

  • ****
  • 377
  • S95 S110
Re: is it possible to download images while a script is running?
« Reply #62 on: 06 / December / 2021, 16:30:41 »
Quote from: reyalp link=topic=14446.msg147444#msg147444
No. If you start the camera in play, use force_usb_active, and later start the PC (or connect the cable), it should work (at least it seems like it should from my limited testing). Assuming you do all your mode switching with switch_mode_usb, it should work whether the camera is in rec or play.

In that case i think i found and prevented most mistakes that can be made when starting SUIx wrongly with possible ptp :)

still have some things to clean up and create a write_usb_msg for the chdkptp side at the right moments and then it's time i start to rework my cmd routine to lua so i can test the idea.
« Last Edit: 06 / December / 2021, 16:36:39 by Mlapse »
frustration is a key ingredient in progress

*

Offline Mlapse

  • ****
  • 377
  • S95 S110
Re: is it possible to download images while a script is running?
« Reply #63 on: 10 / December / 2021, 17:46:10 »
had to adapt a lot in SUIx.lua to make it possible and stable.
now, if i would have made a working lua script to download that would be something ;)

a while back i posted a cmd file and small csv so you could see how i thought it could work.
i created a file idownload.lua and wrote out commented steps based on the cmd as a guide.
the last week i've been looking at the lua files reyalp wrote for inspiration and functions that could help me.
i thought i would get stuck at reading the csv.

but as you can see from the file it didn't work out to anything working.
i am unable to implement the algorithm of once a day/interval timed download that i think could be usefull for downloading with a (continues) cam run script.
since this goes further than some coding suggestions or a feature request and my understanding growing enough might take years, i feel i should let it go.

never even came close to that testing of beating the file limit :(
but if you think (part of) this idea could be a valuable addition to chdkptp as a general download script and want to develop it.
i would most certainly support, test, tune and try to use it :)

thanks for your input and support.
frustration is a key ingredient in progress


 

Related Topics