Commit Graph

2 Commits

Author SHA1 Message Date
serversdown 49c79e9c2a feat: add NL-52 USB bulk probe implementation
fix: jinja2 dict hash bug
2026-06-08 17:57:30 +00:00
serversdown 0fcab0d0dc feat: NL-42/NL-52 serial control layer (USB/RS-232, dependency-free)
Adds a stdlib-only (termios, no pyserial) control layer for the older RION
NL-42/NL-52 meters, which have no Ethernet option and speak the same ASCII
command family as the NL-43 over RS-232C or USB (virtual COM port).

- nl52/protocol.py: I/O-free parsers for DOD? (14 fields) and DRD? (9
  fields), result codes, and level tokens. Handles '--.-' disabled-channel
  nulls and space-padded fixed-width fields.
- nl52/client.py: termios SerialPort + NL52Client. Echo-tolerant result-code
  reading, buffered multi-line reads, NL-52 rate limits (200ms; 1s for DOD?).
  is_request = "?" in cmd (NL-52 requests can carry a param after '?', e.g.
  'System Version?NL').
- nl52/cli.py: bench tool — probe/status/start/stop/monitor/poll/raw — for
  testing over USB on the dev server with nothing to install.
- test_nl52_protocol.py: 45 parser assertions, host-runnable (no hardware).
  Client exchange logic separately validated via pty loopback.

NL-52 quirks vs NL-43: DOD has no Lpeak and no measurement-state (query
Measure? separately); DRD streaming requires the NX-42EX option.

Not yet: SLMM integration (async transport / serial->TCP bridge for the RX55
PAD-mode path), DB model, validation against real hardware.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 01:02:51 +00:00