Deleting images with interval shooting - Script Writing - CHDK Forum

Deleting images with interval shooting

  • 7 Replies
Deleting images with interval shooting
« on: 25 / July / 2008, 17:57:34 »
Hey there developers,

Right now we have set up CHDK on EyeFi cards and are successfully taking pictures and having them uploaded to a server using the Ultra Intervalometer feature on S3 IS's.  Ideally, we would like to have these cameras running constantly, continually taking photos and uploading images directly to our server for analysis.  However, EyeFi fails to delete photos after having uploaded them, leaving us limited by the 2 GB memory of the EyeFi card.  Would any of you have any ideas for a script that would permit us to delete an image 5-10 minutes after it has been taken (we are taking photos at 30 minute intervals)?  Is there a command to switch between recording and playback modes to utilize the "erase" command or a delete command with a variable that would specify deletion of the most recent image after a given time interval?

Thanks so much,

Ronald J. Hause, Jr.
Aspiring Ph.D. Candidate
Borevitz Lab, Erman 305
Committee on Genetics, Genomics and Systems Biology
The University of Chicago
1103 East 57th Street
Chicago, IL 60637
Fax: 773.702.9740 Lab: 773.834.4055


Offline fudgey

  • *****
  • 1705
  • a570is
Re: Deleting images with interval shooting
« Reply #1 on: 25 / July / 2008, 18:33:51 »
Nice to hear that the EyeFi can be used this way, I know there's been some discussion about it before!

As far as I know, there is no way in current CHDK releases to delete images the way you describe. There are some builds (more or less development test ones) which are capable to switch some camera models between rec and play modes, but I'm not sure if the S3IS is one of these. Switching to play mode and emulating the erase key presses would work for you, and it will be possible to do some day in the future.

The other option would be to develop file better file i/o and file system manipulation commands to uBasic/Lua. This is not a new feature request, but this EyeFi thing might speed up things on this part, especially if someone capable of adding those commands purchases one...

But there's a third option which might work with any build. I didn't try this, but here's a description of how it could work:

1) Enable the camera feature where the camera keeps the photo reviewed on LCD as long as you hold the shutter down. I think that's the default at least in A series cameras (specifying a N second review time doesn't disable this feature either).

2) Do not take the picture with the "shoot" script command. Instead, use

Code: [Select]
press "shoot_half"
rem wait for exposure etc; this could be replaced with a shoot state wait loop if power consumption or speed is an issue
sleep 5000
press "shoot_full"
rem wait 5 minutes with camera in review mode (hopefully it stays there that long?) for EyeFi to do it's magic.
sleep 300000
click "erase"
sleep 500
release "shoot_full"
sleep 500
click "set"

This code uses the camera feature where you press the erase button to delete the photo you just took, as long as you press the erase key before releasing the shutter. The above code keeps the shutter down for 5 minutes for your EyeFi to get the image, then presses erase, releases the shutter and presses func/set button. If your S3 post-shoot erase functions with different keystrokes, you need to do some changes, obviously.

This might work, but I didn't test any of it so don't get your hopes up too soon... I'm not even sure if the camera writes the jpeg before you release the review mode (it says it's deleting the image but you never know), and I'm not sure whether you can keep the camera in review mode for five minutes either or if there's a timeout for that.

Let us know if it works, I think there is some common interest for this.


Offline reyalp

  • ******
  • 14086
Re: Deleting images with interval shooting
« Reply #2 on: 26 / July / 2008, 17:17:39 »
If the above doesn't work, hard coding something in the C code for your specific application should be pretty straightforward, and not require messing with asm or anything like that. File delete and time functions are already available, so you should just be able to stuff it into one of the tasks. If anyone on your project knows a bit of C, you might have them look into that.
Don't forget what the H stands for.

Re: Deleting images with interval shooting
« Reply #3 on: 27 / July / 2008, 10:14:18 »
hi, good job on the eyefi thingy.  will it be possible to teach us how to do that?

Re: Deleting images with interval shooting
« Reply #4 on: 01 / September / 2008, 00:46:36 »
I have Eye-Fi + CHDK autoload + interval shooting working on my a570is. All i need is some sort of "delete_oldest_image" command so it can run continuously. (a "shot_count_left" feature would be nice too)

anyway, i'm quite serious about this although i suspect that the c/asm code might be a bit beyond me. i'd be interested in talking to a chdk dev that can implement this and hopefully creating a bounty from other interested chdk users.

i want to push this forward.


Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: Deleting images with interval shooting
« Reply #5 on: 10 / September / 2008, 09:37:16 »
a question to the ones that are actually using an Eye-FI: how long after it takes between shoting a picure and having it uploaded?

Re: Deleting images with interval shooting
« Reply #6 on: 10 / September / 2008, 10:04:32 »
the image starts uploading right away (within 10s) but how long it takes is going to vary with image size and wireless signal strength.


Offline reyalp

  • ******
  • 14086
Re: Deleting images with interval shooting
« Reply #7 on: 19 / September / 2008, 15:36:09 »
FYI, as of changeset 517 you can now delete files from lua. Here's an example module that finds the lowest numbered file, and a script that uses it.

Note that this is still experimental. See preliminary lua iolib and oslib port

Support for getting the date of files, and easier listing of directories is planned.
Don't forget what the H stands for.


Related Topics

SimplePortal 2.3.6 © 2008-2014, SimplePortal