CHDK PTP interface

  • 1149 Replies
  • 211328 Views
*

Offline reyalp

  • ******
  • 11541
Re: CHDK PTP interface
« Reply #1130 on: 16 / May / 2015, 15:26:47 »
Advertisements
I haven't any programmer skills :( But I found a way to make something like onion skin using chdkptp and ghostwin. It's not perfect and takes a lot of time to make 1 photo.
Here photo :)
If there is a simple way chdkptp could make it easier to do what you want, feel free to suggest it in the chdkptp thread http://chdk.setepontos.com/index.php?topic=6231.780

I can't promise to implement it.

Keep in mind I know essentially nothing about stop motion, onion skinning etc. As far as I understand, you want to overlay the current live view on a previous frame?
Don't forget what the H stands for.

*

Offline KNEi

  • *
  • 37
  • sx230hs
Re: CHDK PTP interface
« Reply #1131 on: 16 / May / 2015, 15:52:08 »
Yes, it is exactly that I want  :) 
What is the probability that they will do it?

Re: CHDK PTP interface
« Reply #1132 on: 26 / January / 2016, 12:28:34 »
I am trying to perform remote capture with PowerShot SX170IS (Firmware Version: 1.01, CHDK Version: 1.4.1 and SVN build of CHDK-PTP).

Other commands are working but when I type rec, the chdk-ptp terminal returns error:switch failed and camera hangs. It does not even turn off.

*

Offline reyalp

  • ******
  • 11541
Re: CHDK PTP interface
« Reply #1133 on: 26 / January / 2016, 13:27:07 »
I am trying to perform remote capture with PowerShot SX170IS (Firmware Version: 1.01, CHDK Version: 1.4.1 and SVN build of CHDK-PTP).

Other commands are working but when I type rec, the chdk-ptp terminal returns error:switch failed and camera hangs. It does not even turn off.
Are you using linux? Does the physical camera screen go black when you plug in the camera?

If so, I would guess it's the "Interactions with default software" described on https://www.assembla.com/spaces/chdkptp/wiki/Install
Don't forget what the H stands for.


Re: CHDK PTP interface
« Reply #1134 on: 27 / January / 2016, 01:31:31 »
Thanks :) That was the problem. I thought un-mounting should do it but it didn't.

Re: CHDK PTP interface
« Reply #1135 on: 27 / January / 2016, 03:37:53 »
I was wondering if  it is possible to remote shoot in burst mode. If yes how?

*

Offline reyalp

  • ******
  • 11541
Re: CHDK PTP interface
« Reply #1136 on: 27 / January / 2016, 13:04:51 »
I was wondering if  it is possible to remote shoot in burst mode. If yes how?
If you mean shoot several shots quickly without re-focusing, you can use -quick=N or -cont=N. N is the number of shots to take. Quick simulates holding the shutter half way and clicking full. This should work on all cameras that support remoteshoot. Cont uses Canon continuous mode. This requires that you set the camera to continuous mode in the Canon UI first, and has problems on some cameras. If you are using quick, you should turn off review in the canon settings.

If you mean the Canon firmware "burst" mode that some cameras have, there's no specific support for it. It might work with -cont.
Don't forget what the H stands for.

*

Offline Ant

  • ****
  • 369
Re: chdkptp - alternative ptp client
« Reply #1137 on: 14 / April / 2017, 17:44:53 »
reyalp
I am asking you again to enable memory reading from address 0.


*

Offline reyalp

  • ******
  • 11541
Re: Re: chdkptp - alternative ptp client
« Reply #1138 on: 14 / April / 2017, 22:47:33 »
reyalp
I am asking you again to enable memory reading from address 0.
I didn't spend much time on it, but it appears to me that the canon send_data function fails on NULL pointer. On G7X, If I take out the param2 == 0 check in PTP_CHDK_GetMemory I still get the same

"ERROR: Protocol error: data expected"

I'd suggest using the uncached address, but it seems return different values, probably due to TCM being mapped to 0.

edit:
If you want to experiment the check is in the CHDK code core/ptp.c.
« Last Edit: 14 / April / 2017, 22:52:46 by reyalp »
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 3710
Re: Re: chdkptp - alternative ptp client
« Reply #1139 on: 16 / April / 2017, 10:37:20 »
Quick hack that lets getting camera memory from places that are not PTP friendly (I wanted to get a copy of the 0xbfe10000 TCM content). It uses buffered read. Still not suitable for reading MMIO because it uses memcpy.

It's available via the d (download) chdkptp command, using a special filename:
Code: [Select]
d -nolua MEM<start addr>,<length> [memdump.bin]where <start addr> is the starting address in decimal or hex, <length> is the dump length in bytes.
Code: [Select]
Index: core/ptp.c
===================================================================
--- core/ptp.c (revision 4794)
+++ core/ptp.c (working copy)
@@ -495,6 +495,60 @@
         free(temp_data.str);
         temp_data_kind = 0;
 
+        // hack, parse filename for special operation (gets camera memory range)
+        // format: MEM<start addr>,<length>
+       
+        char *comma = 0;
+        // check for special file name (starts with MEM)
+        if (strstr(fn, "A/MEM"))
+        {
+            comma = memchr(fn+5, ',', temp_data_extra-5);
+        }
+        if (comma)
+        {
+            *comma = 0;
+            unsigned long start = strtoul(fn+5, 0, 0);
+            unsigned long length = strtoul(comma+1, 0, 0);
+           
+            // some protection against typos
+            if (length > camera_info.maxramaddr+1)
+            {
+                length = camera_info.maxramaddr+1;
+            }
+           
+            buf = (char *) malloc(buf_size);
+            if ( (buf == NULL) || (length == 0) )
+            {
+              // send dummy data, otherwise error hoses connection
+              send_ptp_data(data,"\0",1);
+              ptp.code = PTP_RC_GeneralError;
+              if (buf)
+              {
+                free(buf);
+              }
+              free(fn);
+              break;
+            }
+            tmp = t = length;
+            while (t > 0)
+            {
+              r = (t<buf_size)?t:buf_size;
+              t -= r;
+              memcpy(buf, (void*)start, r);
+              start += r;
+              // cannot use send_ptp_data here
+              data->send_data(data->handle,buf,r,tmp,0,0,0);
+              tmp = 0;
+            }
+            free(fn);
+            free(buf);
+            ptp.num_param = 1;
+            ptp.param1 = length;
+            // we're finished
+            break;
+        }
+        // hack end
+
         f = fopen(fn,"rb");
         if ( f == NULL )
         {
edit:
fixed 2 memory leaks
« Last Edit: 16 / April / 2017, 11:58:43 by srsa_4c »

 

Related Topics