- 0 Talk
-
USB Remote V2
Redirected from User:Waterwingz/USB Remote V2
|
This page describes USB Remote operation for the new development version of CHDK. For USB remote operation with the older CHDK stable version, refer to USB Remote Cable |
Using a USB cable, a low voltage power supply, and a push button switch, you can construct a device that will allow you to control the operation of your CHDK-enabled camera.

Added by WaterwingzContents |
Background
Edit
For several years, CHDK has provided a simple method of operating a Canon P&S camera from a remote USB port connected device. Built-in functionality allowed remote replication of basic "press half" and "press full" actions on the shutter button. The ability to synchronize the release of the shutter between multiple camera connected to a common control unit was implemented. There was also a limited remote zoom functionality, useful for coordinating the zoom position when many cameras were connected together.
With the passing of time, the code base supporting this functionality had become increasingly complicated and difficult to maintain or extend. To that end, starting with CHDK svn version 15xx a new set of functionality has been released. This new version provides a more stable and easy to understand interface and considerably expanded build in functionality.
The "stable" release branch of CHDK designated 1.0 continues to include the older implementation.
Introduction
Edit
CHDK version 2 USB remote code introduce a modular concept for the selection of what device is connected to the camera and how the camera reacts to that device.
The operation of devices connected to the USB port is converted to one the following states:
- switch released
- switch half pressed
- switch full pressed
A value indicating number of activations (pulse count) and a value indicating of the duration the activation (pulse width / pulse gap) is also maintained.
Supported Hardware
Edit

Added by Tim sCHDK now supports the use of several different remote control devices to control a set of camera shooting functions.
For basic shooting functions, a simple switch can be used to provide 5V to the USB connector power pins. Details about how to build such a device can be found here : Homemade USB_Remote_Cable
Note that software functionality described on that page refers to CHDK stable release 1.0
In addition to "home made" devices, a commercial product called a Ricoh CA-1 can also be used. These are widely available at camera stores or online from many sources.
For more complex operations, devices that produce multiple pulses or pulses of different time duration (width) can be used. This functionality can often be emulated with a simple switch as well.
A list of sources for USB remote switch devices is posted at the bottom of this page : Links .
Enabling USB Remote operation
Edit

Added by WaterwingzTo enable USB remote operation, go to the CHDK Remote parameters menu and select Enable Remote.
When this option is selected, the USB port on the camera will no longer be available for uploading picture files or ptp operations.
Switch Types
Edit

Added by WaterwingzNone
Edit
Default setting at start-up. Indicates that no USB device is to be monitored. Useful when a script will be interacting with the USB port.

Added by WaterwingzOnePush
Edit
Used with simple switch inputs. Pressing the switch initiates a "half-press" state. Releasing the switch initiates a "full-press" state for 100 mSec. There is no mechanism to cancel a "half-press" once this sequence is started.

Added by WaterwingzTwoPush
Edit
Used with simple switch inputs. Pressing the switch initiates a "half-press" state. Releasing the switch and then immediately pressing the again switch in less than 1/2 second initiates a "full-press" state. Full press state continues while the switch is held. Failing to immediately press the switch the second time will cancel the sequence.

Added by WaterwingzCA-1
Edit
Used with a Ricoh CA-1 switch device. Half pressing the button causes the CA-1 to create a 30 mSec pulse that initiates a "half press" state. Releasing the switch at that point will generate 2x30 mSec pulses that cancel the shooting sequences. Full pressing the button will create a 150 mSec pulse that will initiate a "full press" state for 100 mSec.
Control Modes
Edit
CHDK control modes support the translation of input device activation sequences into specific camera operations.

Added by WaterwingzNone
Edit
Tells CHDK to do nothing with switch inputs. Allows the input devices to operate - useful for scripting modes.

Added by WaterwingzNormal
Edit
Reacts to the state of the input device. On half press it places the camera in "half press" mode to focus, set exposure and flash settings. On full press it places the camera in "full press" mode to take the actual photograph. Supports sync mode - see below.

Added by WaterwingzQuick
Edit
Causes the camera to immediatly enter shooting mode (focus, exposure, flash) and take a picture immediately on the occurance of a "half shoot". Useful for automation projects where the picture should occur as quickly as possible after some condition is detected.
Sync not curently available in this mode.

Added by WaterwingzBurst
Edit
Cause the camera to enter continuous shooting mode while a half press is active. Similiar to the built in camera continuous function except that it does not reset each time the camera power is removed.
Sync not curently available in this mode.

Added by WaterwingzBracket
Edit
Uses the CHDK Bracketing in Continuous Mode settings on each half press / full press operation, changing the bracketing setting on each shot. Times out after 5 seconds of no operations. Useful for bracketing operations as it does not require settting up camera continuous mode or timer settings, which clear after each camera power cycle.
Sync not curently available in this mode.

Added by WaterwingzZoom
Edit
Uses the Pulse Count input mode to control zoom operations . used with pulse count mode. The following action happes for the listed pulse counts.
- press = zoom in
- press = zoom out,
- press = full press
- press = shoot ( sync action = )
- press = full zoom out
- press = full zoom in
Sync not curently available in this mode.

Added by WaterwingzVideo
Edit
If camera is in video shooting mode, activates filming on the first half press. Stops filming on the next half press.
If camera has a dedicated video button, will start and stop video using that button rather than the shutter switch.
Sync not curently available in this mode.
Multi-Camera Synchronization
Edit

Added by WaterwingzEnable Sync
Edit
A useful application of CHDK is the ability to connect two or more cameras together via a common USB cable so that their operation can be synchronized. The fact that the cameras are connected in parallel ensure that things happen at approximately the same time. To achieve better synchronization when taking an actual photograph, CHDK has the ability to "freeze" the picture taking process immediately before the image is actually captured. This allows CHDK on each camera to focus, adjust exposure, setup the flash and then wait for a signal to complete the shot (i.e. sync). If the Enable Sync option is set in CHDK then each camera will wait for the final transition of the USB signal ( 5V to 0V ).

Added by WaterwingzEnable Sync Delay
Edit
To more precisely tune the synchronization between cameras, CHDK allows a precise fixed delay to be added to each camera to adjust for differences in the time each camera takes to finish shooting a picture. The sync delay value is given in units of 0.1 mSec.

Added by Waterwingz
Notice in the example pictures the use of the "range multiplier" function in the upper right corner of the screenshot - used to more easily change the delay adjustment value. The range multiplier is changed in ALT mode using the zoom in / zoom out keys.
(Developer's note : the USB remote code includes optional code that can be used to calibrate the sync delay units precisely for each camera.)
Other Settings
Edit
Enable Script Start
Edit

Added by WaterwingzTells CHDK to activate the currently loaded script when the USB remote performs a full press. Useful for repetitive activation of a script without needing to press the shutter button.

Added by WaterwingzBracketing in Continuous Mode
Edit
A menu link to provide convenient access to the bracketing parameters used in USB remote bracketing mode.
USB Remote Timing Diagrams
Edit
Scripting Interface
Edit
With the release of the new USB remote functionality the get_usb_power() function has been extended to include new functionality. The basic functionality provided by get_usb_power and is_key "remote" continues to be supported.
while 1 wait_click 1 if is_key "remote" then shoot wend
Calling function get_usb_power with no parameters ( or parameter = 0 ) returns the pulse width of the most recent USB power activation
do p = get_usb_power 0 until p>0
Calling function get_usb_power with parameters = 1 returns the current state of USB power ( 0=off, 1=on)
do p = get_usb_power 1 until p>0
In addition, it is also possible to return the most recent count of pulses received and a buffered list of pulse width and pulse gap information :
do p = get_usb_power 2 until p>0
returns a buffered pulse width or pulse gap value (width values are positive, gap values are negative)
do p = get_usb_power 3 until p>0
returns the most recent number of pulses in a window (terminates after 1 second of inactivity)
Links
Edit
Remote hardware
- Repurpose an existing device for Remote Shutter Release: After a long search, I discovered that we could use an existing device for this purpose. I have posted the details on my blog. I thought I should share it with other CHDK users : Link to Blog Posting
- Usb Remote Shutter using Linear Voltage regulator (Forum)
- DIY wireless remote with a chinese door ring bell (Forum)
- DIY Wireless remote with a Chinese remote LED LAMP http://sujitshet.blogspot.com/2011/06/wireless-remote-shutter-for-canonchdk.html
- DIY Magnetic remote with Low power linear Voltaje Regulator for Underwater Case Project.
- GentLedIR (scripting info)
- building usb-remote-cable(Forum)
- http://www.flickr.com/groups/chdk/discuss/72157612167472551/
- http://www.instructables.com/id/Amiga_Joystick_USB_Camera_Cable_Release/ (Instructable for creating cable release from an Amiga Joystick)
- https://sites.google.com/site/canonremotehowto/ Short directions for building a cable release using an LED keychain flashlight
- http://www.flickr.com/photos/fvdk3d/sets/72157624151791739/ build or buy various flashlight based cable releases
- https://sites.google.com/site/kyndaldk/microhack-lego-nxt-chdk-cable?pli=1 Simple interface for triggering CHDK with LEGO NXT Brick, or other Microprocessor
- Infrared remote control receiver for Apple Remote and JIANSI remote control (closed source personal project with limited sale):
- English Website http://www.canoremote.de/
- German forum thread: http://forum.chdk-treff.de/viewtopic.php?t=649
- Rc Remote shutter control (instructions to build a very similar cable to gentled for only a pair of euros): http://www.rcgroups.com/forums/showthread.php?t=1387378#post17367575

