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 and some Flame S error at initialization due to fpga firmware version register check #226

Open
dbhatman opened this issue Dec 8, 2023 · 4 comments

Comments

@dbhatman
Copy link

dbhatman commented Dec 8, 2023

spectrometer and system information

  • model: USB2000
  • operating system: Ubuntu 18
  • python version: 3.11
  • python-seabreeze version: 'current master'
  • installed-via: conda

current problem

Using a very old version of pyseabreeze I had successfully used USB2000 spectrometers, but now I am hitting an AssertionError in fpga.py when using spectrometers.Spectrometer.from_first_available().

The error reported is AssertionError: ['0x0', '0x46', '0x30'] being hit here

Maybe the USB2000 also does not adhere to the expected protocol as was noted here for the FlameS but in its own atypical way: https://github.com/ap--/python-seabreeze/issues/97#issuecomment-674567912

A USB2000+ (note I am using a non-plus but could not find a datasheet for it) datasheet seems to suggest the same "Return format" as the assertion expects (starting with the register's address) but instead we are getting 0! Datasheet I could find https://ph208.edu.physics.uoc.gr/pdfs/OEM-Data-Sheet-USB2000-.pdf

steps to reproduce

USB2000 plugged in and then

spectrometers.Spectrometer.from_first_available()

@dbhatman
Copy link
Author

dbhatman commented Dec 8, 2023

Interestingly I am also seeing this from one of my FlameS sectrometers. Others are operating fine (ie are fixed by https://github.com/ap--/python-seabreeze/issues/97#issuecomment-674567912)

@dbhatman dbhatman changed the title USB2000 seems to no longer be usable due to fpga.py firmware version register check USB2000 and some Flame S seems to no longer be usable due to fpga.py firmware version register check Dec 8, 2023
@dbhatman dbhatman changed the title USB2000 and some Flame S seems to no longer be usable due to fpga.py firmware version register check USB2000 and some Flame S error at initialization due to fpga firmware version register check Dec 8, 2023
@ap--
Copy link
Owner

ap-- commented Dec 10, 2023

Hi @dbhatman

Thanks for the report!

I don't think your USB2000 is a nonplus version. That code path is just run for the USB2000+ and FlameS if I'm not mistaken.

Can you please report the vendor and product id of the USB spectrometer?

Regarding the FlameS:
Could you try running your test code with the optimize flag so that assert statements are skipped?

python -O myscript.py

It seems your flame S is on major firmware version 3. It's possible that they changed the return code in those revisions.

And could you try to figure out what version of seabreeze broke the USB2000-nonplus for you?
If you could just pip install older versions to see when it broke, that would be super helpful.

Cheers,
Andreas

@jlball
Copy link

jlball commented Jan 4, 2024

Hi all,

Been running into the same issue with a USB2000+ (the AssertionError) and found that the most recent version where I didn't get this error is version 1.2.0.

@ap--
Copy link
Owner

ap-- commented Jan 6, 2024

Hi @jlball,

Thank you for checking the versions and reporting back. Could you provide the error message when the assertion error is raised using the newest seabreeze version, and could you try running your test code with python -O yourtestscript.py to disable assertions.

If you can confirm that the code runs with assertions disabled, I can release a new version without the check.

Thanks,
Andreas

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

3 participants