PTP Control for IXUS105 / SD1300 - page 2 - CHDK Releases - CHDK Forum

PTP Control for IXUS105 / SD1300

  • 19 Replies
  • 6797 Views
Re: PTP Control for IXUS105 / SD1300
« Reply #10 on: 09 / April / 2013, 09:23:52 »
Advertisements
Someone please tell me what's wrong with ixus105.. is there someone who is able to run ptpcamgui with ixus105?
Naveed E Sahar

*

Offline srsa_4c

  • ******
  • 4426
Re: PTP Control for IXUS105 / SD1300
« Reply #11 on: 09 / April / 2013, 09:50:59 »
Someone please tell me what's wrong with ixus105.. is there someone who is able to run ptpcamgui with ixus105?
Try using CHDK's USB remote, use a simple USB cable, plug it into the computer's USB socket momentarily to simulate a button press.
CHDK settings -> Remote parameters
Enable remote [.]
Switch type   [OnePush]
Control mode  [Normal]


This will tell us whether the USB bit is known and handled correctly.
Note that since no developers have this camera, resolving this issue is impossible without someone available for testing.

Re: PTP Control for IXUS105 / SD1300
« Reply #12 on: 09 / April / 2013, 11:03:20 »
srsa, thanks for reply, I did as you suggested, but nothing happened. I also set the remote parameters as you mentioned.

I have done that before with SDM. when SDM is updated in camera, it takes picture when a pulse of 5volts is given via power supply or usb cable. but unfortunately SDM does not have that much capabilities as CHDK.. My basic purpose is to control the snap button and image to be saved directly in PC.

What do I do next?
Naveed E Sahar

*

Offline srsa_4c

  • ******
  • 4426
Re: PTP Control for IXUS105 / SD1300
« Reply #13 on: 09 / April / 2013, 18:45:33 »
I have done that before with SDM. when SDM is updated in camera, it takes picture when a pulse of 5volts is given via power supply or usb cable
That was a really useful hint, thanks.

Test build (CHDK 1.2, diskboot only) attached.

Code: [Select]
Index: platform/ixus105_sd1300/kbd.c
===================================================================
--- platform/ixus105_sd1300/kbd.c (revision 2692)
+++ platform/ixus105_sd1300/kbd.c (working copy)
@@ -102,7 +102,7 @@
  physw_status[2] = (kbd_new_state[2] & (~KEYS_MASK2)) | (kbd_mod_state[2] & KEYS_MASK2);
  }
 
- _kbd_read_keys_r2(kbd_new_state);
+ _kbd_read_keys_r2(physw_status);
 
  usb_remote_key();

edit: attachment no longer necessary, removed
« Last Edit: 10 / April / 2013, 18:49:28 by srsa_4c »


Re: PTP Control for IXUS105 / SD1300
« Reply #14 on: 10 / April / 2013, 07:05:47 »
Finally.. I'm able to control my camera with "ptpcamgui". Thanks everyone who helped me out.. special thanks to srsa for making updates to chdk firmware. I'm using "CHDKPTPRemote" (C# wrapper) to build my own customized application, will comeback when i stuck somewhere  8)
« Last Edit: 11 / April / 2013, 14:40:00 by NaveedESahar »
Naveed E Sahar

Re: PTP Control for IXUS105 / SD1300
« Reply #15 on: 10 / April / 2013, 07:41:41 »
unfortunately SDM does not have that much capabilities as CHDK

Actually, there is an SDM build that has very powerful PTP capabilities.
This will not be in the SDM 1.86 release.
I have decided it would be too much work supporting it.
However, I think you will find it very interesting.
Send me a message and I will send you a build to test .
You will not need SDMConGui (an AutoIt script) anyway.
(The script would need considerable cleaning-up and I cannot remember how it works, not enough comments).


David
« Last Edit: 10 / April / 2013, 07:44:32 by Microfunguy »

*

Offline srsa_4c

  • ******
  • 4426
Re: PTP Control for IXUS105 / SD1300
« Reply #16 on: 10 / April / 2013, 18:34:48 »

Re: PTP Control for IXUS105 / SD1300
« Reply #17 on: 15 / April / 2013, 05:08:43 »
Hi srsa_4c,
I'm facing another problem, you were very responsive and help full throughout the thread i dont know if I should bother you again..
I'm writing a simple c# script using "ptpcam.exe". I can execute any command or script. Problem is i want my camera to shoot as soon as possible. currently I'm having delay of 750milisecon between shoot() command sent and picture taken. The delay is due to camera performs exposure process before it takes snapshot. when i'm using my camera as hand held, and when i half press the shoot button, it focuses itself and immediately takes snap when fully pressed. this is what i'm trying to do through ptp. I'm planning to write application that always force camera to half press the shoot button and when i need snap it send full_shoot command. I'm using command "lua press("shoot_half")". Camera focuses it self but then release the focus immediately. Can you suggest any solution to this problem? Hope I'm able to explain my problem

rgrds,
naveed
Naveed E Sahar


*

Offline reyalp

  • ******
  • 13387
Re: PTP Control for IXUS105 / SD1300
« Reply #18 on: 16 / April / 2013, 02:31:36 »
I'm using command "lua press("shoot_half")". Camera focuses it self but then release the focus immediately. Can you suggest any solution to this problem? Hope I'm able to explain my problem
When the script command finishes, all the keys it had pressed are released.

To write a script that holds half press and waits for a command from the PC to shoot, you can use the PTP message interface (see http://chdk.wikia.com/wiki/Lua/PTP_Scripting)

A very simple example:
Code: [Select]
lua press('shoot_half'); repeat r=read_usb_msg(1000); if r=='shoot' then click('shoot_full_only') end until r=='exit'
putm shoot
putm exit
above tested in chdkptp, but should work in ptpcam as well. You can see some more complicated examples of messages scripts in lua/rlib.lua in the chdkptp source.

Alternately, you could use logical event functions http://chdk.wikia.com/wiki/Lua/Lua_Reference/Levent to send key presses.

press shoot_half
Code: [Select]
lua post_levent_to_ui('PressSwOne')

press shoot_full
Code: [Select]
post_levent_to_ui('PressSwTwo')
Will press shoot_full
When you are done, you need to call the corresponding Unpress
Code: [Select]
post_levent_to_ui('UnpressSwTwo')
post_levent_to_ui('UnpressSwOne')
Since these are canon events, they aren't cleared when the script exits.

Finally, if you want to control directly in C# instead of going through command line programs, this might be useful: http://chdk.setepontos.com/index.php?topic=4338.msg94620#msg94620
Don't forget what the H stands for.

Re: PTP Control for IXUS105 / SD1300
« Reply #19 on: 16 / April / 2013, 08:00:53 »
Thanks very much for the solution I can perform the press button using levent functions. Regarding CHDKPTPRemote wrapper, i explored this library before i shifted to ptpcam. I thought that library is missing alot of functions but the problem was I didn't knew how to execute those functions. Thanks again

Naveed
« Last Edit: 16 / April / 2013, 08:03:26 by NaveedESahar »
Naveed E Sahar

 

Related Topics