Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USB2000 Issue reading intensities #197

Open
jjcamus opened this issue May 31, 2023 · 1 comment
Open

USB2000 Issue reading intensities #197

jjcamus opened this issue May 31, 2023 · 1 comment

Comments

@jjcamus
Copy link

jjcamus commented May 31, 2023

spectrometer and system information

  • model: USB2000
  • operating system: Raspbian GNU / Linux 11 bullseye (32 bits)
  • python version: 3.9.2_
  • python-seabreeze version: current master
  • installed-via: wheel

current problem

When trying to read the intensities of an USB2000 using pyseabreeze in a Raspberry Pi 4, i get an error from the libusb library
"[Errno 5] Input/Output Error"

I already updated the USB2000 FirmWare and check that the reading works using the cseabreeze backend in my windows 10 64 bit (using python 3.9.2 as well and installed via pip), so the spectrometer is not the problem.

The Raspberry detect the USB2000 and can read the wavelengths. Is trying to read the intensities the issue.

Another issue is that in windows using the pyseabreeze backend doesn't detect the spectrometer, but in the raspberry using the cseabreeze backend doesn't detect the spectrometer.

steps to reproduce

After installing the library in the raspberry with pip (piwheels), run:

  1. import seabreeze
  2. seabreeze.use('pyseabreeze')
  3. spec = seabreeze.spectrometers.Spectrometer.from_first_available()
  4. intensities = spec.intensities()

minimal code example and error (very helpful if available)

Traceback (most recent call last):
  File "/home/camus/Documents/testSeaBreez.py", line 24, in <module>
    intensities = spec.intensities()
  File "/home/camus/python-seabreeze/build/lib.linux-armv7l-3.9/seabreeze/spectrometers.py", line 212, in intensities
    out = self._dev.f.spectrometer.get_intensities()
  File "/home/camus/python-seabreeze/build/lib.linux-armv7l-3.9/seabreeze/pyseabreeze/features/spectrometer.py", line 187, in get_intensities
    tmp = self._get_spectrum_raw()
  File "/home/camus/python-seabreeze/build/lib.linux-armv7l-3.9/seabreeze/pyseabreeze/features/spectrometer.py", line 159, in _get_spectrum_raw
    self.protocol.send(0x09)
  File "/home/camus/python-seabreeze/build/lib.linux-armv7l-3.9/seabreeze/pyseabreeze/protocol.py", line 78, in send
    return self.transport.write(data, timeout_ms=timeout_ms)
  File "/home/camus/python-seabreeze/build/lib.linux-armv7l-3.9/seabreeze/pyseabreeze/transport.py", line 184, in write
    return self._device.pyusb_device.write(  # type: ignore
  File "/home/camus/.local/lib/python3.9/site-packages/usb/core.py", line 989, in write
    return fn(
  File "/home/camus/.local/lib/python3.9/site-packages/usb/backend/libusb1.py", line 837, in bulk_write
    return self.__write(self.lib.libusb_bulk_transfer,
  File "/home/camus/.local/lib/python3.9/site-packages/usb/backend/libusb1.py", line 938, in __write
    _check(retval)
  File "/home/camus/.local/lib/python3.9/site-packages/usb/backend/libusb1.py", line 604, in _check
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 5] Input/Output Error
@ap--
Copy link
Owner

ap-- commented Jun 11, 2023

Hello @jjcamus

In your description you state that you've installed python-seabreeze from the provided wheels on your rasbian installation, but the traceback suggests you're running from an editable install?

Also: if your spectrometer works on windows via the cseabreeze backend, why not use the same on the raspberry?

Cheers,
Andreas 😃

PS.: here's a link to the piwheels build for rasberry: https://www.piwheels.org/project/seabreeze/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants