TheImagingSource / tiscamera

The Linux SDK for The Imaging Source cameras.
https://www.theimagingsource.com
Apache License 2.0
299 stars 148 forks source link

RPi get_tcam_property("Exposure Auto") stopped working after software update #389

Closed copterspace closed 3 years ago

copterspace commented 3 years ago

Dear friends, I test DMM 42BUC03-MLA V4L2 on Raspberry PI.

Code from 02-set-properties.py worked OK (and still works OK) on Python 2.7 on 2020-02-13-raspbian-buster-lite, tiscamera software version 0.12.0 I set up this summer.

Now I built up a new system on 2020-12-02-raspios-buster-armhf-lite, installed latest tiscamera software 0.13.0 from github, and switched to Python 3.7. When I run this code from 02-set-properties.py on upgraded system:

        (ret, value,
        min_value, max_value,
        default_value, step_size,
        value_type, flags,
        category, group) = camera.get_tcam_property("Exposure Auto")

        if ret:
            print("Exposure Auto has value: {}".format(value))
        else:
            print("Could not query Exposure Auto")

it errors out:

Exception has occurred: TypeError
unknown type (null)
  File "/home/pi/tiscamera/examples/python/02-set-properties.py", line 38, in print_properties
    category, group) = camera.get_tcam_property("Exposure Auto")

Although same camera on same Raspberry PI with previous version of setup runs this code OK with Python 2.7:

(Exposure Auto has value: False)

Please help me recover the new setup from this error, what should I do:

Bellow is full parameters of both setups. Old (working good setup): Python 2.7 on 2020-02-13-raspbian-buster-lite

pi@HSP3:~ $ tcam-ctrl -l
Available devices:
Model           Type    Serial

DMM 42BUC03-MLA V4L2    38020198

pi@HSP3:~ $ tcam-ctrl --version
Versions:
        Tcam:   0.12.0_master/2ce3ee8_rev_2777
        Aravis: not_configured_version_not_configured
pi@HSP3:~ $ tcam-ctrl --properties 38020198
Found 12 propert(y/ies)
Brightness                              (int) min=0 max=255 step=1 default=12 value=12 category=Exposure
Gain                                    (int) min=34 max=255 step=1 default=16 value=36 category=Exposure
Exposure                                (int) min=100 max=30000000 step=100 default=12700 value=12700 category=Exposure
Trigger Mode                            (bool) default=false value=false category=Special
Software Trigger                        (button) category=Special
Gain Red                                (int) min=0 max=63 step=1 default=1 value=36 category=Exposure
Gain Green                              (int) min=0 max=63 step=1 default=1 value=36 category=Exposure
Gain Blue                               (int) min=0 max=63 step=1 default=1 value=36 category=Exposure
Binning                                 (int) min=1 max=1 step=1 default=1 value=1 category=Unknown
X Offset                                (int) min=0 max=514 step=2 default=0 value=0 category=Unknown
Y Offset                                (int) min=0 max=480 step=2 default=0 value=0 category=Unknown
Trigger Global Reset Shutter            (bool) default=false value=false category=Unknown

New (broken) setup: Python 3.7 on 2020-12-02-raspios-buster-armhf-lite

pi@HSPR-5677:/home $ tcam-ctrl -l
Model: DMM 42BUC03-MLA Serial: 38020198 Type: v4l2
pi@HSPR-5677:/home $ tcam-ctrl --properties 38020198
Brightness                              (int) min=0 max=255 step=1 default=12 value=12 category=Exposure group=Brightness
Gain                                    (int) min=34 max=255 step=1 default=16 value=255 category=Exposure group=Gain
Exposure                                (int) min=100 max=30000000 step=100 default=12700 value=13000 category=Exposure group=Exposure
Trigger Mode                            (bool) default=false value=false category=Special group=Trigger Mode
Software Trigger                        (button) category=Special group=Trigger Mode
Gain Red                                (int) min=0 max=63 step=1 default=1 value=36 category=Exposure group=Gain
Gain Green                              (int) min=0 max=63 step=1 default=1 value=36 category=Exposure group=Gain
Gain Blue                               (int) min=0 max=63 step=1 default=1 value=36 category=Exposure group=Gain
Binning                                 (int) min=1 max=1 step=1 default=1 value=1 category=Unknown group=INVALID_PORPERTY
X Offset                                (int) min=0 max=514 step=2 default=0 value=0 category=Unknown group=INVALID_PORPERTY
Y Offset                                (int) min=0 max=480 step=2 default=0 value=0 category=Unknown group=INVALID_PORPERTY
Trigger Global Reset Shutter            (bool) default=false value=false category=Unknown group=INVALID_PORPERTY
pi@HSPR-5677:/home $
pi@HSPR-5677:/home $ tcam-ctrl --version
Versions:
        Tcam:   0.13.0_master/635b652a_rev_2999
        Aravis: not_configured_version_not_configured
copterspace commented 3 years ago

Update: I checked out to to 0.12.0 version (git checkout v-tiscamera-0.12.0) - it works like a charm again, on both Pythons:

pi@HSPR-6066:~/tiscamera/examples/python $ python3 02-set-properties.py
Expposure Auto has value: True
Gain Auto has value: True
Exposure has value: 12700
Expposure Auto has value: False
Gain Auto has value: False
Exposure has value: 3000
pi@HSPR-6066:~/tiscamera/examples/python $ python 02-set-properties.py
Expposure Auto has value: True
Gain Auto has value: True
Exposure has value: 3000
Expposure Auto has value: False
Gain Auto has value: False
Exposure has value: 3000

so, it seems, it's a new release issue...