CHDK PTP interface - page 5 - General Discussion and Assistance - CHDK Forum supplierdeeply

CHDK PTP interface

  • 1241 Replies
  • 491399 Views
Re: CHDK PTP interface
« Reply #40 on: 12 / October / 2009, 15:57:51 »
Advertisements
I guess _ExitTask needs declaring in lolevel.h.

Edit: it is declared but still get implicit declaration warning.
According to lolevel.h it should only be used in platform code. To fix it it would be best to add a wrapper ExitTask to platform/generic/wrappers.h (and declaration to include/platform.h) and use that function. Can't remember getting this warning, though; perhaps I'm using different compiler flags or something. (edit: I'm blind.)
« Last Edit: 13 / October / 2009, 05:45:24 by mweerden »

Re: CHDK PTP interface
« Reply #41 on: 12 / October / 2009, 16:08:54 »
I will play with this a bit and then study the code.

I wonder if you can (in principle) upload files that the Canon firmware will not report over PTP ?

Re: CHDK PTP interface
« Reply #42 on: 12 / October / 2009, 16:22:03 »
That is great !
Taking a photo and uploading image in record mode works fine.

Is there any way ptpcam can talk to two cameras ?


Re: CHDK PTP interface
« Reply #43 on: 12 / October / 2009, 16:57:58 »
I wonder if you can (in principle) upload files that the Canon firmware will not report over PTP ?
Sure you can, the normal PTP and CHDK PTP functionalities are completely independent.

Is there any way ptpcam can talk to two cameras ?
I think it should be possible with two instances of ptpcam. You can use the options --bus and --dev when starting an instance to indicate which device you want to connect to. You should be able to see the right values with 'ptpcam -l'.


*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: CHDK PTP interface
« Reply #44 on: 12 / October / 2009, 20:29:17 »
BTW, transfer of live image over USB 2.0 is quite fast (20-25 fps; 720*230*6/4=248400 bytes @ each frame).

Re: CHDK PTP interface
« Reply #45 on: 13 / October / 2009, 17:33:09 »
transfer of live image over USB 2.0 is quite fast

Every time I reconnect I get a Windows message saying a faster USB connection is available.
If you click on the message, ROOT HUB is in bold type and there are  meant to be six USB 2.0 connections.

Four are at the back and I am plugged into one of those via a four-port hub.

The remaining two are at the front but I 'blew' them a few days ago after accidentally shorting.

Anyway, the four at the back should still be working at high speed.


*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: CHDK PTP interface
« Reply #46 on: 27 / October / 2009, 18:31:39 »
a570 100e needs this stub:
NHSTUB(add_ptp_handler, 0xffd9b9d8 ) // via ptp handler table 0xffda8f70

Couldn't quite figure out where I task creation should go so I just dropped it in platform/generic/main.c after SpyTask creation:

Code: [Select]
void CreateTask_init_chdk_ptp() {
        _CreateTask("InitCHDKPTP", 0x19, 0x2000, init_chdk_ptp, 0);
};

static void task_start_hook(
    long p0,    long p1,    long p2,    long p3,    long p4,
    long p5,    long p6,    long p7,    long p8,    long p9)
{
    _CreateTask("SpyTask", 0x19, 0x2000, spytask, 0);
    task_prev(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9 );
   
    CreateTask_init_chdk_ptp();
}
hald in Ubuntu causes a little bit of trouble (first invocation if ptpcam always fails to connect but it works on the second attempt...I didn't try without hald yet):

./ptpcam --chdk
ERROR: Could not open session!
<    > q
./ptpcam --chdk
<conn> upload ptp.o A/ptp.o
<conn> download A/ptp.o foo
<conn> q
diff foo ptp.o

It works!

./ptpcam --chdk
<conn> lua shut_down
<conn> q
ERROR: Could not close session!

So that Lua part works too (the camera did shut down).

All this was in PLAY mode, I didn't try tackling the REC mode stuff yet  but DisableNotificationPTP() and PB2Rec() ought to do it since they have before but didn't have those in this first build. I did have reyalp's levent patches added, so I tried

lua set_levent_script_mode(1); post_levent("PressRecButton"); post_levent("UnpressRecButton"); set_levent_script_mode(0)

but that didn't have any effect. This is not surprising, because the REC switch actually shuts down the camera if USB cable is plugged in (even without CHDK).

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: CHDK PTP interface
« Reply #47 on: 27 / October / 2009, 19:17:14 »
the REC switch actually shuts down the camera if USB cable is plugged in (even without CHDK).
The same for a710.
Quote
lua set_levent_script_mode(1); post_levent("PressRecButton"); post_levent("UnpressRecButton"); set_levent_script_mode(0)
but that didn't have any effect.
post_levent_to_ui("PressRecButton")
This script works on a710 :o. Very strange...

edit: If someone interested, I write simple GUI program for Windows for remote shooting (see screenshot), using slightly modified mweerden's code.

« Last Edit: 27 / October / 2009, 19:39:18 by ewavr »


*

Offline reyalp

  • ******
  • 14082
Re: CHDK PTP interface
« Reply #48 on: 27 / October / 2009, 19:38:47 »
How about  ConnectUSBCable, DisconnectUSBCable ? Or possibly the Cradle ones (or is cradle something different than USB ?)

Or perhaps, using the eventproc code UiEvnt_StartDisguiseCradleStatus UiEvnt_StopDisguiseCradleStatus  ?
Don't forget what the H stands for.

*

Offline fe50

  • ******
  • 3147
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: CHDK PTP interface
« Reply #49 on: 27 / October / 2009, 20:43:24 »
Hello ewavr,
edit: If someone interested, I write simple GUI program for Windows for remote shooting (see screenshot), using slightly modified mweerden's code.
...very interested  8)
Could you publish the code ?

 

Related Topics