chdkptp - alternative ptp client - page 2 - General Discussion and Assistance - CHDK Forum
supplierdeeply

chdkptp - alternative ptp client

  • 1106 Replies
  • 551708 Views
*

Offline reyalp

  • ******
  • 14118
Re: alternative ptp client
« Reply #10 on: 17 / April / 2011, 22:18:30 »
Advertisements
Some progress:
- The gui now has a very alpha file browser. You can
* browse files. directories with very large numbers of files might cause the camera to run out of memory, we really need an alternative to os.listdir that lets you iterate over a directory instead of dumping the whole thing into a table.
* download selected file. Multiple selection and whole directory downloads aren't implemented yet
* upload files to a selected directory. Multiple section is supported, directories/recursive uploads are not
* delete files (but not directories)
* crash the camera, crash the client, and maybe trash your files :haha
- ls command in CLI
- and a bunch of useful supporting code: listdir shows how the ptp message stuff is intended to be used, serialize/unserialize makes passing values between lua and pc super easy.



edit:
binaries are here http://www.assembla.com/spaces/chdkptp/documents
Actually, the C code has not changed since the last build I posted. All of the above was done entirely in lua. I did update the win32 version to use IUP 3.4
« Last Edit: 17 / April / 2011, 22:36:45 by reyalp »
Don't forget what the H stands for.

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: alternative ptp client
« Reply #11 on: 18 / April / 2011, 14:51:55 »
This is a very sophisticated work - respect.

My first test was successful. With installed Lua for Windows it's easy to start the GUI. The camera functions are working properly. The file browser represents a new quality of ptp communication. The connection between computer and camera is fast and stable.


msl
CHDK-DE:  CHDK-DE links

*

Offline reyalp

  • ******
  • 14118
Re: alternative ptp client
« Reply #12 on: 18 / April / 2011, 16:25:59 »
My first test was successful. With installed Lua for Windows it's easy to start the GUI.
Not sure if I'm understand, if you mean http://code.google.com/p/luaforwindows/ it's not needed.

The windows binary I posted is completely standalone, IUP and lua are statically linked into chdkptp.exe. Assuming you have libusb, you can just unzip and run. The linux binary is dynamically linked, so you would need IUP and lua .so files

If you want to compile, then you need  IUP and lua libraries to link to.

Still lots to do, my goal is to make it useful enough that other people want to work on it ;)

Don't forget what the H stands for.

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: alternative ptp client
« Reply #13 on: 18 / April / 2011, 16:55:17 »
Not sure if I'm understand, if you mean http://code.google.com/p/luaforwindows/ it's not needed.

Yes, this was my mistake. I've tested some iup sample scripts with Lua for Windows. The client works without this installation.

msl
CHDK-DE:  CHDK-DE links


*

Offline reyalp

  • ******
  • 14118
Re: alternative ptp client
« Reply #14 on: 24 / April / 2011, 17:46:36 »
With protocol version 2, we now have a pretty much transparent remote procedure call from lua. chdku.exec with the appropriate options returns a status, plus the camera functions return values, e.g.
Code: [Select]
con 1> !return chdku.exec("return get_mode()",{wait=true,libs={"serialize","seri
alize_msgs"}})
=true,false,false,513

con 2> !return chdku.exec("return os.listdir('A/DCIM')",{wait=true,libs={"serialize","serialize_msgs"}})
=true,{
 [1]="100CANON",
 [2]="CANONMSC",
}

con 3> !return chdku.exec("return os.listdir('A/doesnotexist')",{wait=true,libs={"serialize","serialize_msgs"}})
=true,nil,"A/doesnotexist: error",0
:D

edit to add:
practical application

Code: [Select]
./chdkptp -c -i
con 9> !t=chdku.listdir('A/DCIM/100CANON',{match=".JPG$"})
con 10> !for i,n in ipairs(t) do chdk.download("A/DCIM/100CANON/"..n,"img/"..n) end
« Last Edit: 06 / May / 2011, 23:30:50 by reyalp »
Don't forget what the H stands for.

*

Offline KenO

  • ***
  • 122
Re: alternative ptp client
« Reply #15 on: 13 / May / 2011, 11:54:25 »
Will Revision 36 work with A570? 

If so is there any docs?  Especially what is working and what is Not. 
Checked http://www.assembla.com/spaces/chdkptp/documents  but was unable to get details.

Also status of project and next release?

Thanks

Ken

*

Offline reyalp

  • ******
  • 14118
Re: alternative ptp client
« Reply #16 on: 13 / May / 2011, 13:19:22 »
Will Revision 36 work with A570? 
Should work in with any recent CHDK or CHDKDE build. If ptpcam/ptpcamgui work, then this will too. If you use it, I suggest using the latest .lua files from SVN http://trac.assembla.com/chdkptp/browser/trunk/lua

The executable hasn't changed, so you can just replace the .lua files.
Quote
If so is there any docs?  Especially what is working and what is Not. 
Checked http://www.assembla.com/spaces/chdkptp/documents  but was unable to get details.
Not much yet. You can see http://trac.assembla.com/chdkptp/browser/trunk/USAGE.TXT and comments in the source code. All the CLI commands should work, as should all the chdk.* API functions. The GUI is not really useful yet. The main advantage over ptpcam right now is the ability to easily script interactions with the the camera (look at chdku.downloaddir and chdk.deletefiles for example)
Quote
Also status of project and next release?
Not really. You can see some of the things I plan to do in http://www.assembla.com/spaces/chdkptp/tickets

The "milestones" are just to organize order and priority, just because something appears in "alpha 1" doesn't mean there will be an "alpha 1" release with those things in it. There is no schedule, my time to work on personal projects is limited and unpredictable right now.
Don't forget what the H stands for.

*

Offline KenO

  • ***
  • 122
Re: alternative ptp client
« Reply #17 on: 13 / May / 2011, 17:25:40 »
Hi reyalp,

Thanks for your detailed explanations.

Checked all the links and the only way I can help at present is to test if works on my A570.

I had not seen mention of CHDKDE so did some searching and found
http://chdk.setepontos.com/index.php?topic=5456.0

Since you are the chief developer of chdkptp is there any advantage of using CHDKDE instead of the standard CHDK?

Also is it possible to be notified when the GUI becomes usable?

Thanks

Ken


*

Offline KenO

  • ***
  • 122
Re: alternative ptp client
« Reply #18 on: 14 / May / 2011, 11:15:18 »
Hi reyalp,

Question:  every time I turn off my A570 the Drive mode changes back to single from continuous. 

Is there any way CHDK, CHDKDE or CHDKPTP can change the default drive mode from single to continuous?

Seems many other Canon P&S have this same problem
http://www.digitalcamerainfo.com/content/Canon-PowerShot-A720-IS-Digital-Camera-Review-15944/Modes.htm

Thanks

Ken

*

Offline reyalp

  • ******
  • 14118
Re: alternative ptp client
« Reply #19 on: 14 / May / 2011, 15:59:31 »
Since you are the chief developer of chdkptp is there any advantage of using CHDKDE instead of the standard CHDK?
Some additional functions are available in chdkde lua. If you need them, then it's an advantage. This isn't specific to use with PTP clients like chdkptp.
Quote
Also is it possible to be notified when the GUI becomes usable?
I will certainly post here.

Quote
Question:  every time I turn off my A570 the Drive mode changes back to single from continuous.

Is there any way CHDK, CHDKDE or CHDKPTP can change the default drive mode from single to continuous?
Not conveniently as far as I know.

You can script button presses, so you could switch it to continuous mode by pressing func set etc. You can have a script run at startup, but this means you can't have another script selected. Also, it would only work in record mode, and might have trouble if the canon firmware remembers the position in the menu.

At some point it would be nice to make some "autoexec" scripts that run on certain events, like startup or switching between rec and play.

This is all off-topic for chdkptp, since it isn't specific to USB. I'm sure this problem with continuous mode has been discussed many times on the forum.
Don't forget what the H stands for.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal