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

chdkptp - alternative ptp client

  • 1106 Replies
  • 517588 Views
*

Offline reyalp

  • ******
  • 14082
Re: alternative ptp client
« Reply #540 on: 11 / February / 2014, 17:12:43 »
Advertisements
Any exposure longer than 18 seconds or 9 seconds plus dark frame causes a timeout problem.
Thanks for checking that. I'll add options for the various timeouts when I get a chance.

Quote
On the shorter exposures everything works perfectly.
Just for completeness,  this is using a590? What OS and chdkptp version?
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14082
Re: alternative ptp client
« Reply #541 on: 11 / February / 2014, 17:30:02 »
1) eventually I get ERROR: too many nested source calls,
Yes, this isn't really the way to make a loop, for that you should use Lua
I would suggest doing it something like this:
Code: [Select]
!dofile('d:/path/to/interval.lua')

where interval.lua is something like
Code: [Select]
while true do
status,err=cli:execute('rs -dng d:/path/to/downloaded/pics')
if not status then break end
sys.sleep(5000)
status, err=cli:execute('rm DCIM -skip_topdirs')
if not status then break end
sys.sleep(2000)
end
cli:print_status(status,err)
This will run until there is an error. Unfortunately, there is currently no good way to check for input inside a chdkptp script without blocking, but with the above script, turning off the camera would end it.

Note The \ are changed to / in the path, otherwise they will be treated as escape characters.

Quote
2) once the script runs, there's no nice way to stop it.
Yeah, this is the input problem mentioned above. I would like to fix this at some point, but it's a bit complicated. In the gui, you could run your script from a timer, but that's more complicated code than I can write off the top of my head right now.

I assume you are using -dng and rm because your camera doesn't yet support jpeg remoteshoot? If so, let us know which camera you have, someone may be able to implement it for you.
Don't forget what the H stands for.

*

Offline lyzby

  • **
  • 52
Re: alternative ptp client
« Reply #542 on: 11 / February / 2014, 22:03:54 »
Regarding the problem of timing out using rs on the A590, the exposure is brief (fraction of a second), and the timeout takes about 10 seconds to occur.

I tried another camera on the Dockstar, an SX40HS.  rs works fine, and "rs /var/www/test" puts the file, "test.jpg" in /var/www, where I can view it with a browser from my laptop.

Any further thoughts on getting this to work with the A590?

I'll try compiling chdkptp on a Ubuntu device tomorrow to see if that gets me any further (tho I really need to use the dockstar or other small headless device).

*

Offline reyalp

  • ******
  • 14082
Re: alternative ptp client
« Reply #543 on: 11 / February / 2014, 23:16:42 »
Regarding the problem of timing out using rs on the A590, the exposure is brief (fraction of a second), and the timeout takes about 10 seconds to occur.
Since a590 apparently works for blackhole, the most likely explanation seems like either a difference in settings (probably Canon firmware, but maybe CHDK) or a difference between the 100e and 101b ports.

Quote
I'll try compiling chdkptp on a Ubuntu device tomorrow to see if that gets me any further (tho I really need to use the dockstar or other small headless device).
Since the SX40 works, it seems quite unlikely it would be an OS specific issue. Would be good to confirm though.

edit:
I think I have found the bug
The filewrite task address was incorrect for 100e in the task hook. Try the attached test build.
« Last Edit: 12 / February / 2014, 00:14:26 by reyalp »
Don't forget what the H stands for.


*

Offline blackhole

  • *****
  • 940
  • A590IS 101b
    • Planetary astrophotography
Re: alternative ptp client
« Reply #544 on: 12 / February / 2014, 01:37:07 »
Any exposure longer than 18 seconds or 9 seconds plus dark frame causes a timeout problem.
Thanks for checking that. I'll add options for the various timeouts when I get a chance.

Quote
On the shorter exposures everything works perfectly.
Just for completeness,  this is using a590? What OS and chdkptp version?
Yes, I'm talking about the a590, I tried with Win XP and Win 7 and there is no difference.
chdkptp client version is r438 and r468, also no difference in use.

*

Offline lyzby

  • **
  • 52
Re: alternative ptp client
« Reply #545 on: 12 / February / 2014, 10:03:19 »
>I think I have found the bug ... The filewrite task address was incorrect for 100e in the task hook. Try the attached test build.

Yes--that fixed it.  Thank you very much.  rs works and "rs /var/www/test2" puts test2.jpg in /var/www, from which I can view it in the browser on my laptop, which is what I was looking for.

Thanks very much.


*

Offline lyzby

  • **
  • 52
Re: alternative ptp client
« Reply #546 on: 12 / February / 2014, 14:06:41 »
I'm now trying a camera with more zoom--the SX120IS.

lua_shoot() works, but rs fails with "unsupported format".  Here is the sequence with "set cli_verbose=2" turned on.

 /usr/src/chdkptp/chdkptp -i -c
connected: Canon PowerShot SX120 IS, max packet size 512
con> lua set_zoom(20)
con 1> lua set_zoom(10)
con 2> rs
ERROR: not in rec mode
con 3> rec
con 4> lua set_zoom(12)
con 5> rs /var/www/test3
ERROR: unsupported format
con 6>  set cli_verbose=2
con 6> rs
rs_init
ERROR: unsupported format
con 7> q
bye

What is needed to get this to work?

Re: alternative ptp client
« Reply #547 on: 12 / February / 2014, 14:53:12 »
Thanks so much reyalp, that works great.
I assume you are using -dng and rm because your camera doesn't yet support jpeg remoteshoot? If so, let us know which camera you have, someone may be able to implement it for you.
That's right. It would be nice if I could get the images as jpegs. I'm using some old canon powershots: SD700 IS and SD850 IS.
Thanks again!


*

Offline reyalp

  • ******
  • 14082
Re: alternative ptp client
« Reply #548 on: 12 / February / 2014, 15:59:43 »
Yes--that fixed it.  Thank you very much.
Thanks for confirming, and sorry it took so long to get to the root of the problem. I've checked this in to the trunk and stable builds.

What is needed to get this to work?
Some additional code needs to be added for each port, same as for trig. This isn't huge job, so I or someone else here may be able to make builds if there is someone willing to test.

What Canon firmware version does your sx120is have?

Note that you should be able to get DNG files using remoteshoot with -dng on any CHDK supported camera. If jpeg support isn't implemented, the jpegs will still be saved to the card though.

That's right. It would be nice if I could get the images as jpegs. I'm using some old canon powershots: SD700 IS and SD850 IS.
Thanks again!
What is the canon firmware version of your sd700 ?
Don't forget what the H stands for.

*

Offline lyzby

  • **
  • 52
Re: alternative ptp client
« Reply #549 on: 12 / February / 2014, 20:04:41 »
Yes, rs -dng worked.

:/usr/src/chdkptp/lua# /usr/src/chdkptp/chdkptp -i -c
connected: Canon PowerShot SX120 IS, max packet size 512
con> rec
con 1> rs /var/www/testdng -dng
con 4> q
bye

Firmware is GM1.00B.

I would be happy to test if someone can enable jpg downloading with rs for the SX120IS.

 

Related Topics