Save to PC instead of SD card - page 4 - General Help and Assistance on using CHDK stable releases - CHDK Forum

Save to PC instead of SD card

  • 78 Replies
  • 22240 Views
*

Offline reyalp

  • ******
  • 14118
Re: Save to PC instead of SD card
« Reply #30 on: 15 / March / 2015, 15:09:48 »
Advertisements
I did turn off raw capture after I tested the functionality.
Just to make sure we are talking about the same thing, I mean the raw setting in the Canon firmware, not CHDK or chdkptp remote capture.

Quote
I made the switch from rec to play and back using CHDK PTP.
OK, that means that it isn't waiting for the timeout on the camera side, because chdkptp mode switching won't work if a script is still running.

This port doesn't have vid_get_bitmap_active_buffer implemented (in the trunk, and not in nafrafs SVN that I can see), so the UI overlay may not be updated when the physical camera display is.

It also doesn't have vid_get_viewport_live_fb, which means the live view will not update as regularly.
Don't forget what the H stands for.

*

Offline DaveX

  • *
  • 46
Re: Save to PC instead of SD card
« Reply #31 on: 15 / March / 2015, 16:12:18 »
Plus, I loose zoom and wheel button functionality.
Thanks for testing. Please try this new version.

Every attempt to connect or do anything results in "ERROR: Operation Not Supported".  That is until I removed the SD card and locked it. 

After that, it still has the, apparently, same error.  Log file attached.  The test script also left the camera in a state that I could not get it out of without rebooting the camera.  I've also attached the cli dialog with cli_verbose=2.  It seemed like the camera was taking a series of pictures and storing them on the SD card after the test had completed and I hit the JPG Remote Shoot button.

I'm currently using two G9s.  After we're done with the changes we're working on here my expectation is I'll have one instance of CHDK PTP open and switch between the two.  Ideally, at least based on how I've been working in the past, it would be great if the file numbering would be continued from the last image taken regardless of which camera took the shot.  Is there a way to make this happen in CHDK PTP?  Or CHDK?  If not, or it's a major PITA, is there a way to have the camera continue file numbering from wherever it left off regardless if it sees the last file on the SD card?  It would also be useful if one could specify the prefix for file names.  Some or all of this may be possible now, but in my looking around I haven't seen it.  This may also not be the right thread for this particular issue. 

*

Offline reyalp

  • ******
  • 14118
Re: Save to PC instead of SD card
« Reply #32 on: 15 / March / 2015, 17:07:29 »
Every attempt to connect or do anything results in "ERROR: Operation Not Supported".  That is until I removed the SD card and locked it. 
Autoboot requires the SD card to be locked, so CHDK wasn't running. You probably forgot to re-lock after updating the files.
Quote
I'm currently using two G9s.  After we're done with the changes we're working on here my expectation is I'll have one instance of CHDK PTP open and switch between the two.  Ideally, at least based on how I've been working in the past, it would be great if the file numbering would be continued from the last image taken regardless of which camera took the shot.  Is there a way to make this happen in CHDK PTP?
You can't set the cameras naming / numbering from chdkptp or CHDK.

You could set the entire path and name (without extension) in the chdkptp code. In the code msl gave, you the line
Code: [Select]
                    local cmd = string.format("rs '%s'", dest)
is where the output is set. This currently uses the directory you set in the ui (or the current working directory), but you could add something like a sequential shot number since startup, or something based on date / time etc.

If the specified path is not a directory, the chdkptp code assumes the last component is the file name, so
c:/foo/bar
will save as bar.jpg if bar does not exist, or bar/IMG_nnnn.JPG if it is a directory.
Don't forget what the H stands for.

*

Offline DaveX

  • *
  • 46
Re: Save to PC instead of SD card
« Reply #33 on: 15 / March / 2015, 17:32:37 »
Every attempt to connect or do anything results in "ERROR: Operation Not Supported".  That is until I removed the SD card and locked it. 
Autoboot requires the SD card to be locked, so CHDK wasn't running. You probably forgot to re-lock after updating the files.
I knew that was the problem, a little tongue in cheek.  I should have put  :D after the statement to make it clearer.
I'm currently using two G9s.  After we're done with the changes we're working on here my expectation is I'll have one instance of CHDK PTP open and switch between the two.  Ideally, at least based on how I've been working in the past, it would be great if the file numbering would be continued from the last image taken regardless of which camera took the shot.  Is there a way to make this happen in CHDK PTP?
You can't set the cameras naming / numbering from chdkptp or CHDK.

You could set the entire path and name (without extension) in the chdkptp code. In the code msl gave, you the line
Code: [Select]
                    local cmd = string.format("rs '%s'", dest)
is where the output is set. This currently uses the directory you set in the ui (or the current working directory), but you could add something like a sequential shot number since startup, or something based on date / time etc.

If the specified path is not a directory, the chdkptp code assumes the last component is the file name, so
c:/foo/bar
will save as bar.jpg if bar does not exist, or bar/IMG_nnnn.JPG if it is a directory.

Using a filename based on the date and time would take care of the issues.  Where do I find the syntax for putting the string together?  Is it a lua thing or a CHDK thing?  Or are they both the same?  If the destination is a PC should I use the backslash or the forward slash as you have done?

Thanks again for everyone's help.


*

Offline reyalp

  • ******
  • 14118
Re: Save to PC instead of SD card
« Reply #34 on: 15 / March / 2015, 17:56:12 »
Using a filename based on the date and time would take care of the issues.  Where do I find the syntax for putting the string together?  Is it a lua thing or a CHDK thing?
Lua. See os.date in http://www.lua.org/manual/5.2/manual.html#6.9

(note that's the 5.2 manual, CHDK scripts on the camera are Lua 5.1 while chdkptp code is lua 5.2. They mostly interchangeable but there are a few differences)

So for example, if you wanted the file to be named dest/IMG_YYMMDD-HHMMSS.JPG you could do something like
Code: [Select]
                    local cmd = string.format("rs '%s/%s'", dest, os.date('%y%m%d-%H%M%S'))
Formats available in os.date vary depending on your OS, but most of the basic ones (year, month, day etc) from
http://pubs.opengroup.org/onlinepubs/007908799/xsh/strftime.html
should work.

Note I haven't tested the code above. You can use the ! command to test bits of lua code like this, e.g.
Code: [Select]
___> !return os.date('%y%m%d-%H%M%S')
="150315-144747"

Quote
If the destination is a PC should I use the backslash or the forward slash as you have done?
You can use either or even mix them, but backslashes may need to be escaped with additional backslashes (the number depending on the exact usage), so forward slashes are simpler.
Don't forget what the H stands for.

*

Offline nafraf

  • *****
  • 1308
Re: Save to PC instead of SD card
« Reply #35 on: 15 / March / 2015, 19:04:53 »
vid_get_bitmap_active_buffer() and vid_get_viewport_live_fb() implemented. Please test and report.

*

Offline DaveX

  • *
  • 46
Re: Save to PC instead of SD card
« Reply #36 on: 16 / March / 2015, 11:40:38 »
Everything appears to work fine, I haven't used it extensively yet at this point.  There is still the same failure when ubtest is run, log file attached.

*

Offline reyalp

  • ******
  • 14118
Re: Save to PC instead of SD card
« Reply #37 on: 16 / March / 2015, 15:54:34 »
Quote
exp_count 15
exp count or shot fail
Means that either the script didn't shot when it tried to take the first shot, or the exposure counter isn't incrementing as expected.

The script should take 5 shots on a camera with an ND filter.
Don't forget what the H stands for.


*

Offline nafraf

  • *****
  • 1308
Re: Save to PC instead of SD card
« Reply #38 on: 17 / March / 2015, 07:40:11 »
The port defines: #define PARAM_FILE_COUNTER      0x38 (56 decimal)
DaveX, Could you check if that PARAM_FILE_COUNTER is incrementing after each shot?
CHDK Menu ->Miscellaneous stuff -> Debug Parameters ->
Debug Data Display [Params]
Propcase/ParamsData Page [5]

*

Offline DaveX

  • *
  • 46
Re: Save to PC instead of SD card
« Reply #39 on: 17 / March / 2015, 12:06:16 »
Line 56 is incrementing by 16 with every shot.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal