#!/bin/bash/root/chdkptp/chdkptp.sh -c -e"rec"
ls DCIM/*.jpg
--checks directories in DCIM for image filesfunction getImageList() log.print("-start- getImageList \n\n") local imgTable = {} --get directories that may contain images local dcimList = os.listdir("A/DCIM", false) if(dcimList) then local dirCount = table.getn(dcimList) log.print("dirCount:"..dirCount.."\n") table.sort(dcimList) --loop through directories local i = 0 while ( dirCount ~= i) do i = i + 1 --get file list log.print("A/DCIM/"..dcimList[i].."\n") local imgDirList = os.listdir("A/DCIM/"..dcimList[i], false) if(imgDirList) then local imgCount = table.getn(imgDirList) log.print("imgCount:"..imgCount) table.sort(imgDirList) if(imgCount ~= nil) then --loop through files, add to list local a = 0 while (imgCount ~= a) do a = a + 1 print("A/DCIM/"..dcimList[i].."/"..imgDirList[a]) log.print("A/DCIM/"..dcimList[i].."/"..imgDirList[a]) table.insert(imgTable,"A/DCIM/"..dcimList[i].."/"..imgDirList[a]) end else os.remove("A/DCIM/"..dcimList[i]) table.remove(dcimList,i) end else os.remove("A/DCIM/"..dcimList[i]) table.remove(dcimList,itemCount) end end end log.print("-end- getImageList ") return imgTableend
=loadfile('A/CHDK/SCRIPTS/NH_list.lua')()
Not knowing how to invoke this as a CHDKPTP command, I thought it might be simper to us PTP
to invoke a camera side lua script and stumbled across this promising thread.....However, when I invoke the script over PTP like thisCode: [Select]=loadfile('A/CHDK/SCRIPTS/NH_list.lua')()I get no errors but no list in a file either. Is it intended to be used 'on the camera' I did try running it that way too but still got no text file output.
Hello again,I just spent an entire evening trying to figure out how to write out a list of images on the camera out to a file that I can download to my Raspberry Pi. I would simply have downloaded the images and continued from there on the Raspberry Pi but it takes a minute and a half to download 60 images, which, the way I'm managing the power, would mean having to skip an image capture. If I only grab the image list and the most recent image, each hour, I can be in and out in a matter of seconds and leave the main download til the end of the day.
Not knowing how to invoke this as a CHDKPTP command, I thought it might be simper to us PTP to invoke a camera side lua script and stumbled across this promising thread..https://chdk.setepontos.com/index.php?topic=3029.msg28490#msg28490
I get no errors but no list in a file either. Is it intended to be used 'on the camera' I did try running it that way too but still got no text file output.
QuoteI get no errors but no list in a file either. Is it intended to be used 'on the camera' I did try running it that way too but still got no text file output.I'm not sure exactly what you put in your file, but if it was all the code in the code tags, it just defines the functions without invoking them. It also assumes there is a "log" module which does something (probably posted earlier in the thread)
If I can use the Raspberry Pi and data modem for a total of only 1 hour a day (2Wh) and the Arduino and camera for the remainder of the time (23hs * .2Wh), my total daily draw will be @ 2.46. I hope to be able to power the system by a single, lithium phosphate cell, at 3.2V, buck converting up to 5V and 3.7V. with a modest 6V solar panel providing renewable supply.Am I crazy?
If you power the camera off except for the six seconds where it's actually shooting you could do better than that? Except for the wear & tear on the mechanism.
The other question might be why you need the Pi running for a whole hour? I guess it comes down to image size, how many images per day (assuming you don't shoot in the dark), and the data transfer rate of the modem? Going to a higher compression on the image size will cost you a bit on quality but might be worth the trade off?
Started by dayzman Script Writing
Started by Barney Fife General Discussion and Assistance
Started by Salvatore Chiarelli General Discussion and Assistance
Started by Sdack « 1 2 ... 12 13 » General Help and Assistance on using CHDK stable releases
Started by Mlapse « 1 2 » Feature Requests