chdk-command to identify the camera model? - Script Writing - CHDK Forum

chdk-command to identify the camera model?

  • 9 Replies
  • 3401 Views
chdk-command to identify the camera model?
« on: 15 / November / 2008, 19:41:58 »
Advertisements
Is there a chdk-command to identify the camera model?

*

Offline reyalp

  • ******
  • 12145
Re: chdk-command to identify the camera model?
« Reply #1 on: 15 / November / 2008, 20:46:10 »
In lua, you can use CHDK/MoreBest - CHDK Wiki

AFAIK there is currently no way to get this information in ubasic.
Don't forget what the H stands for.

*

Offline Hacki

  • ****
  • 358
  • SX100
Re: chdk-command to identify the camera model?
« Reply #2 on: 15 / November / 2008, 20:50:02 »
I dont get it - i order to run CHDK on the camera, you already need to know the model & firmware version, so what the point?

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: chdk-command to identify the camera model?
« Reply #3 on: 15 / November / 2008, 20:57:30 »
you could write scripts that act in specific ways on certain cameras.


Re: chdk-command to identify the camera model?
« Reply #4 on: 16 / November / 2008, 04:19:17 »
Ok, if there is no ubasic function that returns the camera model, then maybe there is a ubasic function that returns the chdk-firmware startup message? That message contains the camera model.

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: chdk-command to identify the camera model?
« Reply #5 on: 16 / November / 2008, 06:53:39 »
As reyalp pointed out you can use get_buildinfo() in Lua for that.

There are no string variables or functions that return strings in ubasic (the CHDK kind at least).

There are some commands in ubasic to help you write portable scripts if that's what you're after, see reyalp's link for those too (get_propset and get_nd_present, for example).

Re: chdk-command to identify the camera model?
« Reply #6 on: 16 / November / 2008, 09:11:40 »
I would have liked to identify the camera in my script BatteryCheck.bas (Using chdk to measure the internal resistance of the batteries in the camera), in order to select the proper values for two parameters (they depend on the camera model). Just for my two camera models (A720 and A540).

I tried to use get_buildinfo(), but I don't know how it works. I don't think it is worthwhile to spend more time on it.

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: chdk-command to identify the camera model?
« Reply #7 on: 16 / November / 2008, 09:34:51 »
get_buildinfo works in Lua http://chdk.wikia.com/wiki/LUA, not in ubasic.
It works as the example in http://chdk.wikia.com/wiki/CHDK/MoreBest#get_buildinfo.


*

Offline reyalp

  • ******
  • 12145
Re: chdk-command to identify the camera model?
« Reply #8 on: 17 / November / 2008, 01:18:58 »
ubasic can't really return a camera model string, since it doesn't have a concept of string variables. We could easily add a function to get the platformid number.
Don't forget what the H stands for.

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: chdk-command to identify the camera model?
« Reply #9 on: 25 / November / 2008, 18:51:46 »
get_platform_id now is working in ubasic, which should help you identifying the camera your ubasic script is running on.

 

Related Topics