make_usb_connection SDM only? - Hello, I'm a NEWBIE - HELP!! (Newbies assistance, User Guides and thank you notes) - CHDK Forum

make_usb_connection SDM only?

  • 6 Replies
  • 2663 Views
make_usb_connection SDM only?
« on: 22 / February / 2011, 09:19:54 »
Advertisements
I'm having great trouble sorting out all the info here. I'd like to use some of the features that are not in SDM, but I get the distinct impression SDM is the only build that supports make_usb_connection (or some equivalent), and I really need it to periodically enable download of pictures from my A480. So what is the actual story? Can I, by hook or by crook, enable USB connections with the trunk CHDK build? If I can, what is the command?

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: make_usb_connection SDM only?
« Reply #1 on: 22 / February / 2011, 13:06:06 »
Without knowing what that command really does I can't be certain... but doesn't a mere mode switch to PLAY mode (followed by a sufficiently long sleep and a switch back to REC mode) do that?

Re: make_usb_connection SDM only?
« Reply #2 on: 22 / February / 2011, 16:51:00 »
Don't know. I guess I'll fool around with it some. I did download the source and found a function named something like switch_usb_mode that is compiled differently if PTP is enabled, so maybe that is what I'm looking for (but I don't know if the standard build for the A480 enables PTP either). I want to be able to use the USB remote to trigger taking a photograph, but then I want it to enable USB downloads for a bit after that so my computer can grab the photo, so it gets tricky using the USB line for two different things (but in my experiments, I did get it to work with SDM).

Re: make_usb_connection SDM only?
« Reply #3 on: 22 / February / 2011, 18:03:28 »
Have you tried this USB function ?  :-

upload_images_for

Switches to playback mode, enables USB upload for defined time and then returns to record mode.
This command may be used with WIA-Loader to upload images at regular intervals.

http://stereo.jpn.org/eng/sdm/upload.htm
http://stereo.jpn.org/eng/sdm/upload2.htm
« Last Edit: 22 / February / 2011, 18:05:57 by Microfunguy »

Re: make_usb_connection SDM only?
« Reply #4 on: 22 / February / 2011, 18:13:23 »
Yea, I've used upload_images_for in SDM, but I'm trying to figure out if I can do the same sort of thing in "normal" CHDK so I can take advantage of some things that SDM doesn't include like lua scripting and DNG images.

Re: make_usb_connection SDM only?
« Reply #5 on: 22 / February / 2011, 18:56:41 »
SDM 1.85 supports DNG.
On the three cameras I tested the raw data was saved in slightly less than one second.
Conversion to DNG is done on PC or Mac :-

http://stereo.jpn.org/eng/sdm/dng.htm
http://www.zenoshrdlu.com/sdmdng/

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: make_usb_connection SDM only?
« Reply #6 on: 23 / February / 2011, 15:29:57 »
Don't know. I guess I'll fool around with it some. I did download the source and found a function named something like switch_usb_mode that is compiled differently if PTP is enabled, so maybe that is what I'm looking for (but I don't know if the standard build for the A480 enables PTP either). I want to be able to use the USB remote to trigger taking a photograph, but then I want it to enable USB downloads for a bit after that so my computer can grab the photo, so it gets tricky using the USB line for two different things (but in my experiments, I did get it to work with SDM).

It's currently set_record and switch_mode_usb in CHDK, I think. The former doesn't work on many cameras if PTP is active, so you need to use the other one to return from play to rec.

So I think your (Lua, but ubasic probably has the same commands, just lose the parentheses and comments) script should have something like

...
set_record(0) -- switch to play from rec
sleep(60*1000) -- give the PC a minute to connect and transfer images
switch_mode_usb(1) -- switch to rec
...

but I really haven't tried this lately and even if I did, it could be different for your camera since mine is a vxworks camera.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal