automatically send photos to the computer as soon as they're taken - Script Writing - CHDK Forum

automatically send photos to the computer as soon as they're taken

  • 1 Replies
  • 2535 Views
Advertisements
i thought i saw one guy who had already done this (tom horsley) but now i'm thinking that he is just working on it.  maybe someone else has done it.  has anyone managed to set it up where they hook a usb cable to the usb hub and the computer and each time a photo is taken that photo automatically get downloaded onto the computer?

with my first book i made a mistake and some of the pages were not photographed, so then i had to take about 4 hours of time getting the photos in the proper order.

*

Offline msl

  • *****
  • 1274
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: automatically send photos to the computer as soon as they're taken
« Reply #1 on: 10 / June / 2011, 19:13:47 »
First you need a pc program that automatically downloads pictures from the camera when the USB connection was detected, e.g. CAM2PC (free version is ok).

Then you need a script that switch on/off the usb connection, for example this:
Code: (lua) [Select]
--[[
******************************
run script in autostart mode
******************************
@title USB upload
@param a Upload time
@default a 30000
@param b Delay
@default b 2000
]]
 
-- autostart disconnect USB
post_levent_to_ui("DisconnectUSBCable")
 
print("switch record mode")
sleep(b)
set_record(1)
sleep(b)
print("shoot")
sleep(b)
shoot()
sleep(b)
 
print("switch play mode")
sleep(b)
set_record(0)
sleep(b)
print("connect USB cable")
sleep(b)
 
-- connect USB
post_levent_to_ui("ConnectUSBCable")
-- delay for picture transfer
sleep(a)
-- disconnect USB
post_levent_to_ui("DisconnectUSBCable")
sleep(b)

print("disconnect USB cable")
print("shutdown cam")
sleep(b)
shut_down()
sleep(3000)

Connect your cam with pc. Run script in autostart mode. The Camera should be in play mode. The script will break the usb connection, switch to record mode and makes a photo. Reconnection usb,  picture transfer if the pc program detects the camera, disconnection usb and shot down camera.

Note: I don't know if post_levent_to_ui("ConnectUSBCable/DisconnectUSBCable") works with your camera. Maybe you must play with the delays.

msl
CHDK-DE:  CHDK-DE links

 

Related Topics