CHDK PTP interface

  • 1149 Replies
  • 175636 Views
Re: CHDK PTP interface
« Reply #30 on: 12 / October / 2009, 04:58:08 »
Advertisements
It was my stupid error - remote filename must begin with 'A/' (not with 'a/') ;)

Does ptpcam work in Record mode on your A710 ?


*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: CHDK PTP interface
« Reply #31 on: 12 / October / 2009, 08:45:45 »
Does ptpcam work in Record mode on your A710 ?
I'll try this evening.



Re: CHDK PTP interface
« Reply #32 on: 12 / October / 2009, 09:45:42 »
I'll try this evening.

rec2PB abd PB2rec do not work on many cameras.

So, this is what I have :-

void switch_mode(int mode)
{
  if ( mode == 0 )
  {
 PostLogicalEventForNotPowerType(0x1061); // playback
  } else if ( mode == 1 )
  {
   PostLogicalEventForNotPowerType(0x1061); // playback first !
   msleep(10);
   PostLogicalEventForNotPowerType(0x1065); // then record
   msleep(10);
  }
}

ptpcam command 'mode 0' when you are already in playback does not produce an error.

'mode 1' switches to record, lens extends and camera turns-off immediately.
From previous experience, the playback mode command when switching to record was needed , I cannot remember why, I will remove it.

For cameras that have a playback pushbutton, I have used the following for PostLogicalEventForNotPowerType :-

RECORD 0x1001
PLAYBACK 0x1003

Re: CHDK PTP interface
« Reply #33 on: 12 / October / 2009, 09:59:15 »
For cameras that have a playback pushbutton, I have used the following for PostLogicalEventForNotPowerType :-

RECORD 0x1001
PLAYBACK 0x1003
I like the use of PostLogicalEventForNotPowerType (also for soft shutdown with 0x1005); it's seems a lot safer than directly calling functions that hopefully do the same. Unfortunately switching to playback this way causes the PTP connection to be closed (just like really pressing the button), while calling Rec2PB doesn't. On the other hand, it is just a minor inconvenience.


Re: CHDK PTP interface
« Reply #34 on: 12 / October / 2009, 10:28:56 »
So, on the ixus870, does that switch to record mode and does ptp continue to work ?


Re: CHDK PTP interface
« Reply #35 on: 12 / October / 2009, 10:33:49 »
So, on the ixus870, does that switch to record mode and does ptp continue to work ?
Yes. That is, together with the call to set_control_event.

Re: CHDK PTP interface
« Reply #36 on: 12 / October / 2009, 10:50:45 »
together with the call to set_control_event.

As I do not seem to have that on the A620, I wonder if I should replace with connect and disconnect USB functions ?


Re: CHDK PTP interface
« Reply #37 on: 12 / October / 2009, 11:09:36 »
together with the call to set_control_event.

As I do not seem to have that on the A620, I wonder if I should replace with connect and disconnect USB functions ?
I don't know. I tried several things (including PostLogicalEventForNotPowerType(0x10A6); for you it seems 0x1086 is needed), but they typically resulted in actually disconnecting USB connections.


*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: CHDK PTP interface
« Reply #38 on: 12 / October / 2009, 14:10:18 »
Ok, it seemt that for A710 this simple code:
Code: (c) [Select]
void switch_mode(int mode) {
  if ( mode == 0 ) {
   _PostLogicalEventForNotPowerType(0x1003, 0); //PressPBButton
  }
  else if ( mode == 1 ) {
    _PostLogicalEventForNotPowerType(0x1001, 0); //PressRecButton
  }
}
works very well. No crashes, no USB disconnect when camera toggles record<->playback.

Re: CHDK PTP interface
« Reply #39 on: 12 / October / 2009, 15:05:36 »
Ok, it seemt that for A710 this simple code:
works very well. No crashes, no USB disconnect when camera toggles record<->playback.

It works on the A620 as well.

It should work on most or all cameras.

I guess _ExitTask needs declaring in lolevel.h.

Edit: it is declared but still get implicit declaration warning.

Time for a cup of tea after that   :)

 

Related Topics