ap-- / python-seabreeze

Python module for OceanOptics spectrometers
https://python-seabreeze.readthedocs.io
MIT License
211 stars 82 forks source link

Ocean HR-6XR500-25 can't be connected #269

Closed Hollen0318 closed 10 hours ago

Hollen0318 commented 1 day ago

spectrometer and system information

current problem

The OceanView can detect and operate the device; Apple System Information can find the device; However, the code can't find the device either through first_available() or sb.Spectrometer.from_serial_number("HR600278") or list_devices() returns empty list.

steps to reproduce

Step by step instructions to reproduce the error. The more detailed the better, but please use some common sense:

  1. Plug the Mac computer to the Ocean HR
  2. install miniconda for MacOS
  3. Create a new environment named ocean with python version being 3.10 like conda create -n ocean python=3.10
  4. Run pip install seabreeze
  5. Open a notebook, or create a new python script
  6. Write code listed below import seabreeze.spectrometers as sb spec = sb.Spectrometer.from_serial_number("HR600278")
  7. Bug Shown Below
  8. Open the Systems Information and the OceanView, take a screenshot

minimal code example and error (very helpful if available)

import seabreeze.spectrometers as sb
spec = sb.Spectrometer.from_serial_number("HR600278")

SeaBreezeError Traceback (most recent call last) Cell In[14], line 2 1 import seabreeze.spectrometers as sb ----> 2 spec = sb.Spectrometer.from_serial_number("HR600278")

File ~/miniconda3/envs/ocean/lib/python3.10/site-packages/seabreeze/spectrometers.py:181, in Spectrometer.from_serial_number(cls, serial) 179 return cls(dev) 180 else: --> 181 raise cls._backend.SeaBreezeError( 182 "No device attached with serial number '%s'." % serial 183 ) SeaBreezeError: No device attached with serial number 'HR600278'.

Screenshot 2024-10-28 at 5 29 33 PM Screenshot 2024-10-28 at 5 29 52 PM Screenshot 2024-10-28 at 5 32 25 PM
Hollen0318 commented 1 day ago

The ReadMe states that Pyseabreeze is not supported for the HR6 and recommends using Ethernet or CSeabreeze. Could you explain what CSeabreeze is? Also, could the issue be related to the USB port ID? I'm not entirely sure, but my USB Product ID is 0x1006, as shown in the system information screenshot.

ap-- commented 10 hours ago

Supported in v2.10.0 via:

# pip install "seabreeze[pyseabreeze]>=2.10.0"

import seabreeze
seabreeze.use('pyseabreeze')

from seabreeze.spectrometers import Spectrometer
spec = Spectrometer.from_first_available()
print(spec.intensities())