Remote shooting issues - page 3 - General Discussion and Assistance - CHDK Forum supplierdeeply

Remote shooting issues

  • 35 Replies
  • 6305 Views
Re: Remote shooting issues
« Reply #20 on: 05 / August / 2021, 11:28:01 »
Advertisements
Also without lens retraction the camera stuck in 'rec' like in the last few sunrise runs.
->exec con:call_function(0xff099f1c) seems not to be the cause.

You should be able to do that using a slight modification of your existing rawopint_rs wrapper. I think all you need to change is to hardcode anything that's currently initialized from rs_opts.* and then run like
Code: [Select]
luar < file.lua
then download the images with imdl. If you delete the files using imdl -rm or imrm I'd generally suggest doing that in playback mode.
I uploaded the rawopint_rs.lua file to the camera and added in rec mode:
luar loadfile('A/CHDK/SCRIPTS/RAWOPINT_RS.LUA')()
and in play mode:
imdl -d="D:/sunrise/input/${name}" -rm
I deleted the PT_EraseAllFile code, since the files are now saved to the sd card.

The new setup works fine, like the other did if executed within a few minutes.
Tomorrow morning I will know if the camera survived the night. ???

What I did notice:
after calling
imdl -d="D:/sunrise/input/${name}" -rm
the photos were downloaded and deleted form the camera but I connected with chdkptp GUI and saw that in playback mode the counter of the photos was at 15/15 (this was the 3rd run with 5 photos shot each) in the second screenshot you can see that in files there are no files left. Maybe this could be related to the problem as well? when I click left and then right the camera does not display any thumbnail anymore but only Unidentified Image (also for the 15/15 image).
Also erasing all images with the canon menu didn't worked properly: at first the camera displayed no image. but after a run with 5 photos shot the counter of the photos was back at 20/20.

Maybe I should not switch to play anymore?  :D staying in rec I never hat this kind of problems.
Also maybe there is a way to "turn off" the sensor also in rec mode? like a native function call?
Although 50°C should not be a problem at all for an electronic component, I am still worried because the sun does not shine directly on the sensor at the moment and the permanent reading of the sensor, even though no pictures are taken, naturally causes the electronics to wear out faster. Also when the camera is in play mode and the sensor is turned off, the temperature in the sensor during the time lapse is not as high as when it is permanently reading the sensor.

Quote
I think saving on the camera is the better test, but if that solves it then trying filedummy would be worthwhile.

Looking at the CLI code
Code: [Select]
con:exec('rs_opts='..opts_s..' '..shootscript,{libs={'rs_shoot'},execinfo=execinfo})
it includes the rlibs when using -script, so you should just need to call rlib_shoot_filedummy() at the appropriate point in rawopint. I think I would put it just before hook_raw.continue()

Thanks, I will try that later on. I had a look into the lib but did not understand how does rlib_shoot_filedummy() know how to name the filedummy if no attribute was passed to the function?
« Last Edit: 05 / August / 2021, 11:31:53 by dolomiti_timelapse »
If you want to see a sunset or sunrise of Dolomiti Val Gardena shot with CHDK visit
Telegram: t.me/DolomitiTimelapse
Instagram: dolomiti_timelapse
YouTube: https://www.youtube.com/channel/UCEJHg--ujxLkjMrevJXh-Gw

*

Offline c_joerg

  • *****
  • 1129
Re: Remote shooting issues
« Reply #21 on: 05 / August / 2021, 12:36:56 »
Maybe this could be related to the problem as well?
Perhaps. Try it for a while by just copying the pictures and not deleting them.
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

*

Offline Caefix

  • *****
  • 568
  • Sorry, busy deleting test shots...
Re: Remote shooting issues
« Reply #22 on: 05 / August / 2021, 13:25:55 »
Same need here?
Quote
  :( move = copy + delete + reboot.
All lifetime is a loan from eternity.

*

Offline reyalp

  • ******
  • 13363
Re: Remote shooting issues
« Reply #23 on: 05 / August / 2021, 13:38:20 »
What I did notice:
after calling
imdl -d="D:/sunrise/input/${name}" -rm
the photos were downloaded and deleted form the camera but I connected with chdkptp GUI and saw that in playback mode the counter of the photos was at 15/15 (this was the 3rd run with 5 photos shot each) in the second screenshot you can see that in files there are no files left. Maybe this could be related to the problem as well? when I click left and then right the camera does not display any thumbnail anymore but only Unidentified Image (also for the 15/15 image).
This is normal behavior for most cameras if the files are deleted using CHDK. It does not generally appear to cause problems if the files are deleted in playback mode, but it's not impossible there could be camera specific issues, or specific corner cases that haven't been noticed before.

Quote
Also maybe there is a way to "turn off" the sensor also in rec mode? like a native function call?
On most cameras, when the display turns off for power saving, the sensor is also turned off. I don't remember if anyone has found a way to trigger this directly, but you can set the time in the Canon menu, and control whether it happens using the CHDK "disable LCD off" option (CHDK/LUALIB/GEN/cnf_core.lua alt_prevent_shutdown if you're using set_config_value). (edit: path and typo)

Note that Canon firmware display off is different from CHDK set_lcd_display, which only affects the display and not the sensor.

Quote
Thanks, I will try that later on. I had a look into the lib but did not understand how does rlib_shoot_filedummy() know how to name the filedummy if no attribute was passed to the function?
It uses the current image counter and image directory. That's why it needs to be called at a specific point in shooting. See around this line in rlibs.lua
Code: [Select]
local fn=string.format('%s/IMG_%04d.%s',dir,get_exp_count(),e)
« Last Edit: 06 / August / 2021, 14:03:07 by reyalp »
Don't forget what the H stands for.


Re: Remote shooting issues
« Reply #24 on: 06 / August / 2021, 06:03:02 »
This is normal behavior for most cameras if the files are deleted using CHDK. It does not generally appear to cause problems if the files are deleted in playback mode, but it's not impossible there could be camera specific issues, or specific corner cases that haven't been noticed before.
The sunrise this morning was a success!! Thank you all for this little step forward! :D
I will keep the same setup for some more days to test some edge cases: Not sure if there will be new problems if there have been taken enough photos that the counter gets an int overflow... ???
Quote
On most cameras, when the display turns off for power saving, the sensor is also turned off. I don't remember if anyone has found a way to trigger this directly, but you can set the time in the Canon menu, and control whether it happens using the CHDK "disable LCD off" option (cnf_corre alt_prevent_shutdown if you're using set_config_value).

Note that Canon firmware display off is different from CHDK set_lcd_display, which only affects the display and not the sensor.
Thanks. You explained it very clear. I think there was still some confusion from my side up to now.
This seems to be a simple solution. I have to test it out, I can't remember why I started using the CHDK set_lcd_display instead of relaying on the Canon display turn off option, which is activated in the menu and set to 10 sec right now. I think, I simply didn't know the differences.

EDIT: I know now why I started using CHDK set_lcd_display: without set_lcd_display(0) the display stays, also after the rawopint script finished, always on.

What is cnf_corre in "cnf_corre alt_prevent_shutdown"? I found alt_prevent_shutdown, ist seems to be nr 1221. But what is cnf_corre?

EDIT2: ok, found it: you mean: A\CHDK\LUALIB\GEN\cnf_core.lua thanks! as explained here: https://chdk.setepontos.com/index.php?topic=13286.0

Quote
It uses the current image counter and image directory. That's why it needs to be called at a specific point in shooting. See around this line in rlibs.lua
Code: [Select]
local fn=string.format('%s/IMG_%04d.%s',dir,get_exp_count(),e)
Thanks! Remoteshoot +dummy files might be a better solution than saving them to sd card and than downloading them to the pc later. The dummy file option in CHDKPTP for remoteshoot seems to be justified  ;)
The dummy files are generated as expected with rlib_shoot_filedummy() inserted before hook_raw.continue(). In play mode I added imrm. I will also test this code variant in a few day for a longer interval.
« Last Edit: 06 / August / 2021, 11:02:43 by dolomiti_timelapse »
If you want to see a sunset or sunrise of Dolomiti Val Gardena shot with CHDK visit
Telegram: t.me/DolomitiTimelapse
Instagram: dolomiti_timelapse
YouTube: https://www.youtube.com/channel/UCEJHg--ujxLkjMrevJXh-Gw

*

Offline reyalp

  • ******
  • 13363
Re: Remote shooting issues
« Reply #25 on: 06 / August / 2021, 14:02:03 »
I will keep the same setup for some more days to test some edge cases: Not sure if there will be new problems if there have been taken enough photos that the counter gets an int overflow... ???
The counter wrapping from 9999 to 1 shouldn't be a problem, but, if the camera ever thinks there more than a few thousand images on the card, PTP may stop working with "COMMUNICATION ERROR" displayed on the camera. This is documented in the manuals like
Quote
COMMUNICATION ERROR
Images could not be transferred to the computer or printed due to the large amount of images (approx. 1000) stored on the memory card. Use a commercially available USB card reader to transfer the images. Insert the memory card into the printer’s card slot to print."
The actual limit is (usually? sometimes?) significantly higher than 1000.

Not sure if your current workflow will hit this, I suspect it won't, but it's something to watch out for.

Quote
Thanks. You explained it very clear. I think there was still some confusion from my side up to now.
This seems to be a simple solution. I have to test it out, I can't remember why I started using the CHDK set_lcd_display instead of relaying on the Canon display turn off option, which is activated in the menu and set to 10 sec right now. I think, I simply didn't know the differences.

EDIT: I know now why I started using CHDK set_lcd_display: without set_lcd_display(0) the display stays, also after the rawopint script finished, always on.
The default value of alt_prevent_shutdown is for it to be active in alt mode, so if the CHDK was in alt mode after the script finished, that could explain it. IIRC there was some case where using PTP also interfered with the Canon display off logic in some way, but I don't recall the details and didn't find it in quick search :-[

Note that if you allow the camera to go into Canon display off mode, you should wake it up with a key press and wait a moment for the screen to turn on before attempting to switch to play. It may crash if you don't.

Quote
What is cnf_corre
A typo, as you've discovered  :haha
Don't forget what the H stands for.

Re: Remote shooting issues
« Reply #26 on: 09 / August / 2021, 18:23:53 »
The counter wrapping from 9999 to 1 shouldn't be a problem, but, if the camera ever thinks there more than a few thousand images on the card, PTP may stop working with "COMMUNICATION ERROR" displayed on the camera. This is documented in the manuals like

The actual limit is (usually? sometimes?) significantly higher than 1000.

Not sure if your current workflow will hit this, I suspect it won't, but it's something to watch out for.

The timelapse is working great now! Today 7th run. I'm very pleased and satisfied  :lol :lol
I will in a few days run the remoteshoot with dummyfiles generated in rawopint script which already works in a short run.
My aim is still to use the remoteshoot alternative since it leaves the door open for me to set up a Raw workfow later on. (the raw conversion takes up to 10-15 sec, so a conversion during the timelapse is welcome)
Also my oldest SD card has the very important task to store the CHDK firmware  8) and not to mode GBs of photos every day.

Quote
The default value of alt_prevent_shutdown is for it to be active in alt mode, so if the CHDK was in alt mode after the script finished, that could explain it. IIRC there was some case where using PTP also interfered with the Canon display off logic in some way, but I don't recall the details and didn't find it in quick search :-[

Note that if you allow the camera to go into Canon display off mode, you should wake it up with a key press and wait a moment for the screen to turn on before attempting to switch to play. It may crash if you don't.



The "cannon display off" mode would be my goal, but I don't understand what I'm doing wrong or what is going on in the camera.
I have read the CHDK manual regarding ALT mode and some forum posts but I didn't understand.
The ALT mode is the CHDK menu opened with the alt "button" but why is this relevant e.g. in the playback mode where alt mode is not visible?
Is also the alt_prevent_shutdown settings active when alt mode is closed?
Why is alt_prevent_shutdown in this case important? As far as I understand I don't want to shutdown the camera. Also I tried out to set alt_prevent_shutdown to 0 and 1 but there was no difference observable. May this be related to the PTP interfering with the canon display off logic? I searched with google for this specific problem but the forum post were not so precise.
Is the chdk shutdown different to the camera power saving shutdown?
« Last Edit: 09 / August / 2021, 18:30:03 by dolomiti_timelapse »
If you want to see a sunset or sunrise of Dolomiti Val Gardena shot with CHDK visit
Telegram: t.me/DolomitiTimelapse
Instagram: dolomiti_timelapse
YouTube: https://www.youtube.com/channel/UCEJHg--ujxLkjMrevJXh-Gw

*

Offline reyalp

  • ******
  • 13363
Re: Remote shooting issues
« Reply #27 on: 09 / August / 2021, 22:31:00 »
The "cannon display off" mode would be my goal,
Note that if you are switching to playback between runs, it should not be needed.

Quote
but I don't understand what I'm doing wrong or what is going on in the camera.
I have read the CHDK manual regarding ALT mode and some forum posts but I didn't understand.
The ALT mode is the CHDK menu opened with the alt "button" but why is this relevant e.g. in the playback mode where alt mode is not visible?
Is also the alt_prevent_shutdown settings active when alt mode is closed?
Why is alt_prevent_shutdown in this case important? As far as I understand I don't want to shutdown the camera. Also I tried out to set alt_prevent_shutdown to 0 and 1 but there was no difference observable.
alt_prevent_shutdown shutdown is poorly named. It actually blocks both the Canon display off function, and the Canon "shutdown after X minutes idle" function. In the CHDK menu, it appears as "Disable LCD Off"
It has 4 possible values: Never (0), Alt (1), Script (2) and Always (3)
Setting it to "Alt" means that Canon LCD Off and power down are prevented when CHDK alt mode is active. Script does it only when a script is running. When you execute script over PTP, CHDK goes into alt mode to run it, and tries to restore the previous state when it's done. This means it's possible for the camera to be left in alt mode.

Setting it to "Never" should probably be OK for your case, since screen off won't kick in while the script is shooting, but "Script" should also be OK.

You should make sure "Auto Power Down" is off in Canon power saving settings, and that the display timeout is something suitable.

Quote
but there was no difference observable
How are you checking? When the display turns off, the chdkptp live view will generally continue to show whatever the sensor last saw, so if the scene is static, it's not really obvious.

You should be able to use
Code: [Select]
=return get_imager_active()
to check if the sensor is on.

If you look carefully at live view, you can also usually see the difference, because there is slight frame to frame variation from noise.
Don't forget what the H stands for.


Re: Remote shooting issues
« Reply #28 on: 10 / August / 2021, 07:49:45 »

Note that if you are switching to playback between runs, it should not be needed.


Ok thanks!

Quote
alt_prevent_shutdown shutdown is poorly named. It actually blocks both the Canon display off function, and the Canon "shutdown after X minutes idle" function. In the CHDK menu, it appears as "Disable LCD Off"
It has 4 possible values: Never (0), Alt (1), Script (2) and Always (3)
Setting it to "Alt" means that Canon LCD Off and power down are prevented when CHDK alt mode is active. Script does it only when a script is running. When you execute script over PTP, CHDK goes into alt mode to run it, and tries to restore the previous state when it's done. This means it's possible for the camera to be left in alt mode.

Setting it to "Never" should probably be OK for your case, since screen off won't kick in while the script is shooting, but "Script" should also be OK.

You should make sure "Auto Power Down" is off in Canon power saving settings, and that the display timeout is something suitable.


Thanks! Quite confusing though without the right information.


Quote
How are you checking? When the display turns off, the chdkptp live view will generally continue to show whatever the sensor last saw, so if the scene is static, it's not really obvious.

You should be able to use
Code: [Select]
=return get_imager_active()
to check if the sensor is on.

If you look carefully at live view, you can also usually see the difference, because there is slight frame to frame variation from noise.

I have the webcam of the laptop pointing to the Canon, so I can see if the lens is retracted or if the screen is off or what the green led is doing. :P

I did notice the static scene once or twice. Now I know better what that was. Also
Code: [Select]
=return get_imager_active()
is a good hit. Thanks again!

So I set alt_prevent_shutdown to 2. Which was confirmed also after some script runs. The actual state after some runs was: the =return get_imager_active() returned false, which makes sense, since the camera was in play mode after the script was finished but the screen of the camera is still on, also after disconnecting from ptp. I think this has something to do with the usb plugged into the pc. I think this is not a problem anymore as I can switch off the display with luar set_lcd_display(0).

Is there a way to get a return direct in chdkptp script when using codes like =return get_imager_active() ?
What I do is first type chdkptp -c -i and then =return get_imager_active() but is there a way to execute it like chdkptp -c -i"=return get_imager_active() quit" and get in the powershell cmd a return of the function called?
If I execute luar get_imager_active() in the chdkptp script or chdkptp -c -e"luar get_imager_active()" I get no return.

The idea would be the check some values on the cam, and get a confirmation if everythink is setup correct continue and if not adjust the setting. Like if get_zoom does not return 28 set_zoom(28) is executed. At the moment I run set_zoom every time similar with other setting. This is of corse bad implemented as I get no information if the camera is maybe malfunctioning and I set setting each time even though there is no need to.

Maybe it would be much better to just code it in the rawopint or rawopint_rs script, as there least I know (for now) some basics and it is similar to other languages I know. But still it would be nice to print the result of the verification to cmd as the cmd is logged each day, see attached how this looks like.

Maybe this topic below is related to the return message issue I can't find the right code snippet:
on https://app.assembla.com/spaces/chdkptp/wiki/Scripting_Guide
Quote
Message system
The message system can be used to send data to a script running on the camera, or receive data from it. Using the serialize / unserialize functions, Lua values can be exchanged seamlessly between camera and PC code. Lua return values and errors are also sent using the message system, but con:execwait handles them transparently.
Where can I find a code example ore more information how to print live telemetry data to powershell cmd? like "100 photos of 1000 done"

« Last Edit: 10 / August / 2021, 08:57:10 by dolomiti_timelapse »
If you want to see a sunset or sunrise of Dolomiti Val Gardena shot with CHDK visit
Telegram: t.me/DolomitiTimelapse
Instagram: dolomiti_timelapse
YouTube: https://www.youtube.com/channel/UCEJHg--ujxLkjMrevJXh-Gw

*

Offline Caefix

  • *****
  • 568
  • Sorry, busy deleting test shots...
Re: Remote shooting issues
« Reply #29 on: 10 / August / 2021, 11:13:22 »
Quote
how to print live telemetry data to powershell cmd?
:) You can write lines like ...   
Code: [Select]
os.execute('echo %PATH% &&cd&& dir/b')or
Code: [Select]
function echo(...)
local str=string.format(...)
os.execute('echo '..str)
end

echo("%i Photos of %i", count or 0, maxcount or 1000)
« Last Edit: 10 / August / 2021, 14:05:54 by Caefix »
All lifetime is a loan from eternity.

 

Related Topics