Timelapse with CHDKptp / ptpcam gui - Script Writing - CHDK Forum supplierdeeply

Timelapse with CHDKptp / ptpcam gui

  • 28 Replies
  • 15007 Views
Timelapse with CHDKptp / ptpcam gui
« on: 16 / March / 2016, 03:10:20 »
Advertisements
Guys,
I am trying to build low cost infinite time lapse system using ixus 160 and either raspi/ laptop with windows.
So far my idea is the following:
1. Camera shoots time lapse in continious mode.
2. Images are stored directly on the laptop/ raspi hard drive.
3. once in a day ( for example) raspi or laptop load it via ftp/rsync/ whatever method to the home NAS and cleaning up its own hdd.

I was able to see the camera ( connect it both to win- and raspi) and control it.

My question now- how I can automate:
either continious shooting to hard drive ( while I want to control time between shoots) without writing to the camera SD
second option - continious shooting to SD drive, and after some time ( once per hour, or so) it download the images to the HDD and delete it on SD card.

I looket to ptpcam gui ( it has timelapse button), but was unable to find how to run time lapse with storing an image to HDD
I looked to chdkptp (raspi) but was unable to find out how to make the same thing - seems no time lapse functin in CHDKptp gui.

Any suggesstions/ useful advices?

*

Offline reyalp

  • ******
  • 14080
Re: Timelapse with CHDKptp / ptpcam gui
« Reply #1 on: 16 / March / 2016, 04:08:54 »
In chdkptp, you can use the remoteshoot command with -cont, -quick or -shots and -int to shoot a specific interval and save the images on your pc. Use help rs for details.

-cont and -quick will not adjust the exposure between shots.

I would not suggest using the gui for this application, especially on the raspberry pi. You can use -i to run in cli mode, or run the non-gui executable.

If you want more control than that, you will probably need to do some scripting somewhere: in chdkptp, on the camera, or feeding chdkptp stdin from shell script or other program.

If you want to control chdkptp with an external script, the rsint command may be useful.
Don't forget what the H stands for.

Re: Timelapse with CHDKptp / ptpcam gui
« Reply #2 on: 18 / March / 2016, 03:12:44 »
reyalp,
Tnx for comments and input.
Honestly speaking, I am not very familiar with scripting ( that's why I choose GUI initially).
Yesterday I give a try to a bash scripting , slightly modifying default script that coming with chdkptp (chdkptp.sh)
I was able to run chdkptp with -c argument, automatically connecting to the camera.

Unfortunately, i have no clue how to send to chdkptp next parameter- rs with sub- parameters , such as path, sv, av, number of shots and interval.

Of course before that I was able to do everything by hand, step by step.

Thus, my questions are:
1. What did you recommend, continue with bash or I can just take some lua timelapse script ( i see tons of that on forum) and run it on PC?
2. probably it is better to move topic to the scripting thread  :)

*

Offline reyalp

  • ******
  • 14080
Re: Timelapse with CHDKptp / ptpcam gui
« Reply #3 on: 18 / March / 2016, 13:23:59 »
reyalp,
Honestly speaking, I am not very familiar with scripting ( that's why I choose GUI initially).
What you are trying to do probably requires some kind of scripting somewhere.
Quote
Unfortunately, i have no clue how to send to chdkptp next parameter- rs with sub- parameters , such as path, sv, av, number of shots and interval.
Use the -e option and put the rs command with all it's options in quotes, something like
Code: [Select]
chdkptp -c -e"rs -tv=1/100 -sv=100 -shots=100 -int=5"
See usage.txt for details.

Quote
Thus, my questions are:
1. What did you recommend,

continue with bash or I can just take some lua timelapse script ( i see tons of that on forum) and run it on PC?
The best approach will depend a lot on you want to accomplish, and what you are most comfortable with.

Note the timelapse scripts you find on the forum will run on the camera, not the PC. If you want to transfer files, most of them will require some modification to coordinate the file downloads. I waterwingz Ultimate intervalometer script has some options for file transfer, but I'm not sure they will do what you want.

Quote
2. probably it is better to move topic to the scripting thread  :)
Will do.
Don't forget what the H stands for.


Re: Timelapse with CHDKptp / ptpcam gui
« Reply #4 on: 10 / October / 2016, 14:46:27 »
reyalp,
Honestly speaking, I am not very familiar with scripting ( that's why I choose GUI initially).
What you are trying to do probably requires some kind of scripting somewhere.
I have the same problem. I was thinking of making a time lapse series. Only, with GUI and on a pc. Doesn't work. I can make a schedule in Excel, for example

interval   0:00:02   
      
      action
10.10.2016   20:38:33   JPG Remote shoot
10.10.2016   20:38:35   JPG Remote shoot
10.10.2016   20:38:37   JPG Remote shoot
10.10.2016   20:38:39   JPG Remote shoot
10.10.2016   20:38:41   play
10.10.2016   20:38:43   set
10.10.2016   20:38:45   right
10.10.2016   20:38:47   set
10.10.2016   20:38:49   any script
10.10.2016   20:38:51   etc...


but, now how to make GUI recognize that and run a time lapse session?

I'm not very good at scripting and would be difficult for me to upgrade GUI.

*

Offline reyalp

  • ******
  • 14080
Re: Timelapse with CHDKptp / ptpcam gui
« Reply #5 on: 10 / October / 2016, 16:44:02 »
reyalp,
Honestly speaking, I am not very familiar with scripting ( that's why I choose GUI initially).
What you are trying to do probably requires some kind of scripting somewhere.
I have the same problem. I was thinking of making a time lapse series. Only, with GUI and on a pc.
What I said above still applies. As described, the thing you are trying to do requires scripting / programming. So your options are
1) Don't do it
2) Learn how to do it
3) Find someone else to do it for you
4) Modify your objectives to something that can be accomplished without writing code
Don't forget what the H stands for.

Re: Timelapse with CHDKptp / ptpcam gui
« Reply #6 on: 10 / October / 2016, 18:48:40 »
I'm going to explore all my options. I'm very close in learning how to do it with Excel's VBA. I got camera connected and ready to shoot. All I need is command line syntax for remote shoot.

I'm trying

Quote
chdkptp -i -e"rs"

but it says error not connected.
I have my camera connected, so I don't understand this error.
When I figure this out, I'll have the VBA script ready in Excel to shoot at given times.

*

Offline reyalp

  • ******
  • 14080
Re: Timelapse with CHDKptp / ptpcam gui
« Reply #7 on: 11 / October / 2016, 01:07:19 »
but it says error not connected.
I have my camera connected, so I don't understand this error.
When I figure this out, I'll have the VBA script ready in Excel to shoot at given times.
You need to use -c to tell it to connect (with a camera specification if you have multiple cameras connected), and you probably don't want to use -i, since that would leave chdkptp in interactive mode after rs finishes.

edit
USAGE.TXT and/or the built in help command may be helpful.
Don't forget what the H stands for.


Re: Timelapse with CHDKptp / ptpcam gui
« Reply #8 on: 11 / October / 2016, 05:17:42 »

but, now how to make GUI recognize that and run a time lapse session?

I'm not very good at scripting and would be difficult for me to upgrade GUI.

I haven't done that but maybe something like AutoIt could help (it's free, pretty useful in a lot of situations and similar to VBA).

This link could be a starter for you:
https://www.autoitscript.com/forum/topic/96023-gui-testing-automation/

I recently used the macro recorder referred to there to (edit: produce the required outline code, so as to) interact with the Windows image viewer when the microphone picked up a sound.
« Last Edit: 11 / October / 2016, 06:20:43 by andrew.stephens.754365 »

Re: Timelapse with CHDKptp / ptpcam gui
« Reply #9 on: 11 / October / 2016, 15:53:21 »
Thanks for the tips, they were very useful. It got me somewhere. In fact my script now works and I actually can do a time lapse with it.

There's only one trouble. It doesn't store the files on my pc, it stores the files on camera instead.

I read usage.txt and it's almost a rocket science to me. Can't understand why a call like rs doesn't put files directly to my pc. I used this sequence:
Quote
chdkptp -c -e"rec" -e"rs"
chdkptp -c -e"rs"
chdkptp -c -e"rs"
...
Like I said, it almost works.



I used Excel because I can easily generate the schedule table here. All I do is enter 3 parameters, extend the table and run the scheduler.

This is how my utility looks like:


And this is VBA script. I'm posting it in case somebody else would like to try it.
Quote
Global s

Sub stopSchedule()
    s = True
End Sub

Sub callCannonPTP()
    'schedules your camera with CHDKPTP
    Dim n   'number of dates
    Dim a   'action
    Dim b   'end date
    Dim c   'chdkptp path
    Dim d   'date
    Dim i, p, r
   
    n = Worksheets(1).Cells(5, 6).Value
    b = Worksheets(1).Cells(n + 4, 1).Value
    Worksheets(1).Cells(6, 6).Value = b
    c = Worksheets(1).Cells(8, 6).Value
    p = False
    s = False
    i = 1
    Do
        d = Worksheets(1).Cells(i + 4, 1).Value
        a = Worksheets(1).Cells(i + 4, 2).Value
        r = Now()
       
        If r > d Then
            Call Shell(c & " " & a)
            i = i + 1
            Worksheets(1).Cells(9, 6).Value = i - 1 & " of " & n             'status bar
        End If
       
        DoEvents
    Loop Until s Or (r > b) Or (i > n)
   
End Sub

« Last Edit: 11 / October / 2016, 16:28:04 by Kasius Klej »

 

Related Topics