-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathREADME.TXT
169 lines (124 loc) · 6.12 KB
/
README.TXT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
=Introduction=
chdkptp is a tool to access the custom PTP extension of the CHDK firmware addon for canon
cameras.
This is an alpha version - protocol, functionality, APIs, commands, command line options
are all subject to change.
Source is available from http://subversion.assembla.com/svn/chdkptp/
Binary snapshot builds are available from http://www.assembla.com/spaces/chdkptp/documents
Roadmap is under development in http://www.assembla.com/spaces/chdkptp/tickets
Changelog is at http://www.assembla.com/wiki/show/chdkptp/Changelog
This README is primarily intended for developers.
Documentation for end users can be found in USAGE.TXT
Installation information can be found in INSTALL.TXT
Information about the Raspberry pi binary builds can be found in README-RASPI.TXT
For information about CHDK, see http://chdk.wikia.com/wiki/CHDK
For information about the CHDK PTP extension, see http://chdk.wikia.com/wiki/PTP_Extension
chdkptp is forked from libptp and ptpcam, as modified by mweerden, the chdkde project developers
and others. All source is released under GPL or MIT licenses
The original ptpcam source, written by Mariusz Woloszyn < emsi[A@T]ipartners.pl >
is available from http://libptp.sourceforge.net/
mweerdens modified version can be found at https://github.com/mweerden/CHDK/tree/ptp
the CHDKDE ptpcam source may be found at http://tools.assembla.com/chdkde/browser/trunk/tools/ptpcam
chdkptp includes software from several other projects, see THANKS.TXT for details.
=Dependencies=
- IUP version 3.10.1 http://www.tecgraf.puc-rio.br/iup/ (earlier 3.x versions may also work)
Optional, edit config.mk to build without IUP GUI support
- CD Version 5.7 http://www.tecgraf.puc-rio.br/cd/ (earlier 5.x versions may also work)
Optional, used for remote display
- Lua version 5.2 http://www.lua.org/
chdkptp no longer supports Lua 5.1, although it may work
- LibUSB (libusb-win32 on windows)
- GNU readline
Optional, recommended on Linux
=Windows development environment=
Mingw with gcc 4.8+ is the primary development environment.
All instructions below assume you are using this.
Using a mingw bash shell for development is suggested.
==Installing mingw==
http://www.mingw.org/
Download the gui installer. Install at least mingw C compiler.
C++ support is required to use CD "context plus", not required or used by default.
Msys is suggested, and may be required
==Installing IUP libraries==
Get the mingw4 binary package of IUP,
http://sourceforge.net/projects/iup/files/
Note, this package has the libraries in the root, with etc/ and include/ subdirectories.
You may want to put the libraries in /lib to match the IUP recommended filesystem layout
The examples and win32 binaries are not required, but may be helpful
==Installing CD libraries==
Similar to IUP, from http://sourceforge.net/projects/canvasdraw/files/
==Installing and building Lua==
Get the lua 5.2.x source from http://www.lua.org/download.html
In a msys shell, go to the lua directory and type
make mingw
make local
NOTE:
it's very important that Lua be linked to exactly the same C runtime library
as chdkptp itself. The lbuf file routines expect to be able to fread and fwrite on
a FILE * opened by lua io.open()
This condition probably won't be met if you use a pre-compiled Lua dll on windows.
It's probably OK with a shared lua in typical linux environments.
If in doubt, build your own Lua with the same compiler you build chdkptp with.
==Installing LibUSB development package==
TODO
describe filter driver installation
http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/1.2.4.0/
libusb-win32-bin-1.2.4.0.zip
Unzip somewhere convenient
Some earlier and later versions will also probably work
=Linux development environment=
The following is based on Ubuntu 10.04, 64 bit. YMMV
Install the following packages and any required dependencies
libusb-1.0-0
libusb-dev (may be called libusb-1.0-dev ?)
Lua
Packages will be called something like
liblua5.2-dev
liblua5.2
Alternately, you may download and build your own. This is suggested
if you are building IUP and CD from source.
GNU readline
You need the development package, probably called something like
libreadline6-dev or something like that
IUP - using precompiled binaries
Download the appropriate IUP library for your platform from
http://www.tecgraf.puc-rio.br/iup/
unpack the package
adjust the IUP_LIB_DIR and IUP_INCLUDE_DIR in config.mk
You will also need a fully working gcc environment.
CD - similar to IUP
==Building IUP and CD==
If available, using pre-compiled libraries is suggested, but if you want to
build from source some notes can be found in README-RASPI-LIBS.TXT
=Configuring the source (all platforms)=
Edit config.mk to reflect the installation directories of the above packages and
desired compile time options
See config-sample-*.mk for examples
==Mac development==
See README-OSX.TXT
=Building=
make
On windows, link occasionally fails with something like
/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: reopening chdkptp.exe: Permission denied
Rebuilding seems to work around the problem
=Testing your build=
To test some internal functions use
chdkptp -e"exec require'tests':runall()"
note, this should be run from the same directory as the CHDKPTP executable
This will create (or overwrite) a file called lbuftest.dat in the current
directory, and delete it when the test completes.
To test functions that connect to the camera, use
chdkptp -e"exec require'camtests'.runbatch{bench=true,filexfer=true}"
If more than one camera is connected to the system, a random one will be used
unless you also specify devspec={dev="device name",bus="bus id"}
The filexfer tests will create and delete a local directory called camtests
in the current working directory. If you already have a directory of this name,
it will be deleted when the test completes.
Camtests will also create and delete some files and directories on the camera.
The final line of output from both test modules should be
failed 0
For for vesions prior to r562, camtests shoud be invoked with
chdkptp -e"exec require'camtests'.runstd()"
None of the above is a comprehensive test of chdkptp functionality.
=Running=
See USAGE.TXT