tiagocoutinho / hamamatsu

Python library for hamamatsu detectors (lima plugin included)
GNU General Public License v3.0
11 stars 5 forks source link

Cannot connect to orca flash v4.2 #1

Closed dboonz closed 2 years ago

dboonz commented 3 years ago

Dear project makers,

Thanks a lot for making this repository, it seems like it will save a lot of work :).

I tried to run the code, but when I connect to an orca flash v4.2, I get the following error:

 (naparicam) python -m hamamatsu.dcam

Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\envs\naparicam\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\ProgramData\Anaconda3\envs\naparicam\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\ProgramData\Anaconda3\envs\naparicam\lib\site-packages\hamamatsu\dcam.py", line 1892, in <module>
    main()
  File "C:\ProgramData\Anaconda3\envs\naparicam\lib\site-packages\hamamatsu\dcam.py", line 1882, in main
    with dcam[0] as camera:
  File "C:\ProgramData\Anaconda3\envs\naparicam\lib\site-packages\hamamatsu\dcam.py", line 1459, in __enter__
    self.open()
  File "C:\ProgramData\Anaconda3\envs\naparicam\lib\site-packages\hamamatsu\dcam.py", line 1668, in open
    self._build_capabilities()
  File "C:\ProgramData\Anaconda3\envs\naparicam\lib\site-packages\hamamatsu\dcam.py", line 1487, in _build_capabilities
    eprop = EProp(prop_id.value)
  File "C:\ProgramData\Anaconda3\envs\naparicam\lib\enum.py", line 360, in __call__
    return cls.__new__(cls, value)
  File "C:\ProgramData\Anaconda3\envs\naparicam\lib\enum.py", line 678, in __new__
    raise ve_exc
ValueError: 4327472 is not a valid EProp

I am using the latest hokawo and dcam api hokawo (3.0.8.8) dcam module 21.5.4322.6256 driver 8.26.1500.6256

Anything else you'd like me to test?

tiagocoutinho commented 3 years ago

Thanks for reporting @dboonz.

At first I thought the problem you have was because I based my code on a dcam API from 2018. But even in the version from 2021-06-18 I cannot find a reference to the item 4327472 (0x420830).

I am trying a different approach: ignore any unknown capabilities. I have made a commit in master but before I ask you to try I would like to test with a real camera myself

I let you know as soon as I have a working version

tiagocoutinho commented 3 years ago

Hi @dboonz, I have just released version 0.1.3 which should fix your problem. You can either test from master or update from pypi. Please let me know if this fixes your problem.