Skip to content

Fix ND-1000 on macOS: tolerant clear_halt + lamp-off reset - #1252

Merged
rickwierenga merged 1 commit into
PyLabRobot:add-nd1000-supportfrom
vcjdeboer:nanodrop-macos-fixes
Sep 10, 2026
Merged

Fix ND-1000 on macOS: tolerant clear_halt + lamp-off reset#1252
rickwierenga merged 1 commit into
PyLabRobot:add-nd1000-supportfrom
vcjdeboer:nanodrop-macos-fixes

Conversation

@vcjdeboer

Copy link
Copy Markdown
Contributor

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):

  1. clear_halt crash on macOS — libusb raises [Errno 2] Entity not found for an endpoint that isn't actually halted, which crashes setup(). Made it best-effort per endpoint. (python-seabreeze, the reference Ocean Optics stack, doesn't call clear_halt at all.)

  2. 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

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
@rickwierenga
rickwierenga merged commit 89bec0b into PyLabRobot:add-nd1000-support Sep 10, 2026
2 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants