python-seabreeze: RedTide 650 support not working
spectrometer and system information
- model: RedTide 650
- operating system: macOS 10.12.5
- python version:3.5.1
- python-seabreeze version: 0.6.0
- installed-via: _conda
current problem
In a nutshell, the same code I have that works with an Ocean Optics USB2000 when applied to a RedTide 650 (which appears to be listed on the list of compatible devices) doesn’t work due to a failure to connect to the spectrometer. The specific steps are below:
steps to reproduce
Specifically, although Apple’s System Profiler clearly shows the RedTide connected (and I can access it via Vernier’s Logger Pro software), when I do
import seabreeze.spectrometers as sb
devices = sb.list_devices()
print(devices)
I get a blank list.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 24 (10 by maintainers)
I have never used the python lib, I use my own C code. The USB650 has these differences
In C code … USB HR2000 and 650 have the same identification (desc.idVendor == 0x2457 && desc.idProduct == 0x1014) The ports are the same too: #define EP_IN1 (0x87) // USB650 #define EP_IN2 (0x82) static int EP_OUT = 2; /// USB650 static int EP_OUT2 = 7; /// USB650, not used for simple queries
Then try to get CCD temperature to find out if USB650 libusb_bulk_transfer(devFlame, EP_OUT, (unsigned char*)“\x6C”, 1, NULL, 100); if (libusb_bulk_transfer(devFlame, EP_IN1, buffer, 3, NULL, 100) < 0) { // USB650 set maximum data limit to 4095 to detect overflow If USB650 then valid timeconst are from 3 ms (3000 us) to 15000 ms (15000000 us)! (So 1000 times less than all other using us) … }
Reading data is a little convoluted and different from all others but very old HR2000 #define MAX_DATA (2048) #define SKIP_START (24) const int num_pts = MAX_DATA - SKIP_START; // first 24 are zero memset(data, 0, sizeof(uint32_t) * MAX_DATA); memset(spec.data, 0, sizeof(double) * MAX_DATA); DWORD timeout = (last_time_constant/900+100);
error = libusb_bulk_transfer(devFlame, EP_OUT, (unsigned char*)“\x09”, 1, &num_bytes, timeout); if (!error) error = libusb_bulk_transfer(devFlame, EP_IN2, buffer, 4097, &num_bytes, timeout); if (error || num_bytes < 4097) { while (!libusb_bulk_transfer(devFlame, EP_IN2, buffer, 4097, &num_bytes, 100)); while (!libusb_bulk_transfer(devFlame, EP_IN1, buffer, 4097, &num_bytes, 100)); return 0; } uint16_t max_value = 0; for (int i = SKIP_START; i < SKIP_START + num_pts; ) { int offset = (i / 64) * 128; int start_k = (i % 64); for (int k = start_k; k < 64; k++) { uint16_t d = buffer[offset + k] + 256 * buffer[offset + k + 64]; data[i++] = d; if (d > max_value) { max_value = d; } } }