A couple of Multicam doubts and general help - page 15 - General Help and Assistance on using CHDK stable releases - CHDK Forum

A couple of Multicam doubts and general help

  • 158 Replies
  • 59678 Views
*

Online reyalp

  • ******
  • 13674
Re: A couple of Multicam doubts and general help
« Reply #140 on: 14 / January / 2022, 14:05:05 »
Advertisements
My main concern (since I already have a "working" download sequence in the code) would be adding an easy option to erase everything, clear the queue, start fresh, specially when doing test shots. Should I use mc:delete_files_list to point towards DCIM and erase the pics? How?
Yes, if you just want to delete all the files, get the list with mc:imglist and delete with mc:delete_files_list. Minimal version
Code: [Select]
mc:delete_files_list(mc:imglist())
Don't forget what the H stands for.

Re: A couple of Multicam doubts and general help
« Reply #141 on: 18 / January / 2022, 09:23:34 »
I had doubts on how to add the code but i finally got it to work, and even added an IF to be sure to delete. It makes my life so much easier now :)

Code: [Select]
elseif option == '8' then        ---------DELETE
  mc:cmdwait('play')
if cli.readline('DELETE (y/n)>') == 'y' then
  files=mc:imglist({...})
  mc:delete_files_list(files,{verbose=true})
  end
And here comes two more questions. Would it be possible to generate a cumulative local log file with the output of mc:start (or mc:check_connections?) with the camera model, libusb port, serial, etc... (basically the verbose that mc:start produces). It would be handy to keep track of cameras and debug in some situations. And also, cameras are all set to shoot jpg and dng, but I see that I'm not using DNGs lately and they weight quite a bit, making the downloads quite long. Is there any option to change this from multicam? Maybe make it conditional and only produce DNGs on certain occasions? Or maybe just ignore them in download and delete them afterwards as a possible solution??
And one final thing, there is one particular camera that always crashes the download. It's the only Canon G9 i have, it works perfectly on every other stage, but despite updating CHDK, changing USB ports and cables (power is the only thing i didn't touch, but it has its own third party adapter and not one of my DIYs), it keeps crashing no matter what I do (read_data failed 0x2ff Error: call failed:I/O error). Any idea to try and save it?
« Last Edit: 18 / January / 2022, 10:24:03 by ikercito »

*

Offline Caefix

  • *****
  • 842
  • Sorry, busy deleting test shots...
Re: A couple of Multicam doubts and general help
« Reply #142 on: 18 / January / 2022, 12:16:14 »
It's the only Canon G9 i have, it works perfectly on every other stage,  ...
;) ... I expect the FAQs "Which firmware?" && "What happens with ... "
Code: [Select]
exec require'camtests'.runbatch{bench=true,shoot=true,filexfer=true,xfersizebugs=true}
All lifetime is a loan from eternity.

*

Online reyalp

  • ******
  • 13674
Re: A couple of Multicam doubts and general help
« Reply #143 on: 18 / January / 2022, 12:49:31 »
And here comes two more questions. Would it be possible to generate a cumulative local log file with the output of mc:start (or mc:check_connections?) with the camera model, libusb port, serial, etc... (basically the verbose that mc:start produces). It would be handy to keep track of cameras and debug in some situations.
The output comes from from the printf and warnf lines lines in mc:connect, which write to stdout and stderr respectively by default (set in util.lua). If you want those lines to log a file, *in addition* to printing to stdout or stderr, you could override those functions like
Code: [Select]
function util.printf(format,...)
 if multicam_log then
    util.fprintf(multicam_log,format,...)
 end
 util.fprintf(util.stdout,format,...)
end
function util.warnf(format,...)
 if multicam_log then
  util.fprintf(multicam_log,"WARNING: "..format,...)
 end
 util.fprintf(util.stderr,"WARNING: "..format,...)
end
-- in chdkptp, these functions are sometimes accessed through util and sometimes
-- through the global, override both
printf = util.printf
warnf = util.warnf
Then you can add functions to start and stop logging:
Code: [Select]
-- open the log
function start_log()
 multicam_log = io.open('multicam.log','a') -- 'a' is a append, use 'w' to overwrite
end
-- close the log and unset log handle
function stop_log()
 multicam_log:close()
 multicam_log = nil
end
Note the above is all untested, typos and other errors are possible.

Quote
And also, cameras are all set to shoot jpg and dng, but I see that I'm not using DNGs lately and they weight quite a bit, making the downloads quite long. Is there any option to change this from multicam? Maybe make it conditional and only produce DNGs on certain occasions?
Sure, you can change the CHDK raw enable setting using the camera side lua function set_raw. To turn raw off, you'd just use
Code: [Select]
mc:cmdwait('call set_raw(false)')
Use true to turn it back on.

Quote
Or maybe just ignore them in download and delete them afterwards as a possible solution??
mc:imglist supports a bunch of filtering options, generally equivalent to what is described in the help for the imls command. The options are mostly documented in rlibs.lua, above ff_findfiles and ff_imglist. To match only jpeg files, you could use fmatch='%.JPG$'. To match only DNG, '%.DNG$'

Quote
And one final thing, there is one particular camera that always crashes the download. It's the only Canon G9 i have, it works perfectly on every other stage, but despite updating CHDK, changing USB ports and cables (power is the only thing i didn't touch, but it has its own third party adapter and not one of my DIYs), it keeps crashing no matter what I do (read_data failed 0x2ff Error: call failed:I/O error). Any idea to try and save it?
Can you get a romlog? https://chdk.fandom.com/wiki/Debugging#Camera_crash_logs_.28romlog.29

When in the process does it crash? Immediately when you try to download, or after downloading, or at some random point?
Don't forget what the H stands for.


Re: A couple of Multicam doubts and general help
« Reply #144 on: 18 / January / 2022, 13:49:56 »
Now that I'm trying the camera to have a crash and produce a romlog.... Murphy's law, it's not crashing. About the log printing, I'm gonna have to study it a bit longer to understand where to add it. And raw has been succesfully turned off, and downloads are blazing fast now. I'm off from the studio, will report back tomorrow with new findings. As always, thanks so much for your patience and dedication :)

*

Offline Caefix

  • *****
  • 842
  • Sorry, busy deleting test shots...
Re: A couple of Multicam doubts and general help
« Reply #145 on: 18 / January / 2022, 14:02:21 »
Now that I'm trying the camera to have a crash and produce a romlog.... Murphy's law, it's not crashing. ... :)
The Romlog of the last (multicam-setup) crash is to save ... :-[
All lifetime is a loan from eternity.

Re: A couple of Multicam doubts and general help
« Reply #146 on: 18 / January / 2022, 16:15:45 »
Yeah, but for some reason it was empty, or i couldn't save it on time. That particular camera is on a difficult position to reach, is it possible to produce the romlog from CLI?

*

Offline Caefix

  • *****
  • 842
  • Sorry, busy deleting test shots...
Re: A couple of Multicam doubts and general help
« Reply #147 on: 18 / January / 2022, 16:49:40 »
Yeah, but for some reason it was empty, or i couldn't save it on time. That particular camera is on a difficult position to reach, is it possible to produce the romlog from CLI?
Probably You need to upload a build with Lua Native Calls enabled first.
So, what´s easier to reach...  :-[
All lifetime is a loan from eternity.


*

Online reyalp

  • ******
  • 13674
Re: A couple of Multicam doubts and general help
« Reply #148 on: 19 / January / 2022, 01:22:03 »
Yeah, but for some reason it was empty, or i couldn't save it on time. That particular camera is on a difficult position to reach, is it possible to produce the romlog from CLI?
As caefix says, you need native functions calls enabled to get it via the CLI. This can be done by setting in the CHDK (have to physically access the camera, but only once), setting it in the CFG (perhaps by uploading one from a camera that's easier to reach) or uploading a build that has native calls hard coded on.

If native calls are enabled, you can use
Code: [Select]
!require'extras/devutil'.init_cli()
dromlog
Don't forget what the H stands for.

Re: A couple of Multicam doubts and general help
« Reply #149 on: 26 / January / 2022, 12:25:44 »
Where/in which file can I find the setting to allow Native Calls? I'm gonna have to upload it from some other camera (must be same model?), cause the G9, aside from being impossible to reach, has a faulty screen (which may be the culprit??) and can't activate the setting in the menus. Camera is quite possibly gonna go to waste, but I'd like to give it a last chance and check the romlog :(
Edit1: Also for some time I couldn't get STICK to work with new builds and installed them manually (it's probably deprecated? any alternative?). Now I'm seeing some 1.5.1 versions error out when downloading, I could only get to download 1.6 unstable for A2300 - 100e and SX150 100a
Edit2: Here's a Romlog for another camera that failed today. SX150-100a, CHDK just updated today after failing a few times before. Any ideas?
« Last Edit: 26 / January / 2022, 12:53:54 by ikercito »

 

Related Topics