get_tick_count overflow after 24 days - page 6 - Script Writing - CHDK Forum

get_tick_count overflow after 24 days

  • 60 Replies
  • 20165 Views
*

Offline reyalp

  • ******
  • 14125
Re: get_tick_count overflow after 24 days
« Reply #50 on: 25 / July / 2021, 16:15:43 »
Advertisements
After I saw the timelapse of the construction site with the horrible wobbling c_joerg posted earlier on this thread, I'm not sure if it is a good idea to retract the lens after each timelapse  ???
I suspect this won't be much of an issue if each sunrise/sunset is a separate video. If you plan to stitch them together, it might be more of a concern.

I found this website:  https://chdk.fandom.com/wiki/Lua/Lua_Reference/Native_Function_Calls
Calling native functions somehow goes deeper into the Canon firmware than just using the chdk functionality?
It allows you to call arbitrary functions in the firmware. Standard CHDK functionality mostly works by calling firmware functions too, so it's not really deeper, but you have the potential to call anything, and some functions could be harmful. You also have to be very sure that you are using the right address for your specific camera model and firmware.

Quote
With that in mind, do I need to run testcallf https://chdk.fandom.com/wiki/Lua/Scripts:Standard/Test/Tstcallf first?
No need.

Quote
I ask all this because I can only change the code remotely without physically being at home where the camera is placed :(
Note to use native calls, you need to enable the setting in the CHDK menu, or upload a  CHDK/CCHDK4.CFG with it set, or use a build that has the option forced on. I believe the CHDKDE autobuild have it on by default.

There's an external editor at http://zenoshrdlu.com/cfgedit/chdkcfgedit.html but I'm not sure off hand whether it works for current versions.

You can also call functions from chdkptp code without native calls being enabled, like
Code: [Select]
exec con:call_function(0xff099f1c)
Don't forget what the H stands for.

Re: get_tick_count overflow after 24 days
« Reply #51 on: 26 / July / 2021, 06:02:59 »
I tested:
Code: [Select]
chdkptp -c -e"luar call_func_ptr(0xff099f1c)" and
Code: [Select]
chdkptp -c -e"exec con:call_function(0xff099f1c)"
the first with the chdk native function calls setting activated and in first case the camera simply went off. I think it crashed? In the second case nothing happens and the lese still retracts in play mode.

I do read https://app.assembla.com/spaces/chdkptp/wiki/CLI_Quickstart and https://app.assembla.com/spaces/chdkptp/wiki/Scripting_Guide and some posts in the forum but I did not find out how to print a luar return value in the cmd.
E.g. in the CLI console which is called with "chdkptp -c -i" I can then call "=return get_zoom()" and then I get the value in CLI console, similar in the GUI of chdkptp but how do I get any return value when executing the command like: "chdkptp -c -e"luar get_zoom()" I also tries to play around with !,=,return, ecec, excec.wait and all the comand but I was not lucky to find the right command.

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

  • *****
  • 1251
Re: get_tick_count overflow after 24 days
« Reply #52 on: 26 / July / 2021, 08:20:41 »
the first with the chdk native function calls setting activated and in first case the camera simply went off. I think it crashed?

When did you call it?
I use it  Immediately after   
Code: [Select]
switch_mode('PLAYBACK')
M100 100a, M3 121a, 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: get_tick_count overflow after 24 days
« Reply #53 on: 26 / July / 2021, 10:11:37 »
the first with the chdk native function calls setting activated and in first case the camera simply went off. I think it crashed?

When did you call it?
I use it  Immediately after   
Code: [Select]
switch_mode('PLAYBACK')

I think I was in rec mode but not 100% sure.

Did not know the mode matters. The command has to be called in the playback mode?

Does the setting "Lens retract: 1 min." matter?

So the procedure would be:
-after luascript finished go to playback mode
-run "exec con:call_function(0xff099f1c)" in chdkptp (since it does not need native function activated)
-wait for next luascript start in playback mode
-change to rec mode
-start luascript again
« Last Edit: 26 / July / 2021, 10:37:27 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 Caefix

  • *****
  • 948
  • Sorry, busy deleting test shots...
Re: get_tick_count overflow after 24 days
« Reply #54 on: 26 / July / 2021, 10:34:59 »
You might also get somewhat less dust on the lens having it retracted most of the time.

Actually the camera is placed in a quite dusty room  ::)

I experienced that part of the dust on the lens is carried inside the lens with each lens retracting. So that's why I use some lens cover to minimise dust... cleaning a p&s sensor is like a nightmare, I won't do that again.
There´s a caselike 58mm filter adapter tube available for G1X. (I like the wide converters from Canon and Siocore.) 
Edit: Best case solution:   8) https://forum.chdk-treff.de/viewtopic.php?f=20&t=3674
Edit2: A nIce tool: USB Temperature Humidity Recorder
« Last Edit: 26 / July / 2021, 13:32:18 by Caefix »
All lifetime is a loan from eternity.

*

Offline Caefix

  • *****
  • 948
  • Sorry, busy deleting test shots...
Re: get_tick_count overflow after 24 days
« Reply #55 on: 26 / July / 2021, 12:40:49 »
camera simply went off. I think it crashed?
Is a new Romlog written? Might be interesting.
Worse case crashes need to pull battery (or external voltage=0 ?) ... (Remotely ...  :o)
All lifetime is a loan from eternity.

*

Offline c_joerg

  • *****
  • 1251
Re: get_tick_count overflow after 24 days
« Reply #56 on: 26 / July / 2021, 13:58:06 »
Does the setting "Lens retract: 1 min." matter?

I don't know, but that's how it was set up for me.

So the procedure would be:
-after luascript finished go to playback mode
-run "exec con:call_function(0xff099f1c)" in chdkptp (since it does not need native function activated)
-wait for next luascript start in playback mode
-change to rec mode
-start luascript again
That's how I would do it.
M100 100a, M3 121a, 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: get_tick_count overflow after 24 days
« Reply #57 on: 26 / July / 2021, 17:32:00 »
That's how I would do it.

Thanks for your confirmation!
It seems to work after a first test: No retraction of the lens and the temperature of the sensor is going back to ~25°C after some time... Also during the timelapse the temperature does not get up to 50+°C as the temperature is much colder now at the beginning ~25°C and the max temperature is 5-10°C lower as before.
...which I would consider a success!!!  :lol :lol

Thank you all!!  8)

Is a new Romlog written? Might be interesting.
Worse case crashes need to pull battery (or external voltage=0 ?) ... (Remotely ...  :o)
can't generate the romlog because running
Code: [Select]
chdkptp -c -e"luar loadfile('A/CHDK/SCRIPTS/TEST/ROMLOG.LUA')()" needs native calls activated.

for what ever reason I can't call the CHDK menu with the print button in the chdkptp GUI but only if physically someone (like my brother) pushes the button on the camera, than the CHDK menu appears, actually it was not like this at the beginning, but I could not figure out why it does not work anymore, same for entering in the main menu with the menu button is not working using chdkptp  ???

Yeah! I saw the case of c_joerg, which I find very impressive! I think for this timelapse project I will adapt the Heating wire solution, once I will have the hole in the wall instead of taking pictures through the window...
« Last Edit: 26 / July / 2021, 17:35:20 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 Caefix

  • *****
  • 948
  • Sorry, busy deleting test shots...
Re: get_tick_count overflow after 24 days
« Reply #58 on: 27 / July / 2021, 13:31:46 »

for what ever reason I can't call the CHDK menu with the print button in the chdkptp GUI but only if physically someone (like my brother) pushes the button on the camera, than the CHDK menu appears, actually it was not like this at the beginning, but I could not figure out why it does not work anymore, same for entering in the main menu with the menu button is not working using chdkptp  ???
Have You changed the <ALT> button?  :-[
At Ix170 etc. is no <print> and it seems, no entry to CHDK Menu via ptp.
Quote
> =enter_alt(1); click ("menu")  ==> Canon menu
When the CHDK-menu is in ptp-viewfinder, it´s just an UI-Overlay, no way to move cursor with mouse...  :(
« Last Edit: 27 / July / 2021, 15:41:12 by Caefix »
All lifetime is a loan from eternity.

*

Offline reyalp

  • ******
  • 14125
Re: get_tick_count overflow after 24 days
« Reply #59 on: 27 / July / 2021, 16:03:01 »

for what ever reason I can't call the CHDK menu with the print button in the chdkptp GUI but only if physically someone (like my brother) pushes the button on the camera, than the CHDK menu appears, actually it was not like this at the beginning, but I could not figure out why it does not work anymore, same for entering in the main menu with the menu button is not working using chdkptp  ???
Have You changed the <ALT> button?  :-[
It is completely normal that chdkptp key presses are only seen by the Canon firmware, not CHDK itself. This is a fundamental limitation of how scripted key presses are implemented and has nothing to do with the alt button or the port.

edit: That's why I went on a long tangent about other ways to enable native calls.
Most other CHDK settings can be changed using set_config_value
« Last Edit: 27 / July / 2021, 16:36:45 by reyalp »
Don't forget what the H stands for.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal