CHDK for longtime timelapse - page 11 - General Help and Assistance on using CHDK stable releases - CHDK Forum supplierdeeply

CHDK for longtime timelapse

  • 133 Replies
  • 11206 Views
*

Offline Caefix

  • *****
  • 856
  • Sorry, busy deleting test shots...
Re: CHDK for longtime timelapse
« Reply #100 on: 29 / November / 2021, 16:20:41 »
Advertisements
// Good news are no news...  8)
All lifetime is a loan from eternity.

*

Offline reyalp

  • ******
  • 13712
Re: CHDK for longtime timelapse
« Reply #101 on: 29 / November / 2021, 23:46:16 »
This is a short feedback on my last long term test:  :)
Thanks for the report. Even if we don't solve the problem now, sometimes having bits on the forum helps things click at some later point.

Quote
The camera crashed on 11/14/2021, 11/16/2021, 11/21/2021, I will attach the log file and crash report and chhdkptp file for these 3 crashes, but from previous experience I have little hope that we will get any new valuable information as to why they happened.
 ???
11/14 and 11/16 are the "MotionVector.c Line 338" crash we've seen before. 11/14 appears to be triggered in "luar set_ev(-96)" or possibly between that and the preceding command. 11/16 appears to be in remoteshoot. No real progress, though notable it doesn't appear tied to any specific CHDK call.

11/21 is different.
Code: [Select]
ASSERT!! AFScanDriver.c Line 1445
Task name: AFTask

This looks like crash we've seen before: https://chdk.setepontos.com/index.php?topic=13875.msg143838#msg143838
The elph180 function mentioned in that post appears identical to the G1X function in the romlog.

Skimming back over those threads, the tl;dr seems to be:
1) Ensure "Continuous AF" is disabled in the Canon menu.
2) If #1 is already off or doesn't fix it, add more sleep after click'shoot_half'

While you're checking the AF setting, I'd also make sure Servo AF is off, although I don't know that it's directly implicated in this crash.

Also note that for Canon menu settings to be saved for future reboots, you should shut the camera down properly (with the physical power button or post_levent_to_ui("PressPowerButton")), and then restart it with your servo :)
Don't forget what the H stands for.

Re: CHDK for longtime timelapse
« Reply #102 on: 01 / December / 2021, 13:02:11 »

11/14 and 11/16 are the "MotionVector.c Line 338" crash we've seen before. 11/14 appears to be triggered in "luar set_ev(-96)" or possibly between that and the preceding command. 11/16 appears to be in remoteshoot. No real progress, though notable it doesn't appear tied to any specific CHDK call.

11/21 is different.
Code: [Select]
ASSERT!! AFScanDriver.c Line 1445
Task name: AFTask

This looks like crash we've seen before: https://chdk.setepontos.com/index.php?topic=13875.msg143838#msg143838
The elph180 function mentioned in that post appears identical to the G1X function in the romlog.

Skimming back over those threads, the tl;dr seems to be:
1) Ensure "Continuous AF" is disabled in the Canon menu.
2) If #1 is already off or doesn't fix it, add more sleep after click'shoot_half'

While you're checking the AF setting, I'd also make sure Servo AF is off, although I don't know that it's directly implicated in this crash.

Also note that for Canon menu settings to be saved for future reboots, you should shut the camera down properly (with the physical power button or post_levent_to_ui("PressPowerButton")), and then restart it with your servo :)

Thank you very much for your help :xmas

The AF settings seem ok to me.

The sunset of 29.11.2021 is a good one, if you are intersted. It has snown about 20cm the day before.

Small anecdote:
I was afraid that in winter the snow on the roof would cover part of the bottom picture, since the camera is mounted quite close to the upper edge of the roof of the house, but actually now the snow is visible from above, that is, from the roof of the window where the camera is mounted. I did not think about that :haha
« Last Edit: 01 / December / 2021, 13:03:46 by dolomiti_timelapse »
If you want to see a sunset or sunrise of Dolomiti Val Gardena shot with CHDK visit
Instagram: dolomiti_timelapse
YouTube: https://www.youtube.com/channel/UCEJHg--ujxLkjMrevJXh-Gw

Re: CHDK for longtime timelapse
« Reply #103 on: 17 / December / 2021, 15:10:29 »
The rawopint script is amazing: :o

During yesterday's time-lapse, Windows installed an update and restarted the computer. :'( Yes it's my fault (normally I update Windows proactive...)
 
Since the camera was no longer able to save the photos to the computer, it kept running and saved the photos to the SD card.
When I noticed that the time lapse was not uploaded, I checked the computer and found that the powershell script had terminated, but I was able to recover the photos from the SD card! real MAGIC! :)


Is there a way to find out how many photos the g1X has taken up to now, or is thw only a way, to estimate the number?

I found that sometimes the camera is in capture mode and when I run the rec command in chdkptp, the script fails...

So I wanted to implement the simple logic in pseudocode:

Code: [Select]
if camera is not in record mode
switch to record mode
I found that with:
Code: [Select]
!rec,vid,mode= con:execwait[[ return get_mode()]]or
Code: [Select]
!print(con:execwait[[ capmode=require("capmode") return "mode#",capmode.get(), "name",capmode.get_name(), "prop",capmode.get_canon()]])I can check what mode the camera is in.

but I was not able to implement the logic in chdkptp:

I tried:
Code: [Select]
!print(con:execwait[[ capmode=require("capmode") if capmode.get_name() == 'PLAY' then capmode.set("M") return 'changing to rec mode' else return 'already in rec mode','name: ', capmode.get_name() end]])and
Code: [Select]
!print(con:execwait[[ if get_mode() == true then return 'already in rec mode' else click'shoot_half' return 'changing to rec mode' end]])and
Code: [Select]
!rec = con:execwait[[ return get_mode()]]
!if rec == false then rec else print 'already in rec mode' end #trying to do the logic in chdkptp
and
Code: [Select]
exec con:execwait[[if get_mode() == false then return rec else print'already in rec mode' end]] # the idea was to create the command rec and the execution rec
but nothing worked ???
If you want to see a sunset or sunrise of Dolomiti Val Gardena shot with CHDK visit
Instagram: dolomiti_timelapse
YouTube: https://www.youtube.com/channel/UCEJHg--ujxLkjMrevJXh-Gw


*

Offline reyalp

  • ******
  • 13712
Re: CHDK for longtime timelapse
« Reply #104 on: 17 / December / 2021, 23:34:36 »
Is there a way to find out how many photos the g1X has taken up to now, or is thw only a way, to estimate the number?
The eventproc UIFS_WriteFirmInfoToFile writes a file (default name firminfo.txt), which might include total shutter count. However beware that this value can actually get reset in some unclear circumstances (has on several of my cams) so isn't entirely reliable. You can call it like this
Code: [Select]
con 1> =return call_event_proc('UI.CreatePublic')
con 2> =return call_event_proc('UIFS_WriteFirmInfoToFile',0)
You should reboot after using it, because UI.CreatePublic registers a bunch of stuff which may interfere with shooting. You can look UIFS_WriteFirmInfoToFile in the funcs*.csv and call it directly, but in that case, the second parameter has to be a *pointer* pointing to 0 or the name of the file you want to write.

Quote
So I wanted to implement the simple logic in pseudocode:

Code: [Select]
if camera is not in record mode
switch to record mode
The key thing here is that the 'rec' command is a CLI command, not a chdkptp  or CHDK Lua function. chdkptp CLI is NOT a scripting language with conditional logic or status codes (there's supposed to be a setting to make errors non-fatal, but it appears I didn't make it work for command files run with source  :-[)

So you can either do the rec switch in your own camera side Lua code, calling switch_mode_usb, or execute the CLI rec command from chdkptp Lua.

For the first, option, you can just take the camera side code from 'rec' command found in cli.lua, like
Code: [Select]
exec status, err=con:execwait[[
if not get_mode() then
switch_mode_usb(1)
local i=0
while not get_mode() and i < 300 do
sleep(10)
i=i+1
end
if not get_mode() then
return false, 'switch failed'
end
return true
end
return false,'already in rec'
]]
Note the above must be all one line if you actually put it in an exec command.

For the second option, you could use
Code: [Select]
exec cli:execute('rec')
This alone should be sufficient, since cli:execute returns its status and output, and exec catches any errors. Note however that any other errors (like a dead connection) would also be ignored. If you want to see the output / error messages of a CLI command executed like this, you can use
Code: [Select]
exec cli:print_status(cli:execute('...'))
Or if you want to do something with the status, you can do
Code: [Select]
exec local status,err = cli:execute('...') if not status then ... do some error handling ... end
Don't forget what the H stands for.

Re: CHDK for longtime timelapse
« Reply #105 on: 18 / December / 2021, 07:26:51 »

The eventproc UIFS_WriteFirmInfoToFile writes a file (default name firminfo.txt), which might include total shutter count. However beware that this value can actually get reset in some unclear circumstances (has on several of my cams) so isn't entirely reliable. You can call it like this
Code: [Select]
con 1> =return call_event_proc('UI.CreatePublic')
con 2> =return call_event_proc('UIFS_WriteFirmInfoToFile',0)
You should reboot after using it, because UI.CreatePublic registers a bunch of stuff which may interfere with shooting. You can look UIFS_WriteFirmInfoToFile in the funcs*.csv and call it directly, but in that case, the second parameter has to be a *pointer* pointing to 0 or the name of the file you want to write.

Thanks! the result was:
Code: [Select]
PS C:\Users\time lapse> chdkptp -c -i
connected: Canon PowerShot G1 X, max packet size 512
con> =return call_event_proc('UI.CreatePublic')
29:return:1483824
con 29> =return call_event_proc('UIFS_WriteFirmInfoToFile',0)
30:return:0
con 30> quit
But this number seems not right as it should be between 430'000 and 250'000. Do video frames also count? ???

Quote
The key thing here is that the 'rec' command is a CLI command, not a chdkptp  or CHDK Lua function. chdkptp CLI is NOT a scripting language with conditional logic or status codes (there's supposed to be a setting to make errors non-fatal, but it appears I didn't make it work for command files run with source  :-[)

So you can either do the rec switch in your own camera side Lua code, calling switch_mode_usb, or execute the CLI rec command from chdkptp Lua.

For the first, option, you can just take the camera side code from 'rec' command found in cli.lua, like
Code: [Select]
exec status, err=con:execwait[[
if not get_mode() then
switch_mode_usb(1)
local i=0
while not get_mode() and i < 300 do
sleep(10)
i=i+1
end
if not get_mode() then
return false, 'switch failed'
end
return true
end
return false,'already in rec'
]]
Note the above must be all one line if you actually put it in an exec command.

For the second option, you could use
Code: [Select]
exec cli:execute('rec')
This alone should be sufficient, since cli:execute returns its status and output, and exec catches any errors. Note however that any other errors (like a dead connection) would also be ignored. If you want to see the output / error messages of a CLI command executed like this, you can use
Code: [Select]
exec cli:print_status(cli:execute('...'))
Or if you want to do something with the status, you can do
Code: [Select]
exec local status,err = cli:execute('...') if not status then ... do some error handling ... end

WOW!! Thank you very much! This is really good stuff!  8)

Yes,
Code: [Select]
exec cli:execute('rec')
was sufficient!

And
Code: [Select]
exec cli:print_status(cli:execute('...'))
is even better!!

also
Code: [Select]
exec status, err=con:execwait[[
if not get_mode() then
switch_mode_usb(1)
local i=0
while not get_mode() and i < 30 do
sleep(100)
i=i+1
end
if not get_mode() then
return false, 'switch failed'
end
return true
end
return false,'already in rec'
]]

worked like a charm! (but since it is 245 char long I prefere the second solution!)

It's like a Christmas Present to me! :xmas Thank you very much!
« Last Edit: 18 / December / 2021, 07:29:02 by dolomiti_timelapse »
If you want to see a sunset or sunrise of Dolomiti Val Gardena shot with CHDK visit
Instagram: dolomiti_timelapse
YouTube: https://www.youtube.com/channel/UCEJHg--ujxLkjMrevJXh-Gw

*

Offline reyalp

  • ******
  • 13712
Re: CHDK for longtime timelapse
« Reply #106 on: 18 / December / 2021, 14:28:03 »
But this number seems not right as it should be between 430'000 and 250'000. Do video frames also count? ???
What value is in A/FIRMINFO.TXT? I probably didn't explain clearly, but if you're looking at the return value from the first call, it's just some random register value (it would be -1 if the eventproc didn't exist)
Don't forget what the H stands for.

Re: CHDK for longtime timelapse
« Reply #107 on: 18 / December / 2021, 14:45:56 »
What value is in A/FIRMINFO.TXT? I probably didn't explain clearly, but if you're looking at the return value from the first call, it's just some random register value (it would be -1 if the eventproc didn't exist)

Hmm.. ok, seems missing
If you want to see a sunset or sunrise of Dolomiti Val Gardena shot with CHDK visit
Instagram: dolomiti_timelapse
YouTube: https://www.youtube.com/channel/UCEJHg--ujxLkjMrevJXh-Gw


*

Offline c_joerg

  • *****
  • 1220
Re: CHDK for longtime timelapse
« Reply #108 on: 18 / December / 2021, 15:25:54 »
Is there a way to find out how many photos the g1X has taken up to now, or is thw only a way, to estimate the number?
You could use GetCameraInformationData
https://chdk.setepontos.com/index.php?topic=13916.0
https://chdk.setepontos.com/index.php?topic=12542.300

M100 100a, M3 101a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

Re: CHDK for longtime timelapse
« Reply #109 on: 24 / February / 2022, 03:08:55 »
Is there a way to find out how many photos the g1X has taken up to now, or is thw only a way, to estimate the number?
You could use GetCameraInformationData
https://chdk.setepontos.com/index.php?topic=13916.0
https://chdk.setepontos.com/index.php?topic=12542.300

So basically I have to send this code of line:
Code: [Select]
=call_event_proc'System.Create' p=call_event_proc('AllocateMemory',4) return call_func_ptr(0xfc5087af,p),p,peek(p)
And than save the return to a file:
Code: [Select]
rmem 1079217376 2912 -f=g7x-caminfo.xml1079217376 2912 are just adresses of the memory I get as a return from the first comand.

But what will be the pointer for the the G1X 100e for the call_func_ptr. Have you once tried it with your G1X 100e?
If you want to see a sunset or sunrise of Dolomiti Val Gardena shot with CHDK visit
Instagram: dolomiti_timelapse
YouTube: https://www.youtube.com/channel/UCEJHg--ujxLkjMrevJXh-Gw

 

Related Topics