diff --git a/COMMUNICATION_GUIDE.md b/COMMUNICATION_GUIDE.md new file mode 100644 index 0000000..6af46cf --- /dev/null +++ b/COMMUNICATION_GUIDE.md @@ -0,0 +1,256 @@ +# NL-43 / NL-53 Communication Guide (Concise + Full Reference) + +Single-file quick reference for the NL-43/NL-53 Communication Guide (No. 66132, pages ~1–97). Use the official PDF for authoritative details, exact formatting, and option requirements. + +## Protocol Basics +- ASCII commands terminated with `CR LF`. +- Setting: `$Command,Param[CR][LF]`; Request: `Command?[CR][LF]`. +- Wait for `$` prompt/idle before the next command; recommended ≥1 s between commands. +- Result codes: `R+0000` success; `0001` command error; `0002` parameter error; `0003` spec/type error; `0004` status error (wrong state). +- Control codes: `CR`=0x0D, `LF`=0x0A, `SUB`=0x1A (stop DRD stream). +- Timing: responds within ~3 s; characters ≤100 ms apart; DRD streams until `SUB`. + +## Transport Modes +- USB CDC: Serial over USB (mutually exclusive with LAN TCP/FTP/web/I/O port comm). +- RS-232C: 9600–115200 bps; DRD streaming needs ≥19200 (EX) or ≥57600 (RT). +- LAN (NX-43EX): TCP control, FTP, web app (ports 80 & 8000). TCP/FTP/Web are mutually exclusive with each other and with USB comm while active. + +## Quick Startup Checklist (TCP control) +1) Install NX-43EX; on device: Ethernet On; DHCP On or set IP/Subnet/Gateway; `TCP, On`; ensure USB comm + web app + I/O port comm are Off. +2) Ensure reachability to device IP:TCP port (default 80). +3) `Clock,` to sync time. +4) Configure mode/intervals, then `Measure, Start`. +5) Poll `DOD?` (≥1 s) or stream `DRD?status`; stop with `SUB`. +6) Toggle `FTP, On` only when pulling SD files; then back to `TCP, On`. + +## LAN / USB / Web / FTP (NX-43EX) +| Command | Purpose | Type | Notes / Params | +| --- | --- | --- | --- | +| Ethernet | LAN on/off | S/R | `Ethernet, On|Off` (p84) | +| Ethernet DHCP | DHCP on/off | S/R | `Ethernet DHCP, On|Off` (p84) | +| Ethernet IP | Set IP | S/R | `Ethernet IP, a.b.c.d` (p84) | +| Ethernet Subnet | Set subnet | S/R | `Ethernet Subnet, a.b.c.d` (p84) | +| Ethernet Gateway | Set gateway | S/R | `Ethernet Gateway, a.b.c.d` (p85) | +| TCP | TCP control | S/R | `TCP, On|Off` (p86); stops if USB comm/web/I/O port comm enabled | +| FTP | FTP transfer | S/R | `FTP, On|Off` (p85); stops if USB mass storage/web enabled | +| Web | Web app | S/R | `Web, On|Off` (p85); uses ports 80/8000; disables Timer Auto, Trigger Mode, Delay Time, I/O port comm, USB, LAN TCP/FTP while active | +| USB Class | USB comm/mass storage | S/R | `USB Class, Off|CDC|CDC/MSC` (p83); CDC/MSC blocks LAN TCP/FTP | + +## Data Output Commands (fields) +- **DOD?**: Snapshot; main/sub channel Lp, Leq, LE, Lmax, Lmin, LN1–LN5, Lpeak, LIeq, Leq,mov, Ltm5, over/under flags. RT variant may include band/POA data; wait ≥1 s between requests. +- **DRD?**: Continuous every 100 ms; counter + main/sub Lp/Leq/Lmax/Lmin/Lpeak/LIeq + over/under. Stop with `SUB` (0x1A). Baud constraints on RS-232C only. +- **DRD?status**: DRD payload + timestamp, power source (I/E/U), battery level (F/M/L/D/E), SD remaining MB, measurement state (M/S). +- **DLC?**: Final calculation set (similar to DOD); RT variant includes band data + over/under flags. + +## Condensed Command List (Section 5.6) +| Command | Function | Type | Notes / Page | +| --- | --- | --- | --- | +| Communication Echo | Echo on/off | S/R | p39 | +| System Version | Version info | R | p39 | +| Type | Model type | R | p39 | +| Serial Number | Serial number | R | p39 | +| Clock | Current time | S/R | p40 | +| Language | Display language | S/R | p40 | +| Index Number | Index | S/R | p40 | +| Key Lock | Key lock | S/R | p41 | +| Backlight | Backlight status | S/R | p41 | +| Backlight Auto Off | Auto off | S/R | p41 | +| LCD | LCD status | S/R | p41 | +| LCD Auto Off | Auto off | S/R | p42 | +| Backlight Brightness | Brightness | S/R | p42 | +| Battery Type | Battery type | S/R | p42 | +| Battery Level | Battery level | S/R | p43 | +| SD Card Total Size | SD total | R | p43 | +| SD Card Free Size | SD free | R | p43 | +| SD Card Percentage | SD free % | R | p43 | +| Output Level Range Upper | Bar upper | S/R | p44 | +| Output Level Range Lower | Bar lower | S/R | p44 | +| Display Leq / LE / Lpeak / Lmax / Lmin | Display flags | S/R | p44–45 | +| Display LN1–LN5 | Percentiles display | S/R | p45–46 | +| Display LIeq / Ltm5 / Leqmov | Display flags | S/R | p47 | +| Time Level Time Scale | Time-level scale | S/R | p47 | +| Display Calculate Type (RT) | Calc type | S/R | p48 | +| Measure Display Sub Channel 1–3 | Sub displays | S/R | p49 | +| Octave Mode (RT) | Analysis mode | S/R | p49 | +| Additional Band (RT) | Sub band | S/R | p49 | +| Display Partial Over All (RT) | POA on/off | S/R | p50 | +| Upper/Lower Limit Frequency (+Offset) (RT) | POA bands | S/R | p50–52 | +| Lmax Type / Channel | Lmax/Lmin settings | S/R | p52 | +| Frequency Weighting (Main/Sub1–3) | Weighting | S/R | p53 | +| Frequency Weighting (Band) (RT) | Band weighting | S/R | p53 | +| Time Weighting (Main/Sub1–3) | Time weighting | S/R | p54 | +| Time Weighting (Band/Band2) (RT) | Band time weighting | S/R | p55 | +| Windscreen / Diffuse Correction | Corrections | S/R | p55–56 | +| Ldiff1/Ldiff2 (+Channel/Calc) (RT) | Differential | S/R | p56–57 | +| Store Mode / Name / Manual Address | Storage setup | S/R | p58 | +| Measure | Start/Stop measure | S/R | p58 | +| Pause | Pause | S/R | p59 | +| Manual Store | Manual store | S | p59 | +| Overwrite | Overwrite check | S/R | p59 | +| Measurement Time Preset Manual / Manual (Num/Unit) | Manual timing | S/R | p60 | +| Measurement Time Preset Auto / Auto (Num/Unit) (EX) | Auto timing | S/R | p61 | +| Lp Store Interval | Lp interval | S/R | p62 | +| Leq Calculation Interval Preset / Num / Unit | Leq interval | S/R | p62–63 | +| Store Delay Time | Delay | S/R | p63 | +| Back Erase | Back erase | S/R | p63 | +| Timer Auto Start/Stop Time | Timer | S/R | p64 | +| Timer Auto Interval (EX) | Timer interval | S/R | p65 | +| Sleep Mode | Sleep | S/R | p65 | +| Trigger Mode | Trigger | S/R | p65 | +| Level Trigger Channel (EX) | Trigger channel | S/R | p66 | +| Level Trigger Band Freq/Offset (RT) | Band trigger | S/R | p66–67 | +| Level Trigger Level (EX) | Trigger level | S/R | p67 | +| Moving Leq Interval Preset / Num / Unit | Moving Leq | S/R | p67–68 | +| TRM | LN mode sampling | S/R | p68 | +| Percentile 1–5 | LN percentiles | S/R | p69 | +| Lp Mode (RT) | Lp type | S/R | p69 | +| Wave Rec Mode / Sampling Freq / Bit Length (WR) | Waveform | S/R | p70 | +| Frequency Weighting (Wave) | Wave weighting | S/R | p71 | +| Wave Rec Range Upper / State | Wave status | S/R | p71 | +| Wave Splitting Interval | Split interval | S/R | p72 | +| Wave Manual Rec / Pre-time | Manual rec | S/R | p72 | +| Wave Level Rec / Trigger Channel (WR/RT) | Level rec | S/R | p73 | +| Wave Level Trigger Band Freq/Offset (RT) | Band trigger | S/R | p73–74 | +| Wave Level Trigger Level / Pre-time / Max Time | Thresholds | S/R | p74–75 | +| Wave Level Reference Time/Level (1–4) | Time-zone thresholds | S/R | p75–76 | +| Wave Interval Rec (Interval/Time) | Interval rec | S/R | p76–77 | +| I/O AC OUT | AC output | S/R | p78 | +| AC Out Band Freq/Offset (RT) | AC band | S/R | p78–79 | +| I/O DC OUT | DC output | S/R | p79 | +| DC Out Band Freq/Offset (RT) | DC band | S/R | p80 | +| Output Range Upper | Electrical full scale | S/R | p81 | +| Reference Signal Output | Reference signal | S/R | p81 | +| IO Func | IO port | S/R | p81 | +| Baud Rate | RS-232C baud | S/R | p82 | +| Comparator Channel | Comparator channel | S/R | p82 | +| Comparator Band Freq/Offset (RT) | Comparator band | S/R | p82–83 | +| Comparator Level (EX) | Comparator level | S/R | p83 | +| USB Class | USB comm | S/R | p83 | +| Ethernet / DHCP / IP / Subnet / Gateway (EX) | LAN config | S/R | p84–85 | +| Web (EX) | Web app | S/R | p85 | +| FTP (EX) | FTP | S/R | p85 | +| TCP (EX) | TCP control | S/R | p86 | +| DOD / DOD (RT) | Output displayed value | R | p88–89 | +| DRD / DRD (RT) | Continuous output | R | p90–91 | +| DRD?status / DRD?status (RT) | Continuous + status | R | p92–93 | +| DLC / DLC (RT) | Final calculation output | R | p94–95 | + +## Full Command Catalog (pages ~30–95) +All commands from section 5.6 listed with purpose. Types: S=Setting, R=Request. Options: (EX)=NX-43EX, (RT)=NX-43RT, (WR)=NX-43WR. + +Communication / System +- Communication Echo (S/R): Echo sent command strings (p39) +- System Version (R): Version info (p39) +- Type (R): Type info (p39) +- Serial Number (R): Serial number (p39) +- Clock (S/R): Current time (p40) +- Language (S/R): Display language (p40) +- Index Number (S/R): Index (p40) + +UI / Power / Storage Stats +- Key Lock (S/R): Key lock (p41) +- Backlight (S/R): Backlight status (p41) +- Backlight Auto Off (S/R): Auto off (p41) +- LCD (S/R): LCD status (p41) +- LCD Auto Off (S/R): Auto off (p42) +- Backlight Brightness (S/R): Brightness (p42) +- Battery Type (S/R): Battery type (p42) +- Battery Level (S/R): Battery level (p43) +- SD Card Total Size (R): SD total (p43) +- SD Card Free Size (R): SD free (p43) +- SD Card Percentage (R): SD free % (p43) + +Display/Measure Flags +- Output Level Range Upper/Lower (S/R): Bar graph ranges (p44) +- Display Leq/LE/Lpeak/Lmax/Lmin (S/R): Flags (p44–45) +- Display LN1–LN5 (S/R): Percentiles (p45–46) +- Display LIeq/Ltm5/Leqmov (S/R): Flags (p47) +- Time Level Time Scale (S/R): Time-level scale (p47) +- Display Calculate Type (RT, S/R): Calc type (p48) +- Measure Display Sub Channel 1–3 (S/R): Sub displays (p49) + +Analysis / Bands (RT) +- Octave Mode (S/R): Analysis mode (p49) +- Additional Band (S/R): Sub band (p49) +- Display Partial Over All (S/R): POA (p50) +- Upper/Lower Limit Frequency (+Offset) (S/R): POA bands (p50–52) +- Lmax Type / Channel (S/R): Lmax/Lmin settings (p52) + +Weighting / Corrections +- Frequency Weighting (Main/Sub1–3) (EX, S/R): Weighting (p53) +- Frequency Weighting (Band) (RT, S/R): Band weighting (p53) +- Time Weighting (Main/Sub1–3) (S/R): Time weighting (p54) +- Time Weighting (Band/Band2) (RT, S/R): Band time weighting (p55) +- Windscreen Correction (S/R): Windscreen correction (p55) +- Diffuse Sound Field Correction (S/R): Diffuse correction (p56) + +Differential (RT) +- Ldiff1/Ldiff2 (S/R): Measure differential (p56) +- Ldiff1/2 Channel1/2 (S/R): Differential channel (p56) +- Ldiff1/2 Calculation1/2 (S/R): Differential calc (p57) + +Store / Measurement Control +- Store Mode (S/R): Manual/Auto (p58) +- Store Name (S/R): Storage name (p58) +- Manual Address (S/R): Manual storage address (p58) +- Measure (S/R): Start/Stop measure (p58) +- Pause (S/R): Pause (p59) +- Manual Store (S): Manual store (p59) +- Overwrite (S/R): Overwrite check (p59) +- Measurement Time Preset Manual / Manual (Num/Unit) (S/R): Manual timing (p60) +- Measurement Time Preset Auto / Auto (Num/Unit) (EX, S/R): Auto timing (p61) +- Lp Store Interval (S/R): Lp interval (p62) +- Leq Calculation Interval Preset / Num / Unit (S/R): Leq interval (p62–63) +- Store Delay Time (S/R): Delay (p63) +- Back Erase (S/R): Back erase (p63) +- Timer Auto Start/Stop Time (S/R): Timer (p64) +- Timer Auto Interval (EX, S/R): Auto interval (p65) +- Sleep Mode (S/R): Sleep (p65) +- Trigger Mode (S/R): Trigger (p65) +- Level Trigger Channel (EX, S/R): Trigger channel (p66) +- Level Trigger Band Frequency/Offset (RT, S/R): Band trigger (p66–67) +- Level Trigger Level (EX, S/R): Trigger level (p67) +- Moving Leq Interval Preset / Num / Unit (S/R): Moving Leq (p67–68) +- TRM (S/R): LN mode sampling (p68) +- Percentile 1–5 (S/R): LN percentiles (p69) +- Lp Mode (RT, S/R): Lp type (p69) + +Waveform Recording (WR/RT) +- Wave Rec Mode / Sampling Frequency / Bit Length (S/R): Recording config (p70) +- Frequency Weighting (Wave) (S/R): Wave weighting (p71) +- Wave Rec Range Upper / State (S/R): Rec range/status (p71) +- Wave Splitting Interval (S/R): File split interval (p72) +- Wave Manual Rec / Pre-time (S/R): Manual rec (p72) +- Wave Level Rec / Trigger Channel (WR/RT, S/R): Level rec (p73) +- Wave Level Trigger Band Frequency/Offset (RT, S/R): Band trigger (p73–74) +- Wave Level Trigger Level / Pre-time / Maximum Recording Time (S/R): Thresholds/time (p74–75) +- Wave Level Reference Time Interval 1–4 (S/R): Time-zone intervals (p75) +- Wave Level Reference Time 1–4 (S/R): Time-zone time (p75) +- Wave Level Reference Time 1–4 Level (S/R): Time-zone level (p75–76) +- Wave Interval Rec Interval / Time (S/R): Interval rec (p76–77) + +I/O and Outputs +- I/O AC OUT (S/R): AC output (p78) +- AC Out Band Frequency/Offset (RT, S/R): AC band (p78–79) +- I/O DC OUT (S/R): DC output (p79) +- DC Out Band Frequency/Offset (RT, S/R): DC band (p80) +- Output Range Upper (S/R): Electrical full scale (p81) +- Reference Signal Output (S/R): Reference signal (p81) +- IO Func (S/R): IO port (p81) + +Comparator / Comms +- Baud Rate (S/R): RS-232C baud (p82) +- Comparator Channel (S/R): Comparator channel (p82) +- Comparator Band Frequency/Offset (RT, S/R): Comparator band (p82–83) +- Comparator Level (EX, S/R): Comparator level (p83) +- USB Class (S/R): USB comm/mass storage (p83) +- Ethernet/DHCP/IP/Subnet/Gateway (EX, S/R): LAN config (p84–85) +- Web (EX, S/R): Web app (p85) +- FTP (EX, S/R): FTP (p85) +- TCP (EX, S/R): TCP control (p86) + +Data Output (fields) +- DOD / DOD (RT) (R): Snapshot of displayed values; includes Lp/Leq/LE/Lmax/Lmin/LN1–LN5/Lpeak/LIeq/Leq,mov/Ltm5/over-under (p88–89). +- DRD / DRD (RT) (R): Continuous every 100 ms; counter + Lp/Leq/Lmax/Lmin/Lpeak/LIeq + over/under (p90–91). Stop with `SUB`. +- DRD?status / DRD?status (RT) (R): DRD + timestamp, power source, battery level, SD remaining MB, measurement state (p92–93). +- DLC / DLC (RT) (R): Final calculation result set (similar to DOD; RT includes band data) (p94–95). diff --git a/COMMUNICATION_GUIDE_SUMMARY.md b/COMMUNICATION_GUIDE_SUMMARY.md deleted file mode 100644 index 5fff727..0000000 --- a/COMMUNICATION_GUIDE_SUMMARY.md +++ /dev/null @@ -1,81 +0,0 @@ -# NL-43 / NL-53 Communication Guide (Concise Summary) - -This is a terse operator/dev summary of the official “NL-43/NL-53 Communication Guide” (No. 66132, 97 pages). Use the PDF for authoritative details. - -## Transport Modes -- **USB CDC**: Serial over USB. Mutually exclusive with LAN TCP/FTP/web/I/O port comm. No driver needed on Win10/11. -- **LAN (NX-43EX required)**: TCP control, FTP for file transfer, and optional web app (ports 80 and 8000). LAN TCP/FTP/web/USB comm are mutually exclusive—turning one on can disable the others. -- **RS-232C**: Classic serial. Baud 9600–115200; DRD streaming requires ≥19200 (EX) or ≥57600 (RT). - -## Command Protocol -- ASCII text; end every command with `CR LF`. -- Two types: - - **Setting**: `$Command,Param[CR][LF]` - - **Request**: `Command?[CR][LF]` -- Wait for the leading `$` prompt/idle before sending the next command; guide recommends ≥1 s between commands. -- Result codes: `R+0000` success; `0001` command error; `0002` parameter error; `0003` spec/type error; `0004` status error (wrong device state). -- Control codes: `CR`=0x0D, `LF`=0x0A, `SUB`=0x1A (stop DRD stream). - -## Core Commands (common) -- **Clock**: `Clock, YYYY/MM/DD hh:mm:ss` | `Clock?` -- **Start/Stop**: `Measure, Start` | `Measure, Stop` -- **Store mode**: `Store Mode, Manual|Auto` (many related time/interval setters in Store section) -- **Manual store**: `Manual Store, Start` -- **Battery/SD**: `Battery Level?`, `SD Card Total Size?`, `SD Card Free Size?`, `SD Card Percentage?` -- **Display/Measure params**: numerous `Display ...` and `Measure ...` setters/getters (frequency/time weighting, ranges, etc.). - -## LAN / Ethernet (NX-43EX) -- `Ethernet, On|Off` — enable LAN. -- `Ethernet DHCP, On|Off` — address assignment. -- `Ethernet IP|Subnet|Gateway, ` — static settings. -- `TCP, On|Off` — TCP control channel. TCP stops if USB comm, web app, or I/O port comm is turned on. -- `FTP, On|Off` — file transfer mode (mutually exclusive with TCP/web/USB comm when active). -- `Web, On|Off` — built-in web app (ports 80 and 8000). Disables Timer Auto, Trigger Mode, Delay Time, USB comm, LAN TCP, LAN FTP while in use. - -## Data Outputs -- **DOD?** — Snapshot of displayed values (Lp/Leq/LE/Lmax/Lmin/LN1–LN5/Lpeak/LIeq/Leq,mov/Ltm5 + over/under flags) for up to 4 channels. Leave ≥1 s between requests. -- **DLC?** — Final calculation result set (similar fields as DOD) for last measurement/interval. -- **DRD?** — Continuous output every 100 ms; stop by sending `SUB` (0x1A). Main/Sub1–Sub3 Lp/Leq/Lmax/Lmin/Lpeak/LIeq + over/under flags. -- **DRD?status** — Same as DRD plus timestamp, power source (I/E/U), battery level (F/M/L/D/E), SD remaining MB, measurement state (M/S). -- Optional NX-43RT variants include octave/1⁄3 octave band data appended. - -## Examples (from guide) -- Basic setup for Auto store: - - `Frequency Weighting, A` - - `Time Weighting, F` - - `Store Mode, Auto` - - `Store Name, 0100` - - `Measurement Time Preset Auto, 10m` - - `Lp Store Interval, 100ms` - - `Leq Calculation Interval Preset, 1m` - - Start/stop: `Measure, Start` / `Measure, Stop` - - Read values: `DOD?` -- Manual store: - - `Store Mode, Manual` - - `Store Name, 0200` - - `Measurement Time Preset Manual, 15m` - - Start/stop: `Measure, Start` / `Measure, Stop` - - Save: `Manual Store, Start` - - Read values: `DOD?` - -## Timing/Behavior Constraints -- Device responds within ~3 s; if busy, may return `R+0004`. -- Time between sent characters: ≤100 ms. -- After sending a command, wait for `$` prompt/idle before the next; recommended 1 s. -- DRD streaming continues until `SUB` (0x1A) is received. - -## Web App (NX-43EX) -- Ports 80 and 8000; login required. Disables Timer Auto, Trigger Mode, Delay Time, I/O port comm, USB comm, LAN TCP, and LAN FTP while active. - -## Optional Programs -- **NX-43EX**: LAN TCP/FTP/web, DRD/DRD?status (EX flavor). -- **NX-43RT**: Octave/1⁄3 octave features; DRD/DRD?status/DOD/DLC include band data; higher baud needed for RS-232C streaming. -- **NX-43WR**: Waveform recording (noted in guide; specific settings in Operation Guide). - -## Quick Startup Checklist (for TCP control) -1) Install NX-43EX; on device: Ethernet On, set IP/subnet/gateway/DHCP; `TCP, On`; ensure USB comm + web app + I/O port comm are Off. -2) On controlling host/RX55: ensure port-forward/VPN to NL43 IP:TCP port (default 80). -3) Send `Clock,` to sync time. -4) Configure mode/intervals, then `Measure, Start`. -5) Poll `DOD?` for snapshots (≥1 s), or `DRD?status` for live stream; stop stream with `SUB`. -6) Switch to `FTP, On` only when pulling SD files; then back to `TCP, On` for control. diff --git a/IMPROVEMENTS.md b/IMPROVEMENTS.md index faf64a9..81cd565 100644 --- a/IMPROVEMENTS.md +++ b/IMPROVEMENTS.md @@ -24,16 +24,28 @@ The original code generated by Codex was functional and well-structured, but lac ### 2. Response Validation & Error Handling ([services.py](app/services.py)) -**Issue**: DOD response parsing had no validation and silently failed on malformed data. +**Issue**: DOD response parsing had no validation and silently failed on malformed data. Additionally, the code only read the first line (result code) and didn't read the second line containing actual data. Start/Stop commands had incorrect syntax with spaces after commas. **Fix**: +- Implemented proper two-line protocol handling: + - Line 1: Result code (R+0000 for success, or error codes 0001-0004) + - Line 2: Actual data (for query commands ending with `?`) +- Parse and validate result codes with specific error messages: + - R+0001: Command error + - R+0002: Parameter error + - R+0003: Spec/type error + - R+0004: Status error +- Fixed command syntax to match NL43 protocol: + - Setting commands: `$Command,Param` (NO space after comma) + - Changed `$Measure, Start` to `$Measure,Start` + - Changed `$Measure, Stop` to `$Measure,Stop` - Validate response is not empty - Check minimum field count (at least 2 data points) - Remove leading `$` prompt if present - Proper exception handling with logging - Raise `ValueError` for invalid responses -**Impact**: Better debugging and prevents silent failures. +**Impact**: Now correctly receives and parses actual measurement data instead of just the success code. Start/Stop commands now work correctly. Better debugging and prevents silent failures. ### 3. TCP Enabled Check ([routers.py](app/routers.py)) diff --git a/NL43_COMMANDS.md b/NL43_COMMANDS.md new file mode 100644 index 0000000..a39d6a0 --- /dev/null +++ b/NL43_COMMANDS.md @@ -0,0 +1,244 @@ +5.6 List of commands +S: Setting command (for making the unit settings) +R: Request command (for obtaining information on the unit status and measurement results) +Commands Function See page +Communication Echo Communication echo (S/R) 39 +System System Version Version information (R) 39 +Type Type information (R) 39 +Serial Number Serial number (R) 39 +Clock Current time (S/R) 40 +Language Display language (S/R) 40 +Index Number Index (S/R) 40 +Key Lock Key lock (S/R) 41 +Backlight Backlight status (S/R) 41 +Backlight Auto Off Backlight auto off (S/R) 41 +LCD LCD status (S/R) 41 +LCD Auto Off LCD auto off (S/R) 42 +Backlight Brightness Backlight brightness (S/R) 42 +Battery Type Battery type (S/R) 42 +Battery Level Battery level (S/R) 43 +SD Card Total Size Total SD card capacity (R) 43 +SD Card Free Size SD card free space (R) 43 +SD Card Percentage SD card free space ratio (R) 43 +Display Output Level Range Upper Bar graph upper range (S/R) 44 +Output Level Range Lower Bar graph lower range (S/R) 44 +Display Leq Leq display (S/R) 44 +Display LE LE display (S/R) 44 +Display Lpeak Lpeak display (S/R) 45 +Display Lmax Lmax display (S/R) 45 +Display Lmin Lmin display (S/R) 45 +Display LN1 L5 display (S/R) 45 +Display LN2 L10 display (S/R) 46 +Display LN3 L50 display (S/R) 46 +Display LN4 L90 display (S/R) 46 +Display LN5 L95 display (S/R) 46 +Display LIeq LIeq display (S/R) 47 +Display Ltm5 Ltm5 display (S/R) 47 +Display Leqmov Leq,mov display (S/R) 47 +Time Level Time Scale Time-Level time scale (S/R) 47 +Display +(NX-43RT) Display Calculate Type Display calculate type (S/R) 48 +Measure Display Sub Channel 1 +Display Sub Channel 2 +Display Sub Channel 3 +Sub channels (S/R) 49 +34 +Commands +Commands Function See page +Measure +(NX-43RT) +Octave Mode Analysis mode (S/R) 49 +Additional Band Sub band (S/R) 49 +Display Partial Over All Partial overall (POA) (S/R) 50 +Upper Limit Frequency Upper frequency of POA (S/R) 50 +Upper Limit Frequency Offset Upper frequency offset of POA (S/R) 51 +Lower Limit Frequency Lower frequency of POA (S/R) 51 +Lower Limit Frequency Offset Lower frequency offset of POA (S/R) 52 +Lmax Type Lmax/Lmin type (S/R) 52 +Lmax Type Channel Lmax/Lmin channel (S/R) 52 +Measure +(NX-43EX) +Frequency Weighting +Frequency Weighting (Main) Main frequency weighting (S/R) 53 +Frequency Weighting (Sub1) +Frequency Weighting (Sub2) +Frequency Weighting (Sub3) +Sub frequency weighting (S/R) 53 +Measure +(NX-43RT) Frequency Weighting (Band) Frequency weighting band (S/R) 53 +Measure Time Weighting +Time Weighting (Main) Main time weighting (S/R) 54 +Time Weighting (Sub1) +Time Weighting (Sub2) +Time Weighting (Sub3) +Sub time weighting (S/R) 54 +Measure +(NX-43RT) +Time Weighting (Band) Time weighting band (S/R) 55 +Time Weighting (Band2) Time weighting sub band (S/R) 55 +Measure Windscreen Correction Windscreen correction (S/R) 55 +Diffuse Sound Field Correction Diffuse sound field correction (S/R) 56 +Measure +(NX-43RT) +Ldiff1 +Ldiff2 Measure differential (S/R) 56 +Ldiff1 Channel1 +Ldiff1 Channel2 +Ldiff2 Channel1 +Ldiff2 Channel2 +Measure differential, channel (S/R) 56 +Ldiff1 Calculation1 +Ldiff1 Calculation2 +Ldiff2 Calculation1 +Ldiff2 Calculation2 +Measure differential, calculation (S/R) 57 +Store Store Mode Store mode (S/R) 58 +Store Name Storage name (S/R) 58 +Manual Address Manual storage address (S/R) 58 +Measure Measure (S/R) 58 +Pause Pause (S/R) 59 +Manual Store Manual storage (S) 59 +Overwrite Storage overwriting check (S/R) 59 +Measurement Time Preset Manual Manual storage measurement time (S/R) 60 +Measurement Time Manual (Num) Manual storage measurement time (user setting: time) +(S/R) 60 +Measurement Time Manual (Unit) Manual storage measurement time (user setting: unit) +(S/R) 60 +35 +Commands +Commands Function See page +Store +(NX-43EX) +Measurement Time Preset Auto Auto storage total measurement time (S/R) 61 +Measurement Time Auto (Num) Auto storage total measurement time (user setting: +time) (S/R) 61 +Measurement Time Auto (Unit) Auto storage total measurement time (user setting: +unit) (S/R) 61 +Lp Store Interval Lp store interval (S/R) 62 +Leq Calculation Interval Preset Leq calculation interval (S/R) 62 +Leq Calculation Interval (Num) Leq calculation interval (user setting: time) (S/R) 62 +Leq Calculation Interval (Unit) Leq calculation interval (user setting: unit) (S/R) 63 +Store Delay Time Delay measurement (S/R) 63 +Back Erase Back erase (S/R) 63 +Timer Auto Start Time Timer auto start time (S/R) 64 +Timer Auto Stop Time Timer auto stop time (S/R) 64 +Store +(NX-43EX) +Timer Auto Interval Timer auto measurement interval (S/R) 65 +Sleep Mode Sleep mode (S/R) 65 +Trigger Mode Trigger mode (S/R) 65 +Level Trigger Channel Level trigger channel (trigger mode) (S/R) 66 +Store +(NX-43RT) +Level Trigger Band Frequency Level trigger band frequency (trigger mode) (S/R) 66 +Level Trigger Band Offset Level trigger band frequency offset (trigger mode) (S/R) 67 +Store +(NX-43EX) +Level Trigger Level Trigger level (trigger mode) (S/R) 67 +Moving Leq Interval Preset Moving Leq interval (S/R) 67 +Moving Leq Interval (Num) Moving Leq interval (user setting: time) (S/R) 68 +Moving Leq Interval (Unit) Moving Leq interval (user setting: unit) (S/R) 68 +TRM LN mode, sampling data (S/R) 68 +Percentile 1 +Percentile 2 +Percentile 3 +Percentile 4 +Percentile 5 +LN mode, percentile (S/R) 69 +Store +(NX-43RT) Lp Mode Lp type (S/R) 69 +Waveform recording +(NX-43WR) +Wave Rec Mode Recording function (S/R) 70 +Wave Sampling Frequency Sampling frequency (S/R) 70 +Wave Bit Length Bit length (S/R) 70 +Frequency Weighting (Wave) Frequency weighting (waveform recording) (S/R) 71 +Wave Rec Range Upper Recording level range (S/R) 71 +Wave Rec State Recording status (S/R) 71 +Wave Splitting Interval File splitting interval (S/R) 72 +Wave Manual Rec Manual recording (S/R) 72 +Wave Manual Pre-time Manual recording pre-time (S/R) 72 +Wave Level Rec Level recording (S/R) 73 +Wave Level Trigger Channel Trigger channels (level recording) (S/R) 73 +Waveform recording +(NX-43RT) +Wave Level Trigger Band Frequency Trigger band frequency (level recording) (S/R) 73 +Wave Level Trigger Band Offset Trigger band frequency offset (level recording) (S/R) 74 +36 +Commands +Commands Function See page +Waveform recording +(NX-43WR) +Wave Level Trigger Level Start level (level recording) (S/R) 74 +Wave Level Pre-time Pre-time (level recording) (S/R) 74 +Wave Level Maximum Recording Time Maximum recording time (S/R) 75 +Wave Level Reference Time Interval 1 +Wave Level Reference Time Interval 2 +Wave Level Reference Time Interval 3 +Wave Level Reference Time Interval 4 +Threshold per time zone (S/R) 75 +Wave Level Reference Time 1 +Wave Level Reference Time 2 +Wave Level Reference Time 3 +Wave Level Reference Time 4 +Threshold per time zone time (S/R) 75 +Wave Level Reference Time 1 Level +Wave Level Reference Time 2 Level +Wave Level Reference Time 3 Level +Wave Level Reference Time 4 Level +Threshold per time zone level (S/R) 76 +Wave Interval Rec Interval recording (S/R) 76 +Wave Interval Rec Interval Interval recording_Recording interval (S/R) 76 +Wave Interval Rec Time Interval recording_Recording time (S/R) 77 +I/O AC OUT AC output (S/R) 78 +I/O +(NX-43RT) +AC Out Band Frequency AC output band frequency (S/R) 78 +AC Out Band Offset AC output band frequency offset (S/R) 79 +I/O DC OUT DC output (S/R) 79 +I/O +(NX-43RT) +DC Out Band Frequency DC output band frequency (S/R) 80 +DC Out Band Offset DC output band frequency offset (S/R) 80 +I/O Output Range Upper Electrical output full scale (S/R) 81 +Reference Signal Output Reference signal output (S/R) 81 +IO Func IO port (S/R) 81 +Baud Rate RS-232C communication speed (S/R) 82 +Comparator Channel Comparator channel (S/R) 82 +I/O +(NX-43RT) +Comparator Band Frequency Comparator band frequency (S/R) 82 +Comparator Band Offset Comparator band frequency offset (S/R) 83 +I/O Comparator Level Comparator level (S/R) 83 +USB Class USB communication (S/R) 83 +I/O +(NX-43EX) +Ethernet LAN function (S/R) 84 +Ethernet DHCP IP address automatic setting (S/R) 84 +Ethernet IP IP address (S/R) 84 +Ethernet Subnet Subnet mask (S/R) 84 +Ethernet Gateway Default gateway (S/R) 85 +Web Web app (S/R) 85 +FTP File transfer (FTP) (S/R) 85 +TCP Communication control (TCP) (S/R) 86 +Data output DOD Output displayed value (R) 88 +Data output +(NX-43RT) DOD Output displayed value (R) 89 +Data output +(NX-43EX) +DRD Continuous output (R) 90 +37 +Commands +Commands Function See page +Data output +(NX-43RT) +DRD Continuous output (R) 91 +Data output +(NX-43EX) +DRD?status Continuous output (attaching status information) (R) 92 +Data output +(NX-43RT) +DRD?status Continuous output (attaching status information) (R) 93 +Data output DLC Final calculation result output (R) 94 +Data output +(NX-43RT) DLC Final calculation result output (R) 95 \ No newline at end of file diff --git a/NL43_quickref.md b/NL43_quickref.md new file mode 100644 index 0000000..db6cdef --- /dev/null +++ b/NL43_quickref.md @@ -0,0 +1,71 @@ + +# ✅ NL-43 / NL-53 Command Format — Verified Quick Reference + +This cheat sheet lists confirmed working command formats for NL-43 and NL-53 devices, based on the official Rion Communication Guide (pages 30–96). + +--- + +## 🧠 Protocol Basics + +- **Command format:** `Command,Param[CR][LF]` — no space after comma. +- **Query format:** `Command?[CR][LF]` +- **Line endings:** CR = `\r` (0x0D), LF = `\n` (0x0A), always use both. +- **No `$` prefix** unless specifically required (e.g. system control). + +--- + +## ✅ Confirmed Commands + +### 📏 Start/Stop Measurement +| Action | Command Sent | +|--------------|---------------------------| +| Start | `Measure,Start\r\n` | +| Stop | `Measure,Stop\r\n` | + +> **Important:** These must be exact — no space after comma, param is a capitalized string. + +--- + +### 🕒 Set/Query Clock +| Action | Command Sent | +|--------------|---------------------------------------------| +| Set Time | `Clock,2025,12,23 23:45:00\r\n` | +| Query Time | `Clock?\r\n` | + +--- + +### 📈 One-Shot Readout (DOD) +| Action | Command Sent | +|--------------|--------------| +| Get Snapshot | `DOD?\r\n` | + +Returns: comma-separated line with values like `R+70.2,91.1,88.0,...` + +--- + +### 🔁 Streaming Output (DRD) +| Action | Command Sent | +|--------------------|--------------| +| Start DRD Output | `DRD?\r\n` | +| Stop DRD Output | `\x1A` (SUB)| + +--- + +### 🔧 Echo On/Off +| Action | Command Sent | +|------------|---------------| +| Enable | `Echo,On\r\n` | +| Disable | `Echo,Off\r\n` | +| Query | `Echo?\r\n` | + +--- + +## ⚠️ Common Mistakes to Avoid +- ❌ Don’t include a space after comma: `Measure, Start` → invalid. +- ❌ Don’t use numeric params if the spec requires strings. +- ❌ Don’t forget `\r\n` line ending — most commands won’t work without it. +- ❌ Don’t send multiple commands at once — insert 1s delay between. + +--- + +This file is safe for ingestion by agents or UI generators. diff --git a/app/__pycache__/services.cpython-310.pyc b/app/__pycache__/services.cpython-310.pyc index 70fdfe3..b156234 100644 Binary files a/app/__pycache__/services.cpython-310.pyc and b/app/__pycache__/services.cpython-310.pyc differ diff --git a/app/services.py b/app/services.py index 3f32169..10b738c 100644 --- a/app/services.py +++ b/app/services.py @@ -87,7 +87,12 @@ class NL43Client: _last_command_time[self.device_key] = time.time() async def _send_command(self, cmd: str) -> str: - """Send ASCII command to NL43 device via TCP.""" + """Send ASCII command to NL43 device via TCP. + + NL43 protocol returns two lines for query commands: + Line 1: Result code (R+0000 for success, error codes otherwise) + Line 2: Actual data (for query commands ending with '?') + """ await self._enforce_rate_limit() logger.info(f"Sending command to {self.device_key}: {cmd.strip()}") @@ -106,10 +111,40 @@ class NL43Client: try: writer.write(cmd.encode("ascii")) await writer.drain() - data = await asyncio.wait_for(reader.readuntil(b"\n"), timeout=self.timeout) - response = data.decode(errors="ignore").strip() - logger.debug(f"Received response from {self.device_key}: {response}") - return response + + # Read first line (result code) + first_line_data = await asyncio.wait_for(reader.readuntil(b"\n"), timeout=self.timeout) + result_code = first_line_data.decode(errors="ignore").strip() + + # Remove leading $ prompt if present + if result_code.startswith("$"): + result_code = result_code[1:].strip() + + logger.debug(f"Result code from {self.device_key}: {result_code}") + + # Check result code + if result_code == "R+0000": + # Success - for query commands, read the second line with actual data + is_query = cmd.strip().endswith("?") + if is_query: + data_line = await asyncio.wait_for(reader.readuntil(b"\n"), timeout=self.timeout) + response = data_line.decode(errors="ignore").strip() + logger.debug(f"Data line from {self.device_key}: {response}") + return response + else: + # Setting command - return success code + return result_code + elif result_code == "R+0001": + raise ValueError("Command error - device did not recognize command") + elif result_code == "R+0002": + raise ValueError("Parameter error - invalid parameter value") + elif result_code == "R+0003": + raise ValueError("Spec/type error - command not supported by this device model") + elif result_code == "R+0004": + raise ValueError("Status error - device is in wrong state for this command") + else: + raise ValueError(f"Unknown result code: {result_code}") + except asyncio.TimeoutError: logger.error(f"Response timeout from {self.device_key}") raise TimeoutError(f"Device did not respond within {self.timeout}s") @@ -122,15 +157,19 @@ class NL43Client: await writer.wait_closed() async def request_dod(self) -> NL43Snapshot: - """Request DOD (Data Output Display) snapshot from device.""" + """Request DOD (Data Output Display) snapshot from device. + + Returns parsed measurement data from the device display. + """ + # _send_command now handles result code validation and returns the data line resp = await self._send_command("DOD?\r\n") # Validate response format if not resp: - logger.warning(f"Empty response from DOD command on {self.device_key}") - raise ValueError("Device returned empty response to DOD? command") + logger.warning(f"Empty data response from DOD command on {self.device_key}") + raise ValueError("Device returned empty data for DOD? command") - # Remove leading $ prompt if present + # Remove leading $ prompt if present (shouldn't be there after _send_command, but be safe) if resp.startswith("$"): resp = resp[1:].strip() @@ -138,14 +177,15 @@ class NL43Client: # DOD should return at least some data points if len(parts) < 2: - logger.error(f"Malformed DOD response from {self.device_key}: {resp}") - raise ValueError(f"Malformed DOD response: expected comma-separated values, got: {resp}") + logger.error(f"Malformed DOD data from {self.device_key}: {resp}") + raise ValueError(f"Malformed DOD data: expected comma-separated values, got: {resp}") logger.info(f"Parsed {len(parts)} data points from DOD response") snap = NL43Snapshot(unit_id="", raw_payload=resp, measurement_state="Measure") # Parse known positions (based on NL43 communication guide) + # DOD format: Main Lp, Main Leq, Main LE, Main Lmax, Main Lmin, LN1-5, Lpeak, LIeq, Leq,mov, Ltm5, flags... try: if len(parts) >= 1: snap.lp = parts[0] @@ -163,7 +203,15 @@ class NL43Client: return snap async def start(self): - await self._send_command("$Measure, Start\r\n") + """Start measurement on the device. + + According to NL43 protocol: Measure,Start (no $ prefix, capitalized param) + """ + await self._send_command("Measure,Start\r\n") async def stop(self): - await self._send_command("$Measure, Stop\r\n") + """Stop measurement on the device. + + According to NL43 protocol: Measure,Stop (no $ prefix, capitalized param) + """ + await self._send_command("Measure,Stop\r\n") diff --git a/data/slmm.db b/data/slmm.db index 4a26f78..461e656 100644 Binary files a/data/slmm.db and b/data/slmm.db differ diff --git a/data/slmm.log b/data/slmm.log index 71b7ebc..0d5dc84 100644 --- a/data/slmm.log +++ b/data/slmm.log @@ -2,3 +2,92 @@ 2025-12-23 19:02:07,048 - app.main - INFO - CORS allowed origins: ['*'] 2025-12-23 19:02:19,874 - app.main - INFO - Database tables initialized 2025-12-23 19:02:19,874 - app.main - INFO - CORS allowed origins: ['*'] +2025-12-23 19:25:54,057 - app.main - INFO - Database tables initialized +2025-12-23 19:25:54,057 - app.main - INFO - CORS allowed origins: ['*'] +2025-12-23 19:26:08,782 - app.services - INFO - Sending command to 63.45.161.130:2255: DOD? +2025-12-23 19:26:13,783 - app.services - ERROR - Connection timeout to 63.45.161.130:2255 +2025-12-23 19:26:13,783 - app.routers - ERROR - Failed to get live status for nl43-1: Failed to connect to device at 63.45.161.130:2255 +2025-12-23 19:32:21,893 - app.routers - INFO - Updated config for unit nl43-1 +2025-12-23 19:32:24,189 - app.services - INFO - Sending command to 63.45.161.130:52255: DOD? +2025-12-23 19:32:29,191 - app.services - ERROR - Connection timeout to 63.45.161.130:52255 +2025-12-23 19:32:29,191 - app.routers - ERROR - Failed to get live status for nl43-1: Failed to connect to device at 63.45.161.130:52255 +2025-12-23 19:33:01,847 - app.services - INFO - Sending command to 63.45.161.130:52255: DOD? +2025-12-23 19:33:06,848 - app.services - ERROR - Connection timeout to 63.45.161.130:52255 +2025-12-23 19:33:06,848 - app.routers - ERROR - Failed to get live status for nl43-1: Failed to connect to device at 63.45.161.130:52255 +2025-12-23 19:33:07,508 - app.routers - INFO - Updated config for unit nl43-1 +2025-12-23 19:33:09,056 - app.services - INFO - Sending command to 63.45.161.130:5225: DOD? +2025-12-23 19:33:14,057 - app.services - ERROR - Connection timeout to 63.45.161.130:5225 +2025-12-23 19:33:14,057 - app.routers - ERROR - Failed to get live status for nl43-1: Failed to connect to device at 63.45.161.130:5225 +2025-12-23 19:33:22,649 - app.services - INFO - Sending command to 63.45.161.130:5225: $Measure, Start +2025-12-23 19:33:27,650 - app.services - ERROR - Connection timeout to 63.45.161.130:5225 +2025-12-23 19:33:27,650 - app.routers - ERROR - Failed to start measurement on nl43-1: Failed to connect to device at 63.45.161.130:5225 +2025-12-23 19:39:10,370 - app.routers - INFO - Updated config for unit nl43-1 +2025-12-23 19:39:12,948 - app.services - INFO - Sending command to 63.45.161.30:5225: DOD? +2025-12-23 19:39:17,948 - app.services - ERROR - Connection timeout to 63.45.161.30:5225 +2025-12-23 19:39:17,948 - app.routers - ERROR - Failed to get live status for nl43-1: Failed to connect to device at 63.45.161.30:5225 +2025-12-23 19:39:40,472 - app.services - INFO - Sending command to 63.45.161.30:5225: $Measure, Start +2025-12-23 19:39:45,472 - app.services - ERROR - Connection timeout to 63.45.161.30:5225 +2025-12-23 19:39:45,472 - app.routers - ERROR - Failed to start measurement on nl43-1: Failed to connect to device at 63.45.161.30:5225 +2025-12-23 19:39:52,929 - app.services - INFO - Sending command to 63.45.161.30:5225: $Measure, Stop +2025-12-23 19:39:57,929 - app.services - ERROR - Connection timeout to 63.45.161.30:5225 +2025-12-23 19:39:57,929 - app.routers - ERROR - Failed to stop measurement on nl43-1: Failed to connect to device at 63.45.161.30:5225 +2025-12-23 19:40:15,626 - app.services - INFO - Sending command to 63.45.161.30:5225: DOD? +2025-12-23 19:40:20,626 - app.services - ERROR - Connection timeout to 63.45.161.30:5225 +2025-12-23 19:40:20,626 - app.routers - ERROR - Failed to get live status for nl43-1: Failed to connect to device at 63.45.161.30:5225 +2025-12-23 19:41:48,870 - app.routers - INFO - Updated config for unit nl43-1 +2025-12-23 19:41:51,383 - app.services - INFO - Sending command to 63.45.161.30:2255: DOD? +2025-12-23 19:41:51,551 - app.services - ERROR - Malformed DOD response from 63.45.161.30:2255: R+0000 +2025-12-23 19:41:51,551 - app.routers - ERROR - Invalid response from device nl43-1: Malformed DOD response: expected comma-separated values, got: R+0000 +2025-12-23 19:41:59,639 - app.services - INFO - Sending command to 63.45.161.30:2255: $Measure, Start +2025-12-23 19:41:59,774 - app.routers - INFO - Started measurement on unit nl43-1 +2025-12-23 19:42:12,493 - app.services - INFO - Sending command to 63.45.161.30:2255: $Measure, Stop +2025-12-23 19:42:12,654 - app.routers - INFO - Stopped measurement on unit nl43-1 +2025-12-23 19:42:21,145 - app.services - INFO - Sending command to 63.45.161.30:2255: DOD? +2025-12-23 19:42:21,304 - app.services - ERROR - Malformed DOD response from 63.45.161.30:2255: R+0000 +2025-12-23 19:42:21,304 - app.routers - ERROR - Invalid response from device nl43-1: Malformed DOD response: expected comma-separated values, got: R+0000 +2025-12-23 19:43:43,946 - app.services - INFO - Sending command to 63.45.161.30:2255: $Measure, Start +2025-12-23 19:43:44,096 - app.routers - INFO - Started measurement on unit nl43-1 +2025-12-23 19:57:13,076 - app.main - INFO - Database tables initialized +2025-12-23 19:57:13,077 - app.main - INFO - CORS allowed origins: ['*'] +2025-12-23 19:57:31,950 - app.main - INFO - Database tables initialized +2025-12-23 19:57:31,950 - app.main - INFO - CORS allowed origins: ['*'] +2025-12-23 19:58:52,676 - app.services - INFO - Sending command to 63.45.161.30:2255: DOD? +2025-12-23 19:58:52,824 - app.services - INFO - Parsed 64 data points from DOD response +2025-12-23 19:58:52,833 - app.routers - INFO - Retrieved live status for unit nl43-1 +2025-12-23 19:59:05,367 - app.services - INFO - Sending command to 63.45.161.30:2255: $Measure, Start +2025-12-23 19:59:05,534 - app.services - ERROR - Communication error with 63.45.161.30:2255: Command error - device did not recognize command +2025-12-23 19:59:05,534 - app.routers - ERROR - Unexpected error starting measurement on nl43-1: Command error - device did not recognize command +2025-12-23 19:59:25,765 - app.services - INFO - Sending command to 63.45.161.30:2255: DOD? +2025-12-23 19:59:26,024 - app.services - INFO - Parsed 64 data points from DOD response +2025-12-23 19:59:26,044 - app.routers - INFO - Retrieved live status for unit nl43-1 +2025-12-23 19:59:29,829 - app.services - INFO - Sending command to 63.45.161.30:2255: DOD? +2025-12-23 19:59:29,983 - app.services - INFO - Parsed 64 data points from DOD response +2025-12-23 19:59:29,991 - app.routers - INFO - Retrieved live status for unit nl43-1 +2025-12-23 20:01:30,447 - app.services - INFO - Sending command to 63.45.161.30:2255: DOD? +2025-12-23 20:01:30,624 - app.services - INFO - Parsed 64 data points from DOD response +2025-12-23 20:01:30,633 - app.routers - INFO - Retrieved live status for unit nl43-1 +2025-12-23 20:01:31,448 - app.services - INFO - Sending command to 63.45.161.30:2255: DOD? +2025-12-23 20:01:31,663 - app.services - INFO - Parsed 64 data points from DOD response +2025-12-23 20:01:31,671 - app.routers - INFO - Retrieved live status for unit nl43-1 +2025-12-23 20:13:43,728 - app.main - INFO - Database tables initialized +2025-12-23 20:13:43,728 - app.main - INFO - CORS allowed origins: ['*'] +2025-12-23 20:14:33,467 - app.services - INFO - Sending command to 63.45.161.30:2255: DOD? +2025-12-23 20:14:33,625 - app.services - INFO - Parsed 64 data points from DOD response +2025-12-23 20:14:33,635 - app.routers - INFO - Retrieved live status for unit nl43-1 +2025-12-23 20:14:39,641 - app.services - INFO - Sending command to 63.45.161.30:2255: $Measure,Start +2025-12-23 20:14:39,935 - app.services - ERROR - Communication error with 63.45.161.30:2255: Command error - device did not recognize command +2025-12-23 20:14:39,935 - app.routers - ERROR - Unexpected error starting measurement on nl43-1: Command error - device did not recognize command +2025-12-23 20:23:03,818 - app.main - INFO - Database tables initialized +2025-12-23 20:23:03,818 - app.main - INFO - CORS allowed origins: ['*'] +2025-12-23 20:23:58,949 - app.services - INFO - Sending command to 63.45.161.30:2255: DOD? +2025-12-23 20:23:59,105 - app.services - INFO - Parsed 64 data points from DOD response +2025-12-23 20:23:59,115 - app.routers - INFO - Retrieved live status for unit nl43-1 +2025-12-23 20:24:00,869 - app.services - INFO - Sending command to 63.45.161.30:2255: $Measure,1 +2025-12-23 20:24:01,185 - app.services - ERROR - Communication error with 63.45.161.30:2255: Command error - device did not recognize command +2025-12-23 20:24:01,185 - app.routers - ERROR - Unexpected error starting measurement on nl43-1: Command error - device did not recognize command +2025-12-23 20:29:41,079 - app.main - INFO - Database tables initialized +2025-12-23 20:29:41,079 - app.main - INFO - CORS allowed origins: ['*'] +2025-12-23 20:29:56,999 - app.services - INFO - Sending command to 63.45.161.30:2255: Measure,Start +2025-12-23 20:29:57,135 - app.routers - INFO - Started measurement on unit nl43-1 +2025-12-23 20:30:46,229 - app.services - INFO - Sending command to 63.45.161.30:2255: Measure,Stop +2025-12-23 20:30:46,455 - app.routers - INFO - Stopped measurement on unit nl43-1