CHDK 2 experimental page

I am experimenting with the CHDK extensions for my camera (Canon S3IS).

I have made some extensions/modifications for the Ubasic script engine.


THE ULTIMATE CHDK BUILD

Allbest build has set the new standard!!
Congratulations to ALLBEST !

 ALLBEST builds are now the base for all new development, on assembla chdk space.
I will only publish new builds here for testing/verify before submitting to assembla trunk.
All special features are included in and part of Allbest builds now.

I now have made some HW mods to the remote with a few more instructions.
Some info here is bit 'historical' due to the rapid expansion of CHDK.

2008  1 June  (USB connector info)

One button remote with 4 functions
Remote ver 1
Remote ver 2
Some s3 remote timing tests
My house network


Remote control 4 functions with one button

I made a small script for using my remote button(s). 
With autostart on and the following script I get 4 functions (on the s3is)
I can use it with my cable remote or with my radio remote, just by timing the press of the button.

1. Short press turn camera on, extend the lens.
2. Short press will take a picture
3. A bit longer press will take a picture with flash (if flash is lifted)
4. Looong press (>4 seconds) will turn camera off.

Very simple but useful!

(Next step is to add a small microcomputer (or a timer circuit) in the remote to detect several buttons and generate the timing, then you would not have to use 'camera Morse' code.)

@title Remote button
if get_autostart then
  sleep 2000
  set_autostart 0
  press "shoot_half"
  sleep 500
  release "shoot_half"
endif
do
  do
    a = get_usb_power
  until a>0
  if a<50 then
    shoot
  else   
    if a>400 then
      shut_down
    else
      set_prop 16 2
      shoot
      set_prop 16 0
    endif
  endif
until is_key "set"
end



Remote control
I added remote control for s3is and a630,  a640,  a610,  a620, a710 from the information on the Russian page  http://ewavr.nm.ru/chdk/ available for some time, carefully hidden behind the Russian language (at least for me!:).
(For a710 user, check out the link  http://ewavr.nm.ru/chdk/ there is version for a710 with some new features, including remote control,
some new video compression setting etc.).

This drawing show how to connect battery and button to the USB connector.

I can only verify S3, so others are 'coded not tested'! Use the following script:

@title Remote button
:loop
wait_click 1
is_key k "remote"
if k=1 then shoot
goto "loop"
end

or if you like my own version

@title Remote button
while 1
  wait_click 1
  if is_key "remote" then shoot
wend

end

Testing is simple.
Just run the script.:
Take the USB cable used for picture download, connect to the camera.
Now every time you connect the cable to the computer you take a picture!
The camera will continue shooting while the cable is connected.

Please note. With this remote function the camera will not enter download mode when connecting the USB cable.
For download just disable CHDK by turning of write protect on the SD card..

Added value.
The remote function is very well adapted for HW extensions like radio as the signal needed for the camera is only a voltage (3-5 V).
I used my old radio remote. put in an USB contact and connected internally to an on/off signal 3V.
The unit is a modified wallswitch (433 MHz) and I removed all the 220V related stuff, (relay, wallconnector etc) and put in an 9V battery.
The existing electronics in the unit convert this to 3V level, I didn't have to add any electronics parts, only switches and connectors.

remote unit

The transmitter need no mod. One button turn on the signal, the other turn it off. So I need two presses for a picture, really no practical problem.
rem
To my satisfaction it worked the first time with my S3!
Range for this is at least 30 meters in open air. I didn't dare go further and leave my camera alone :)
The wallswitch is sold in Europe under different names, in Sweden one brand is NEXA.

Only problem may be, I turn on/off somebody's light when taking pictures......


Remote control second version
Here are some tips on modifying the remote. I wasn't able to make full instructions (well, lack of time) for assembly so you will need some experience with electronics.
But you can ask me questions and I will try to answer!  fingalo


I made a smaller version of the remote receiver as my s3 is much smaller that the old 300d.
I use the same HW, just now taking out the circuit board, soldering off all components not needed and adding USB connector and battery. I first used only a 3V cell but
the radio range was to small so I put in one 3V cell and one 1.5 V cell. That helped.!
Then I put the receiver in a small plastic box, using hot glue, making the holes by melting them with the soldering iron.

Circuit board component side before and after cleaning out of components not needed anymore (capacitors, diodes, relay etc.).
Some components are glued so 'may the force be with you' to get them off..
 

The remote switch is sold under different names as
NEXA,  PROOVE,  INTERTECHNO etc
and in package of 3 plus a remote
Note: the yellow dot marked capacitors and led should also be removed. I left the two diodes on the board, don't remember why? 
(Most likely not needed)..

The blue wires in the middle are from battery (via some switch)

Plus 4.5 V on J201
Minus on J202

The left wire is for remote signal (see below)
The soldering side of the circuit board after cleanout of components.
Now only the radio part and channel decoder is left on the board.



The code switch is mounted in the round layout to the right.
Inspect it when disassembling the board (it will fall off!) and make sure you know how it is mounted.


The blue wire is the remote signal, high level (3- 5V) when on.
This is connected to a USB connector pin 1 and pin 4 is connected to the minus jumper (J202 above).


For mounting, the easy way is to put the circuit board back in the housing after the mod. This way you will have no trouble with the code switch (well only some...:). Also you can put battery and connector in the housing as I did in my first version of remote.


Circuit diagram. for connecting radio to USB connectors..

2 and 3 in the cable are connected and act as the powerswitch.
Just to get rid of a switch sticking out from the box.
Plus (+) is on J201
Minus (-) is on J202

This drawing and for connector on the cable show how 1,2,3,4 is located in the USB connectors.
A bit more work but smaller housing (found at BILTEMA).



I managed to mount the USB connector and battery holder in some left over holes on the board and then using thin wire to connect all components..

Housing is a small plastic box, a box for storing 4 AA size batteries. The board fit and it was easy to make a hole for the mode switch using the soldering iron! Then using hot glue to make it all stick together.



Then just connect the cable to use the remote!

I really would like to have a black box, some paint may solve that.





A new small keyring remote is available, just enough for my need.
 (I do have to press 1 for on and 0 for off when taking a picture but that is really no problem).






My network

I try to have some practical use of my gadgets. Here is an overview of my network.



Click for full picture. 

Plans are to integrate a (or two?!) flat screen TV/Monitors,  fileserver(s) for central storage/backup in the network more
permanently. 

(Must however increase the 'wife acceptance level' on the setup of some of my equipment, cables and cables and ca...)


Some testing with remote signaling to see if it is possible to make a multibutton control.

I found that the USB signal need to be at minimum 50-60ms in length in order to be detected at all.
Under this length I could not detect any signals.
Also the length varies a lot, when setting a signal 0.2sec long it will be detected between .19 to .23s.

Function get_usb_power will now give how long the USB signal is active. I leave this decoding to the script as I suspect different cameras can give different timing.
This way you can design your own method for timing, even manual 'keying' is possible, a long or short press on the button.
Note: the 'old' is_key "remote" signal still works the same as before.
Difference between get_sub_power and is_key "remote" is that is_key "remote" is activated as soon as USB power is detected but get_usb_power is set when USB power
go low (giving the lengt of the signal).

I used 5 different signal with following timing (seconds).
0.085,   0.21,   0.33,   0.44,   0.60
This way I just get a value (in 10ms counts) for USB signal. It is decoded with the following script:

@title Multi remote

do
  do
  a = get_usb_power
  until a>0
rem remote button 1
  if a>0 and a<15 then
    release "zoom_in"
    release "zoom_out"
  endif
rem remote button 2
  if a>15 and a<25 then
    press "zoom_in"
  endif
rem remote button 3
  if a>25 and a<38 then
    press "zoom_out"
  endif
rem remote button 4
  if a>38 and a<47 then
    shoot
  endif
rem remote button 5
  if a>50 then exit_alt
rem show button timecount (used for calibrating the script)
  if a>0 then print a

until is_key "set"

end

To  calibrate your own timing just use this part of the script to begin with

do
  do
   a = get_usb_power
  until a>0
  if a>0 then print a
until is_key "set"
end

This works stable, but the timing is really not what I expected, I thought it should be a 10ms resolution for the USB signal.
I tested by a 5 V signal from the PC's printer port and a program to time the signal to the camera.

Program for testing on lpt1 port:
LPT port pin 25 is ground
LPT port pin 2 remote signal 5V.
utils.zip  (with .net source)
(Copy inpout32.dll to windows/system32) and run the .exe file



Main