ich bastle gerade an einem Skript für meine IXUS 60, das automatisch Bilder schießen soll, welche dann vom Linux Rechner ausgelesen werden usw.
Nun versuche ich den Fokus auf unendlich zu stellen, da die Kamera später eh den Himmel aufnehmen soll. Leider passiert dabei etwas sehr merkwürdiges. Wenn ich versuche den Fokus mittels set_prop(12,1) auf manuell zu stellen spinnen Kamera und Rechner auf einmal herum.
Das Display der Kamera (lasse ich mir am Rechnerbildschirm über den Videoausgang anzeigen) bleibt vllt 1s danach hängen und sogar Linux (läuft im VMWarePlayer) hängt bis sich der VMWarePlayer wegen Lesefehlern verabschiedet (!). Die Fehler kommen wohl vom USB Port, der auf einmal zu spinnen scheint.
Wenn ich andere Werte per set_prop(12, x) setze, läuft alles normal weiter?! Alle anderen Befehle funktionieren bisher auch einwandfrei und verursachen auch keine Abstürze.
Hat jemand eine Idee, woran das liegen könnte oder wie ich das Problem evtl. umgehen kann?
Hier mal mein Skript, ab Zeile 96 wird es dann interessant. Das print(get_prop(12)) gibt er noch ohne zu murren aus, danach ist Sense.
Syntax: [ Download ] [ Verstecken ]
Benutze Lua Syntax Highlighting
--[[
@title TimelapseIntervalometer
--]]
--initialize variables
exptime = -15
wtime = 3
run = true;
-- get the exp value in sec
function print_Tv()
tv_output = {"64s","50s","40s","32s","25s","20s","15s","13s","10s","8s","6s",
"5s","4s","3.2s","2.5s","2s","1.6s","1.3s","1s","0.8s","0.6s","0.5s","0.4s",
"0.3s","1/4s","1/5s","1/6s","1/8s","1/10s","1/13s","1/15s","1/20s","1/25s",
"1/30s","1/40s","1/50s","1/60s","1/80s","1/100s","1/125s","1/160s","1/200s",
"1/250s","1/320s","1/400s","1/500s","1/640s","1/800s","1/1000s","1/1250s",
"1/1600s","1/2000s","1/2500s","1/3200s","1/4000s","1/5000s","1/6400s",
"1/8000s","1/10000s"}
tv_input = get_tv96() / 32
ret = "Exposure: "..tv_output[tv_input+19]
return ret
end
-- prints the ISO val
function print_iso()
iso_val = {"HIGH ISO","AUTO","80","100","200","400","800"}
iso = get_iso_mode()
if iso<-1 then iso = -1 end
if iso>4 then iso = 5 end
ret = "ISO: "..iso_val[iso+2]
return ret
end
-- add exif data (temp...)
require "EXIFModule"
function addExif()
P = JPEGImage
ImgDir = "A/DCIM/101CANON/"
ImgNumber = get_exp_count()
No = tostring(ImgNumber)
ImgFileName = "IMG_"..string.rep("0", 4-string.len(No))..No..".JPG"
P:new(ImgDir..ImgFileName)
P:SetUserComment("Temp: "..get_temperature(0).."/"..get_temperature(1).."C "..print_Tv().." "..print_iso().." "..get_vbatt().."mV")
write_usb_msg(ImgFileName) --send filename to pc
end
-- delete old images
function delfileson(path)
local fd,c,i,fpath,stat=os.listdir(path),0
if fd~=nil and #fd>0 then
for i=1, #fd do
fpath=path .. "/" .. fd[i]
stat=os.stat(fpath)
if stat~=nil and stat.is_file==true and os.remove(fpath)~=nil then
c=c+1
else
break
end
end
end
print("deleted all in "..path)
return c
end
-- start the script
while run do
--delete files
delfileson("A/DCIM/101CANON")
sleep(1000)
-- set props
set_prop(16,2) --flash off
set_prop(63,2) --AF Light off
set_prop(9,0) --metering eval
press("shoot_half")
repeat sleep(50) until get_shooting() == true
release("shoot_half")
print("exp: "..print_Tv())
if get_tv96()<290
then
set_tv96_direct(exptime*32) -- exposure time
wtime = 5
else
wtime = 37
end
set_prop(236,-32765)
print(" "..get_prop(12))
set_prop(12,1)
print(" "..get_prop(12))
sleep(5000)
--set_prop(11,4) -- manual focus??
--set_aflock(1) -- sperre AF
print("before:",get_focus())
x=65000
set_focus(x)
print("after:",get_focus())
sleep(5000)
set_iso_mode(3) -- ISO200
set_backlight(0) --display light off
--set_prop(24,1) --image size
-- shoot, set exif data and notify pc
shoot()
addExif()
-- wait
print("waiting"..wtime.."s")
sleep(wtime*1000)
-- wait until image is downloaded
ready = nil
while ready == nil do
print("wait for DL...")
sleep(1000)
ready = read_usb_msg()
end
end
print("Und Tschuess")
shut_down()
@title TimelapseIntervalometer
--]]
--initialize variables
exptime = -15
wtime = 3
run = true;
-- get the exp value in sec
function print_Tv()
tv_output = {"64s","50s","40s","32s","25s","20s","15s","13s","10s","8s","6s",
"5s","4s","3.2s","2.5s","2s","1.6s","1.3s","1s","0.8s","0.6s","0.5s","0.4s",
"0.3s","1/4s","1/5s","1/6s","1/8s","1/10s","1/13s","1/15s","1/20s","1/25s",
"1/30s","1/40s","1/50s","1/60s","1/80s","1/100s","1/125s","1/160s","1/200s",
"1/250s","1/320s","1/400s","1/500s","1/640s","1/800s","1/1000s","1/1250s",
"1/1600s","1/2000s","1/2500s","1/3200s","1/4000s","1/5000s","1/6400s",
"1/8000s","1/10000s"}
tv_input = get_tv96() / 32
ret = "Exposure: "..tv_output[tv_input+19]
return ret
end
-- prints the ISO val
function print_iso()
iso_val = {"HIGH ISO","AUTO","80","100","200","400","800"}
iso = get_iso_mode()
if iso<-1 then iso = -1 end
if iso>4 then iso = 5 end
ret = "ISO: "..iso_val[iso+2]
return ret
end
-- add exif data (temp...)
require "EXIFModule"
function addExif()
P = JPEGImage
ImgDir = "A/DCIM/101CANON/"
ImgNumber = get_exp_count()
No = tostring(ImgNumber)
ImgFileName = "IMG_"..string.rep("0", 4-string.len(No))..No..".JPG"
P:new(ImgDir..ImgFileName)
P:SetUserComment("Temp: "..get_temperature(0).."/"..get_temperature(1).."C "..print_Tv().." "..print_iso().." "..get_vbatt().."mV")
write_usb_msg(ImgFileName) --send filename to pc
end
-- delete old images
function delfileson(path)
local fd,c,i,fpath,stat=os.listdir(path),0
if fd~=nil and #fd>0 then
for i=1, #fd do
fpath=path .. "/" .. fd[i]
stat=os.stat(fpath)
if stat~=nil and stat.is_file==true and os.remove(fpath)~=nil then
c=c+1
else
break
end
end
end
print("deleted all in "..path)
return c
end
-- start the script
while run do
--delete files
delfileson("A/DCIM/101CANON")
sleep(1000)
-- set props
set_prop(16,2) --flash off
set_prop(63,2) --AF Light off
set_prop(9,0) --metering eval
press("shoot_half")
repeat sleep(50) until get_shooting() == true
release("shoot_half")
print("exp: "..print_Tv())
if get_tv96()<290
then
set_tv96_direct(exptime*32) -- exposure time
wtime = 5
else
wtime = 37
end
set_prop(236,-32765)
print(" "..get_prop(12))
set_prop(12,1)
print(" "..get_prop(12))
sleep(5000)
--set_prop(11,4) -- manual focus??
--set_aflock(1) -- sperre AF
print("before:",get_focus())
x=65000
set_focus(x)
print("after:",get_focus())
sleep(5000)
set_iso_mode(3) -- ISO200
set_backlight(0) --display light off
--set_prop(24,1) --image size
-- shoot, set exif data and notify pc
shoot()
addExif()
-- wait
print("waiting"..wtime.."s")
sleep(wtime*1000)
-- wait until image is downloaded
ready = nil
while ready == nil do
print("wait for DL...")
sleep(1000)
ready = read_usb_msg()
end
end
print("Und Tschuess")
shut_down()
Erstellt in 0.025 Sekunden, mit GeSHi 1.0.8.9
Grüße,
Marcus