limiting factors of CHDK for extended time-lapse - page 7 - General Discussion and Assistance - CHDK Forum  

limiting factors of CHDK for extended time-lapse

  • 90 Replies
  • 47424 Views
*

Offline Sdack

  • ***
  • 194
Re: limiting factors of CHDK for extended time-lapse
« Reply #60 on: 15 / August / 2018, 23:50:46 »
Advertisements
I'm back...

My test suite has expanded now to include the following 1 hour runs of images at 60 second intervals
Results
Wifi rig including RasPi plus relays etc. (uploads image on capture) running Multilapse    = 2.0 Wh
Ixus160 (camera draw only) being run by Multilapse script     = 1.45 Wh
Ixus160 running miser2 script with all power saving options except AELock (crashes camera) and sleep shortcut     = 0.45 Wh
Ixus160 running miser2 script with all power saving options except AELock     = 0.42 Wh
Arduino controlled IXUS160, with the fast one shot script     = 0.2 Wh

So, clearly an Arduino Raspberry Pi combination is the winner. as already identified.

The remaining task is to combine the devices, such that the Arduino wakes the Pi intermittently for file handling.

Previous posts outline a suggested workflow for this but a question has arisen in my mind as to whether it's possible for the Arduino to keep taking images, during a RasPi file handling session?

This would be ideal because I'd really like the Pi to wake for a few minutes each hour for progress reporting (by text file upload) and possible reconfiguration ie. If the interval needs adjusting, I could ssh into the Pi, at the top of an hour and temporarily halt it's shutdown while I update the config.   Thumbnail upload however could happen at the end of the day.

The latest discussion has suggested that a camera autostarted CHDKPTP script would initiate an image capture on receipt of a pulse from the Arduino at the USB port but it would also (I'm not clear on how) sense the Pi being connected, at which point it would switch to PTP mode until the RasPi disconnected.

If the two modes, USB pulse initiated capture and PTP are mutually exclusive, it would be interesting to see if the RasPi file count / report and disconnect function could be completed within the 60 second interval, or perhaps we could simply lose one shot an hour to open up more of a gap?

As always, I look forward to your thoughts and feedback

Sdack

Re: limiting factors of CHDK for extended time-lapse
« Reply #61 on: 16 / August / 2018, 00:22:38 »
So, clearly an Arduino Raspberry Pi combination is the winner. as already identified.
Thanks - nice to confirm that the best CHDK power saving options consume more power than simply turning the camera on & off periodically.  At least until you turn the camera off more frequently than every 60 seconds.  There is probably a cross over point somewhere for shorter intervals.

Quote
The remaining task is to combine the devices, such that the Arduino wakes the Pi intermittently for file handling.
Yup - combined with powering up the camera so that it's ready to talk to the Pi.

Quote
Previous posts outline a suggested workflow for this but a question has arisen in my mind as to whether it's possible for the Arduino to keep taking images, during a RasPi file handling session?
The Arduino does not take images - that's the Lua script on the camera's job. And yes, it's possible - you just need the camera script to not shut down if the Pi is fetching images. A tiny bit of code ...

Quote
The latest discussion has suggested that a camera autostarted CHDKPTP script would initiate an image capture on receipt of a pulse from the Arduino at the USB port but it would also (I'm not clear on how) sense the Pi being connected, at which point it would switch to PTP mode until the RasPi disconnected.
That's not what I suggested.  It's not a "camera autostarted CHDKPTP script" - it's simply a CHDK script that autostarts each time the camera is powered up. No CHDKPTP involved or required.

What I suggested was that the Arduino start the camera by providing power via a relay.  Assuming CHDK script autostart is enabled, the selected script will either take one picture and shutdown the camera OR if +5V was detected on the USB port it would wait in a loop for the +5V to go away - allowing CHDKPTP downloads to happen during the wait.  You can have the script also safely take photos at some interval while waiting on PTP transfers.

Quote
If the two modes, USB pulse initiated capture and PTP are mutually exclusive, it would be interesting to see if the RasPi file count / report and disconnect function could be completed within the 60 second interval, or perhaps we could simply lose one shot an hour to open up more of a gap?
Well, the two modes are not mutually exclusive as there are not really two modes. So there is no need to open up a gap  or lose an image. You're making this harder than it needs to be.   :)


Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline Sdack

  • ***
  • 194
Re: limiting factors of CHDK for extended time-lapse
« Reply #62 on: 16 / August / 2018, 00:34:46 »
Thanks WW,

You're right again... I was confusing CHDKPTP with CHDK on the camera power up auto start.

I think I was also confusing the autoscript method with the Arduino USB pulse method.  I think we definitely should try the 6 second loop version, at least until the lens actuators reveal their limits hey.

I am very glad to hear there may be a way to keep shooting while the Raspberry Pi is connected.

If there are any other power tests you would like me to run, let me know.  I'm in the swing of it now.  However I found that my new wattmeter won't measure lower than 6.5Volts, so I can't check it against the USB device.
Cheers


Re: limiting factors of CHDK for extended time-lapse
« Reply #63 on: 16 / August / 2018, 08:17:54 »
I think we definitely should try the 6 second loop version, at least until the lens actuators reveal their limits.  I am very glad to hear there may be a way to keep shooting while the Raspberry Pi is connected.
It won't take me long to modify that script to also support the mods needed for working with CHDKPTP.   
« Last Edit: 16 / August / 2018, 09:54:48 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline Sdack

  • ***
  • 194
Re: limiting factors of CHDK for extended time-lapse
« Reply #64 on: 16 / August / 2018, 18:37:55 »
Lovely, thanks
S

Re: limiting factors of CHDK for extended time-lapse
« Reply #65 on: 17 / August / 2018, 16:45:20 »
Lovely, thanks
An updated one_shot script attached.

This one first checks the USB jack when it runs. If there is power there, it assumes you want to use chdkptp (or some other PTP protocal program) so it just loops forever waiting for you to press any key or for the power to be removed from the USB port. If there is nothing on the USB port it takes one shot and exits.

The script has options to turn off the display when it starts or to power off the camera when it finishes.  Note that if you hold down the Func/Set key when the script runs, it will ignore the power off setting - useful when autorunning the script.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 13387
Re: limiting factors of CHDK for extended time-lapse
« Reply #66 on: 17 / August / 2018, 18:05:27 »
This one first checks the USB jack when it runs. If there is power there, it assumes you want to use chdkptp (or some other PTP protocal program) so it just loops forever waiting for you to press any key or for the power to be removed from the USB port. If there is nothing on the USB port it takes one shot and exits.
If the intent is to let chdkptp download images, keep in mind that most chdkptp download commands need to run their own lua and will fail if another script is running. You can use -nolua for single file downloads, but you'd need to know the file paths in advance.

You could use killscript from chdkptp before starting the download, but in that case it might make more sense for the script to just exit when it detects USB, and let the chdkptp side initiate whatever needs to come next after downloading.
Don't forget what the H stands for.

*

Offline Sdack

  • ***
  • 194
Re: limiting factors of CHDK for extended time-lapse
« Reply #67 on: 17 / August / 2018, 18:27:15 »
Fantastic thanks WW, I will give it a go today
Let's see if the PTP can handle two Luas.

At this point I plan on getting a list of images, once an hour, saving the file transfers till after the days shooting.

I definitely know my paths, so maybe this -nolua option would work as an alternative.
Have a great weekend
Sdack


Re: limiting factors of CHDK for extended time-lapse
« Reply #68 on: 17 / August / 2018, 21:36:28 »
Fantastic thanks WW, I will give it a go today
Let's see if the PTP can handle two Luas.
Reyalp is of course correct. It won’t work.

Fortunately there is any easy fix. Just remove the wait loop and let the script exit without shutting the camera down when an active USB connection is detected. You can then let the Pi do its chdkptp stuff and issue a command to shut the camera down when it is finished. 

I’ll post an updated script shortly. New script attached.
« Last Edit: 18 / August / 2018, 11:18:53 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline Sdack

  • ***
  • 194
Re: limiting factors of CHDK for extended time-lapse
« Reply #69 on: 17 / August / 2018, 21:42:29 »
Brilliant,
Thanks waterwingz
I'm currently trying to figure out a scheduling script for the Arduino to manage the relays.
I've not written anything in C++ before, but I've found a good starting script which looks promising.
Cheers



 

Related Topics