Canon basic scripting - General Help and Assistance on using CHDK stable releases - CHDK Forum

Canon basic scripting

  • 9 Replies
  • 1117 Views
Canon basic scripting
« on: 23 / June / 2024, 09:50:04 »
Advertisements
@reyalp


I’m sure this is a dumb question, but I’ll go ahead and ask it anyway.


I appreciate that getting CHDK or ML up and running on any Canon camera involves a lot of work.


My ‘ask’ is this. Is there a way to run a Canon ‘basic’ script to get the Canon reported lower focus distance and ideally, the focal length and aperture number; and continuously report these to the screen.


What I wish to do, is report the infinity blur, say, or some other focus related figure, based on knowing the Canon reported distance, the FL and the aperture.
« Last Edit: 23 / June / 2024, 09:53:33 by pigeonhill »

*

Offline reyalp

  • ******
  • 14125
Re: Canon basic scripting
« Reply #1 on: 23 / June / 2024, 14:29:39 »
Quote
My ‘ask’ is this. Is there a way to run a Canon ‘basic’ script to get the Canon reported lower focus distance and ideally, the focal length and aperture number; and continuously report these to the screen.
In theory it seems like it would probably be possible, but would take a non-trivial amount of development. Someone would have to actually start the development on the camera(s) in question to have a good idea how difficult or not it would be.

It would also be unlikely to be completely portable. It's possible you could come up with a script that worked most fixed lens PowerShots for example, but the PowerShot EOS M and other non-PowerShot families would each be different. You might also find some of the things you need aren't available through eventprocs and require camera and firmware specific memory addresses, as the clean overlays script https://chdk.setepontos.com/index.php?topic=13489.0 does (AFAIK this is pretty much the only example of a widely used Canon Basic script outside of firmware dumping)

Don't forget what the H stands for.

Re: Canon basic scripting
« Reply #2 on: 23 / June / 2024, 14:50:51 »
Ok for what it’s worth here is my wish list for a ‘developer’ looking to see what Canon Basic can do, ie I’m out of my depth.


Focus on the M6mk2, as it’s the best M cam you can get and it’s unlikely to have ML or CHDK anytime soon.


Try and get canon (lower) focus distance to display on the LCD for EFM lenses, ie as you changed focus.


That alone would be a game changer, as if you can print out the Canon lower distance, you can print out other stuff if you also can read the focal length and the aperture. Even if you can ‘only’ print the distance, it would help.


As I say, a wish list, as a developer would need to look at this.
« Last Edit: 23 / June / 2024, 17:03:51 by pigeonhill »

*

Offline reyalp

  • ******
  • 14125
Re: Canon basic scripting
« Reply #3 on: 23 / June / 2024, 16:34:27 »
For M6 mk2 https://www.magiclantern.fm/forum/index.php?topic=25305.0 is probably the best starting point.

A firmware dump would be helpful to get an idea of what eventprocs are available. You can get some idea just from strings, but for anything serious you'll want a disassembler like Ghidra to understand which ones are actually implemented and what kind of parameters they take, unless everything you want to use has already been figured out somewhere else.

Judging from your other work here, you certainly could pick up the knowledge needed to do this kind of thing, though of course it might take far more effort than you want to spend.

Working with Canon Basic is (IMO) a quite unpleasant experience. It's limited language with very poor diagnostics.

Don't forget what the H stands for.

Re: Canon basic scripting
« Reply #4 on: 24 / June / 2024, 00:58:10 »
@reyalp


Thanks for the insight, I’ll reflect on things ;-)

*

Offline c_joerg

  • *****
  • 1251
Re: Canon basic scripting
« Reply #5 on: 24 / June / 2024, 07:59:16 »
(AFAIK this is pretty much the only example of a widely used Canon Basic script outside of firmware dumping)

The most commonly used script is probably CameraInfo. Unfortunately, Canon prevents this from happening with newer R cameras.

https://chdk.setepontos.com/index.php?topic=13943.msg144153#msg144153
https://www.magiclantern.fm/forum/index.php?topic=25305.msg231005#msg231005

I've also tried Canon Basic several times. Unfortunately, there are a lot of functions where only one 0 function is stored.
I was hoping I could control the focus on my EOS R.

https://www.magiclantern.fm/forum/index.php?topic=25305.100
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: Canon basic scripting
« Reply #6 on: 24 / June / 2024, 08:24:00 »
@c_joerg 

Thanks for the additional insight.
I think my 'use case' is a lost cause on the M6Mk2, ie to constantly have the camera, via a Canon Basic Script, provide Canon lens position info.
Eyesight and focus peeking it is then ;-)
Cheers
Garry

*

Offline c_joerg

  • *****
  • 1251
Re: Canon basic scripting
« Reply #7 on: 24 / June / 2024, 08:50:33 »
I think my 'use case' is a lost cause on the M6Mk2, ie to constantly have the camera, via a

So basically representing a value shouldn't be a problem. @srsa_4c has already shown this for the battery voltage.




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: Canon basic scripting
« Reply #8 on: 24 / June / 2024, 09:55:24 »
@c_joerg


Then maybe all is not lost.


All I need now is to find someone who knows what they’re doing to do a proof of principle test, ie one can access focus distance, and show an idiot like me how to get things going on an M6mk2.

*

Offline reyalp

  • ******
  • 14125
Re: Canon basic scripting
« Reply #9 on: 24 / June / 2024, 14:08:15 »
So basically representing a value shouldn't be a problem. @srsa_4c has already shown this for the battery voltage.
I'm not sure if the script you reference did this, but constantly updating, without interfering with normal input will also require running the script a separate task. This is possible on CHDK PowerShots at least. I'm not sure whether everything required exists or has the same names on the Digic >= 8 firmware, but I'd expect Canon kept the ability to run tasks in some form https://chdk.setepontos.com/index.php?topic=13522.msg138130#msg138130
Don't forget what the H stands for.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal