Put the camera model number and firmware version in the README or another file - Feature Requests - CHDK Forum  

Put the camera model number and firmware version in the README or another file

  • 5 Replies
  • 596 Views
Advertisements
I run CHDK on multiple Canon Powershots and I have one SD card for each camera so that way I don't have to delete and copy a different version of CHDk when I want to use a different camera. To be able to quickly tell which card goes with what camera I put a text file on each SD card named after the model number of the camera.

I suggest that the official distributions of CHDK either put the camera model number and firmware version in the README or have a separate file that as an example contains the model number as the filename and in the file contains the version number. That way it is easy to match SD cards with cameras.

I already tried grepping (case in-sensitive) for the model number and I did not find it at-least for the releases I tried.
« Last Edit: 06 / August / 2019, 21:33:17 by icantregister »

*

Offline reyalp

  • ******
  • 12218
That's a good idea. Camera specific notes are copied to camnotes.txt, which *should* mention the model name, but you'd have to look in side, and there's probably some c&p errors.

Firmware version is slightly complicated, because in some cases we have multiple Canon firmwares that are actually supported by the same build, and actually only build one of them. People occasionally notice this in the splash screen / build info.

There was some discussion previously about having a some kind of version metadata file, starting around https://chdk.setepontos.com/index.php?topic=13091.20
This didn't get added for various reasons, but the basic idea of being able to ID what cam the build was for has merit.
Don't forget what the H stands for.

*

Offline SX720

  • *
  • 13
I see what you mean about the firmware version. I think even with just the model number it would benefit a lot of people.

I made a program using Python to display which platforms have or don't have the model number in the notes. Originally I was going to post the generated table but it was too big. I can split it up into multiple posts but I would like to make sure that this is desired. This program could easily be extended to automatically include the model number if it does not have it.
Code: [Select]
#!/usr/bin/python3
import argparse
parser = argparse.ArgumentParser(description='Camera model in notes.txt checker.')
parser.add_argument('platform_directory', help = 'A path to the platform directory in the SVN repository.')
args = parser.parse_args()

import os
import sys

platform_directory = os.path.normpath(args.platform_directory)
all_cameras = os.listdir(platform_directory)

# Sort the list of cameras to ensure that the generated table is sorted alphabetically.
all_cameras = sorted(all_cameras)

if len(all_cameras):
    print('[table]')
    print('[tr]')
    print('[td]') # The forums don't seem to support th.
    print('Camera model #')
    print(['/td'])
    print('[td]')
    print('Status')
    print(['/td'])
    print(['/tr'])
else:
    print('The selected folder does not contain any directories or files.', file = sys.stderr)
    exit(1)


for camera in all_cameras:
    camera_directory = os.path.join(platform_directory, camera)
    # os.listdir returns both directories and files. This check prevents further processing of a file.
    if os.path.isdir(camera_directory):
        notes_txt_path = os.path.join(camera_directory, 'notes.txt')
        if os.path.exists(notes_txt_path):
            # The encoding = 'latin-1' is to fix a UTF-8 exception that I was getting.
            with open(notes_txt_path, encoding = 'latin-1') as notes_file:
                notes_contents = notes_file.read()
            has_model_in_notes = camera.upper() in notes_contents.upper()
            if has_model_in_notes:
                final_status = 'Has it'
            else:
                final_status = 'Does not have it'
        else:
            final_status = 'Notes.txt missing'
        print('[tr]')
        print('[td]')
        print(camera)
        print('[/td]')
        print('[td]')
        print(final_status)
        print('[/td]')
        print('[/tr]')
print('[/table]')

*

Offline reyalp

  • ******
  • 12218
Here's a patch some hokey shell stuff to put build information in camnotes.txt, which is also incorporated into the readme.txt

The output is like
Code: [Select]
*** Build Information ***
CHDK for sx510hs fw:100d compatible fw:100c 100a PID:12919
build:1.5.0-5240 date:Sat, 10 Aug 2019 20:02:56 -0700

*** Camera specific notes ***
I'll probably check this in if there are no objections.

For cameras that are built form another platform (currently only sx270/sx275 built from sx280 I think) it lists the target camera, like sx275. IMO this is the better thing to do, since the PIDs are different, making FI2 files not cross compatible.

If you build a copied sub (e.g. sx510hs 100c in the above example) the real firmware is still listed first, followed by the compatible ones.
Don't forget what the H stands for.


*

Offline reyalp

  • ******
  • 12218
This is checked in, trunk 5242 stable 5244
Don't forget what the H stands for.

*

Offline SX720

  • *
  • 13
I tried your patch and I really like the output. Thank you for making this change.

It might make sense to always output the date in the UTC timezone for privacy and consistency reasons. This is done by passing the -u option to date. It works even when combined with -R.

 

Related Topics