Fix ND-1000 on macOS: tolerant clear_halt + lamp-off reset - #1252
Merged
rickwierenga merged 1 commit intoSep 10, 2026
Merged
Conversation
Two fixes found by testing on a physical ND-1000 on macOS: - _configure_usb_device: on macOS libusb raises "Entity not found" for an endpoint that is not actually halted, crashing setup(). Make clear_halt best-effort per endpoint (seabreeze, the reference Ocean Optics stack, does not call it at all). - stop(): the command-based lamp-off ([0x03, 0x00]) is unreliable on this device's firmware and intermittently leaves the lamp on. Add a USB reset at teardown (as the original driver did) to clear the lamp latch deterministically. Re-enumeration is harmless at teardown; verified the lamp reliably switches off and reconnection still works. Verified on hardware: drives the device and measures a correct paracetamol UV spectrum (lambda-max ~243 nm). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018b3SXMWSzNMuNe6S48Yk7m
vcjdeboer
force-pushed
the
nanodrop-macos-fixes
branch
from
September 10, 2026 17:22
df4df36 to
9231817
Compare
rickwierenga
merged commit Sep 10, 2026
89bec0b
into
PyLabRobot:add-nd1000-support
2 of 19 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tested #1166 on a physical NanoDrop ND-1000 on macOS — it drives the device and measures a correct paracetamol UV spectrum (λmax ≈ 243 nm). Two small fixes were needed, both in
pylabrobot/thermo_fisher/nanodrop_1000/nanodrop_1000.py(+14/-3):clear_haltcrash on macOS — libusb raises[Errno 2] Entity not foundfor an endpoint that isn't actually halted, which crashessetup(). Made it best-effort per endpoint. (python-seabreeze, the reference Ocean Optics stack, doesn't callclear_haltat all.)Lamp not switching off — the command-based lamp-off (
[0x03, 0x00]) is unreliable on this device's firmware and intermittently leaves the lamp on. Restored a USB reset at teardown (as Jordvl's original driver did), which clears the lamp latch reliably. Re-enumeration is harmless at teardown.Windows setup steps (Zadig / BOS reg key) untested — no Windows machine here.
Full write-up with plots + raw data: https://github.com/vcjdeboer/nanodrop-pylabrobot-demo
🤖 Generated with Claude Code
https://claude.ai/code/session_018b3SXMWSzNMuNe6S48Yk7m