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

chdkptp - alternative ptp client

  • 1097 Replies
  • 388758 Views
*

Offline tpont

  • **
  • 81
Re: alternative ptp client
« Reply #330 on: 26 / April / 2013, 19:17:34 »
Advertisements
I finally got around to testing this some more just now.

The exposure times I get with the a800 in actual use is 1/100 or 1/80 sec  (read from the jpeg exif data).

I have now tested out a powershot a2300 (DIGIC4; 16 Mpix) camera and running
Code: [Select]
=t0=get_tick_count();press('shoot_half');repeat sleep(10) until get_shooting();t1=get_tick_count();click('shoot_full');repeat sleep(10) until not get_sho oting(); t2=get_tick_count();return t1-t0,t2-t1gives much better results
Code: [Select]
time 2.1031
return 210
return 1670
The camera was set to iso 100 I had run set_aflock(1) earlier.
The good result was had without tweaking the lighting but is already good enough for me  - I was aiming at 2 second cycles. So I guess this might be one of those cases where shifting to newer hardware will prove the easiest solution.
« Last Edit: 26 / April / 2013, 19:25:14 by tpont »

Re: alternative ptp client
« Reply #331 on: 15 / May / 2013, 08:00:54 »
I have some problems compiling latest chdkptp.

Here are steps to reproduce the problem:

First I svn chdkptp
Code: [Select]
svn co http://subversion.assembla.com/svn/chdkptp/
Then I red README.TXT where it says I should download prebuilt IUP and CD

Downloading cd-5.6.1_Linux26g4_lib.tar.gz
Code: [Select]
wget -c http://downloads.sourceforge.net/project/canvasdraw/5.6.1/Linux%20Libraries/cd-5.6.1_Linux26g4_lib.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fcanvasdraw%2Ffiles%2F5.6.1%2FLinux%2520Libraries%2F&ts=1368615412&use_mirror=surfnet


Same goes for IUP iup-3.8_Linux32_lib.tar.gz
Code: [Select]
wget -c http://downloads.sourceforge.net/project/iup/3.8/Linux%20Libraries/iup-3.8_Linux26g4_lib.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fiup%2Ffiles%2F3.8%2FLinux%2520Libraries%2F&ts=1368618505&use_mirror=garr
I've then unpacked both in separate directories:
Code: [Select]
pwd /home/streznik/foto/IUP
pwd /home/streznik/foto/CD

Afterwards I copied config-sample-linux.mk to config.mk in folder where I did sv: /home/streznik/foto/chdkptp/trunk
Here is config.mk
Code: [Select]
IUP_SUPPORT=0
CD_SUPPORT=0

LUA_INCLUDE_DIR=/usr/include/

DEBUG=1

IUP_LIB_DIR=/home/streznik/foto/IUP
IUP_INCLUDE_DIR=/home/streznik/foto/IUP/include/
CD_LIB_DIR=/home/streznik/foto/CD
CD_INCLUDE_DIR=/home/streznik/foto/CD/include

For better reading I left out lines starting with #

After editing config.ml I ran make in /home/streznik/foto/chdkptp/trunk
Code: [Select]
make[1]: Entering directory `/home/streznik/foto/chdkptp/trunk/lfs'
gcc -MMD -DCHDKPTP_OSTYPE=\"Linux\" -Wall -g -I/usr/include/ -c -o lfs.o lfs.c
lfs.c:779:30: error: array type has incomplete element type
 static const struct luaL_reg fslib[] = {
                              ^
lfs.c: In function ‘luaopen_lfs’:
lfs.c:798:2: warning: implicit declaration of function ‘luaL_register’ [-Wimplicit-function-declaration]
  luaL_register (L, "lfs", fslib);
  ^
lfs.c: At top level:
lfs.c:779:30: warning: ‘fslib’ defined but not used [-Wunused-variable]
 static const struct luaL_reg fslib[] = {
                              ^
make[1]: *** [lfs.o] Error 1
make[1]: Leaving directory `/home/streznik/foto/chdkptp/trunk/lfs'
make: *** [all-recursive] Error 1


I'm running archlinux on 32 bit system.

lua versions:
lua 5.2.2-1
lua51 5.1.5-3

Both installed from official repos.

Any help would be much appriciated since I'd like to run latest version of chdkptp for my ixus 220hs aka elph 300hs.
« Last Edit: 15 / May / 2013, 08:18:44 by frojnd »

Re: alternative ptp client
« Reply #332 on: 15 / May / 2013, 08:09:35 »
As it turns out thanx to c10ud @freenode I was having wrong includes for lua. Those are correct ones for me:
Code: [Select]
LUA_INCLUDE_DIR=/usr/include/lua5.1
LUA_LIB=lua5.1

Thank you c10ud again :)

Re: alternative ptp client
« Reply #333 on: 15 / May / 2013, 10:26:28 »
So I'm using ixus 220 hs aka elph 300hs and when I use chdkptp gui after a few shots it freezes a little and Live area where output text is I get this:

Quote
tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0recording to chdk_3229_20130515_161120.lvdump
grabbing frame 1
grabbing frame 2
grabbing frame 3
grabbing frame 4
grabbing frame 5
2448536 bytes recorded to chdk_3229_20130515_161124.lvdump
recording to chdk_3229_20130515_161124.lvdump
tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0live timer update error
/home/streznik/foto/chdkptp/trunk/lua/chdku.lua:1165: write failed
stack traceback:
   [C]: in function 'fwrite'
   /home/streznik/foto/chdkptp/trunk/lua/chdku.lua:1165: in function 'live_dump_frame'
   /home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:342: in function 'record_dump'
   /home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:400: in function </home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:383>
   [C]: in function 'xpcall'
   /home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:424: in function </home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:422>
   (tail call): ?
   [C]: in function 'MainLoop'
   /home/streznik/foto/chdkptp/trunk/lua/gui.lua:677: in function </home/streznik/foto/chdkptp/trunk/lua/gui.lua:663>
   (tail call): ?
   /home/streznik/foto/chdkptp/trunk/lua/main.lua:227: in main chunk
   [C]: in function 'require'
   [string "require('main')"]:1: in main chunklive timer update error
/home/streznik/foto/chdkptp/trunk/lua/chdku.lua:1165: write failed
stack traceback:
   [C]: in function 'fwrite'
   /home/streznik/foto/chdkptp/trunk/lua/chdku.lua:1165: in function 'live_dump_frame'
   /home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:342: in function 'record_dump'
   /home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:400: in function </home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:383>
   [C]: in function 'xpcall'
   /home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:424: in function </home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:422>
   (tail call): ?
   [C]: in function 'MainLoop'
   /home/streznik/foto/chdkptp/trunk/lua/gui.lua:677: in function </home/streznik/foto/chdkptp/trunk/lua/gui.lua:663>
   (tail call): ?
   /home/streznik/foto/chdkptp/trunk/lua/main.lua:227: in main chunk
   [C]: in function 'require'
   [string "require('main')"]:1: in main chunklive timer update error
/home/streznik/foto/chdkptp/trunk/lua/chdku.lua:1165: write failed
stack traceback:
   [C]: in function 'fwrite'
   /home/streznik/foto/chdkptp/trunk/lua/chdku.lua:1165: in function 'live_dump_frame'
   /home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:342: in function 'record_dump'
   /home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:400: in function </home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:383>
   [C]: in function 'xpcall'
   /home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:424: in function </home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:422>
   (tail call): ?
   [C]: in function 'MainLoop'
   /home/streznik/foto/chdkptp/trunk/lua/gui.lua:677: in function </home/streznik/foto/chdkptp/trunk/lua/gui.lua:663>
   (tail call): ?
   /home/streznik/foto/chdkptp/trunk/lua/main.lua:227: in main chunk
   [C]: in function 'require'
   [string "require('main')"]:1: in main chunklive timer update error
/home/streznik/foto/chdkptp/trunk/lua/chdku.lua:1165: write failed
stack traceback:
   [C]: in function 'fwrite'
   /home/streznik/foto/chdkptp/trunk/lua/chdku.lua:1165: in function 'live_dump_frame'
   /home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:342: in function 'record_dump'
   /home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:400: in function </home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:383>
   [C]: in function 'xpcall'
   /home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:424: in function </home/streznik/foto/chdkptp/trunk/lua/gui_live.lua:422>
   (tail call): ?
   [C]: in function 'MainLoop'
   /home/streznik/foto/chdkptp/trunk/lua/gui.lua:677: in function </home/streznik/foto/chdkptp/trunk/lua/gui.lua:663>

It goes like that until lI manage to shutdown camera.

I've also found when enabling Viewfinder in livegui colors are somehow unreadable. Is this normal?  (see attachment)

Also how do I access  alt menu? For ixus 220hs when I'm in chdk I have to press short video button and then menu. But in chdkptp when I press video it immediatelly starts to capture a video. Can I remap alt menu button somehow? How do I fix this?

Glad I'm using latest chdkptp    :) Thank you reyalp!


*

Offline nafraf

  • *****
  • 1308
Re: alternative ptp client
« Reply #334 on: 15 / May / 2013, 13:00:06 »
I've also found when enabling Viewfinder in livegui colors are somehow unreadable. Is this normal?  (see attachment)
It is a bug: vid_get_palette_type(), vid_get_palette_size(), vid_get_bitmap_active_palette() are missing in ixus220 port. It is specific to ixus220 port, so I posted a patch to ixus220 porting thread.

*

Offline reyalp

  • ******
  • 13391
Re: alternative ptp client
« Reply #335 on: 15 / May / 2013, 15:58:02 »
Also how do I access  alt menu? For ixus 220hs when I'm in chdk I have to press short video button and then menu. But in chdkptp when I press video it immediatelly starts to capture a video. Can I remap alt menu button somehow? How do I fix this?
Unfortunately, there is currently no way to manipulate the alt menu through Lua (and hence, over PTP). This would be a very useful feature, but the current script architecture does not allow sending keys to the CHDK UI, they just go to the Canon OS. You can set many settings using set_config_value http://chdk.wikia.com/wiki/Script_commands#set_config_value

Regarding your other errors, it's very hard to understand without some idea of what you were actually doing. The only actual error I see is

"/home/streznik/foto/chdkptp/trunk/lua/chdku.lua:1165: write failed"

From that looks like you were trying to make a live view dump and the file write failed. This seems like it would most likely be due to something outside chdkptp (permissions or something like that?) but you don't say anything about trying to make a live dump?

The live view dump is probably only useful for debug.

I'm not clear how you would be getting the  "tried to set invalid mode 0" spam, this should only happen you change the mode dropdown menu.
Don't forget what the H stands for.

Re: alternative ptp client
« Reply #336 on: 16 / May / 2013, 12:19:56 »
Quote
It is a bug: vid_get_palette_type(), vid_get_palette_size(), vid_get_bitmap_active_palette() are missing in ixus220 port. It is specific to ixus220 port, so I posted a patch to ixus220 porting thread.

Thank you natraf, I've tested it: http://chdk.setepontos.com/index.php?topic=6341.msg100594#msg100594

reyalp: whenever I switch from rec to play mode but not from play to rec mode  I get this:

Quote
tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0tried to set invalid mode 0
Note: this is for each switch.

Quote
Unfortunately, there is currently no way to manipulate the alt menu through Lua (and hence, over PTP). This would be a very useful feature, but the current script architecture does not allow sending keys to the CHDK UI, they just go to the Canon OS. You can set many settings using set_config_value http://chdk.wikia.com/wiki/Script_commands#set_config_value

Thank you reyalp, yes it would be great to have alt menu. Will digg into this at least for enabling/disabling dng option.
« Last Edit: 16 / May / 2013, 13:36:30 by frojnd »

*

Offline reyalp

  • ******
  • 13391
Re: alternative ptp client
« Reply #337 on: 16 / May / 2013, 16:47:21 »
reyalp: whenever I switch from rec to play mode but not from play to rec mode  I get this:
OK, I see this on linux too, looks like a difference in behavior either due to IUP version or the underlying gui toolkits. It looks like emptying the dropdown is calling gui.mode_dropdown:valuechanged_cb for each item that was in the list. I'll look into this more later, but these messages are probably harmless.
Don't forget what the H stands for.


Re: alternative ptp client
« Reply #338 on: 16 / May / 2013, 17:38:55 »
Hi reyalp,

I've compiled for 64bit version of linux and sometimes (can't reproduce when) I experience following behaviour. I turn usb cable into camera and into computer. On computer is usb 3.0

Then I power up camera and I see only for a second or less last taken photo and then display immediately goes to sleep (only green light is on) display turns off. And if I don't turn camera off before I start chdkptp and connects I have to cold reboot it (take the battery out)

Code: [Select]
bash chdkptp-sample.sh -c -i
connected: Canon IXUS 220 HS, max packet size 512
con> set cli_verbose=1
con> set cli_time=true
time 0.0000
con> rec
time 0.1029
con 1> shoot
time 0.0386
con 2> shoot -raw=1
time 0.0344
con 3> q
time 0.0000
bye

I do all this and I can't shoot, camera won't actually go to rec mode.

I'm not sure if this is only on 64 bit computer but I experienced twice in a day today.

P.S. It also happens on usb 2.0 and other usb ports. After connecting to device I can execute stuff for a period of time but then it becomes unresponsible I can't even reboot device from cli.
« Last Edit: 16 / May / 2013, 17:47:35 by frojnd »

*

Offline reyalp

  • ******
  • 13391
Re: alternative ptp client
« Reply #339 on: 16 / May / 2013, 22:13:20 »
I do all this and I can't shoot, camera won't actually go to rec mode.

I'm not sure if this is only on 64 bit computer but I experienced twice in a day today.

P.S. It also happens on usb 2.0 and other usb ports. After connecting to device I can execute stuff for a period of time but then it becomes unresponsible I can't even reboot device from cli.
Waterwingz also reported something like this. My strong suspicion is that there is something automatically accessing the camera and changing it's state when you connect it (for example, something that tries to automount the camera or transfer photos). This is not specific to 64 bit, but might be be related to newer kernels or distros. I have seen similar effects on windows when using the "filter" libusb driver rather than the "inf" driver.

If you look at the kernel log, that may give some hints. You might also find something in the udev rules, mentioned in this post http://chdk.setepontos.com/index.php?topic=6231.msg89252#msg89252
Don't forget what the H stands for.

 

Related Topics