Can you use scripts to navigate chdk menus? - Hello, I'm a NEWBIE - HELP!! (Newbies assistance, User Guides and thank you notes) - CHDK Forum

Can you use scripts to navigate chdk menus?

  • 3 Replies
  • 1349 Views
Can you use scripts to navigate chdk menus?
« on: 13 / May / 2012, 18:30:22 »
Advertisements
First of all, as part of my first post, thanks to everyone for there effort in creating chdk.

I would like to be able to navigate the chdk menus.
I thought that if you were in alt mode and your script said click "menu" then then it would take you to the chdk menu. Well, I see it don't work like that, and for good reason.

I've searched for info on this for most of the day and found nothing. My goal is to write a script that batch deletes raw pictures. I also want to write a script that batch moves the under/overexposed jpegs to a different directory.

I have also written a zooming burst HDR script for my sx130 that I'm still debugging, so every once and a while it crashes during the script, then when I restart it I have to guess where the zoom position was, so I was thinking that maybe I could have the script change the @param value instead of the relative value, that way if the camera does crash it could start back at where it left off.

Thanks for any reply


*

Offline reyalp

  • ******
  • 11846
Re: Can you use scripts to navigate chdk menus?
« Reply #1 on: 13 / May / 2012, 19:26:08 »
Unfortunately, you cannot interact with the CHDK UI using the keypress functions. These only get sent to the original canon firmware. This is not something that would be easy to fix.

You can change many of the settings available in the menu using http://chdk.wikia.com/wiki/Script_commands#set_config_value - note that you will have to refer to the CHDK source to get the magic numbers, and it doesn't let you use the menus that do something rather than just changing a config value.

I've searched for info on this for most of the day and found nothing. My goal is to write a script that batch deletes raw pictures. I also want to write a script that batch moves the under/overexposed jpegs to a different directory.
Using lua, you can delete files using os.remove. There is not a move function, but you can copy a file using file io and delete the original. This will be rather slow, and you will have to be careful not to run out of RAM doing the copy.
Quote
I have also written a zooming burst HDR script for my sx130 that I'm still debugging, so every once and a while it crashes during the script, then when I restart it I have to guess where the zoom position was, so I was thinking that maybe I could have the script change the @param value instead of the relative value, that way if the camera does crash it could start back at where it left off.
I don't really see how this would work. You could record the zoom position in a file and read it when the script loads, but if the camera is crashing the data might not be written to disk. If you close the file, it should generally cause the data to be written. Note that crashing can also corrupt the filesystem.

If you can get a romlog from the crash, that may help narrow down why it is happening. See http://chdk.wikia.com/wiki/Debugging#Camera_crash_logs_.28romlog.29
Don't forget what the H stands for.

Re: Can you use scripts to navigate chdk menus?
« Reply #2 on: 13 / May / 2012, 19:47:50 »
Wow, thanks a lot, I wasn't expecting a reply so quick. I'll look into getting the romlog your talking about.

The most problematic crash I'm having now has to do with changing the zoom position with manual focus. 
The other problem has to do with raw enabled.
I'm guessing my script doesn't allow enough time for saving the large files to the sdhc card.   

I have tried looking for a "get writing to card status" "get led status on/off" don't know what it would be called. I saw something that had to do with writing video to card though.

This is the first kind of scripting I have ever done, and lua looks like complete gibberish to me right now, but I'll look into it now thanks for the link.

And Thanks for your reply.

*

Offline reyalp

  • ******
  • 11846
Re: Can you use scripts to navigate chdk menus?
« Reply #3 on: 13 / May / 2012, 20:12:42 »
The most problematic crash I'm having now has to do with changing the zoom position with manual focus. 
Focus and zoom control have issues on many cameras.
Quote
The other problem has to do with raw enabled.
I'm guessing my script doesn't allow enough time for saving the large files to the sdhc card.   

I have tried looking for a "get writing to card status" "get led status on/off" don't know what it would be called. I saw something that had to do with writing video to card though.
I don't think there's a way to tell if raw saving is done. If you use the shoot command (rather than clicking shoot_half, shoot_full etc) it should only return when raw saving is complete (but I'm not 100% sure about this). There isn't a function to get the status of LEDs, you could read the MMIO directly with peek() but that would be very fragile.

If shooting speed isn't critical, you may be better off just putting a big sleep() after the shot.
Quote
This is the first kind of scripting I have ever done, and lua looks like complete gibberish to me right now, but I'll look into it now thanks for the link.
You can find Lua language documentation here: http://www.lua.org/manual/5.1/
You should be able to find find some introductory (not CHDK specific) Lua tutorials on google.

Information about the CHDK implementation is here http://chdk.wikia.com/wiki/Lua
Don't forget what the H stands for.


 

Related Topics