The field test is done: replies avg 113-205 ms, spikes up to 1.5 s, one
slow reply covered by the retry, 0 failed commands. The #define in
deviceNodeEthernet2Serial.cpp and deviceNodeSensor.cpp is commented out;
uncomment it to get the timing lines again. The reconnect error ("No
reply to N requests in a row") is always logged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
DEBUG_COMMUNICATION is turned on in deviceNodeEthernet2Serial.cpp and
deviceNodeSensor.cpp only. It isn't defined project-wide, which would also
enable the per-byte hex dumps of protocol.cpp and the serial transports.
To turn it off, comment out the #define at the top of the two files.
Gateway I/O thread (tag E2UART):
- "IO: request #n (x B): NO reply in N ms": nothing within the reply
window (E2UART_REPLY_TIMEOUT_MS).
- "IO: request #n: reply x B, first byte N ms, done N ms": replies
slower than 500 ms (E2UART_SLOW_REPLY_MS), or an incomplete packet.
- "IO: late data x B, N ms after request #n": a reply that came after
the window (now given to the parser of that request).
- "IO stats 60 s [host:port]": requests, replies, first-byte avg/max, slow,
without reply, late.
Sensor (tag NODSEN):
- "COMM: reply/NACK WM STG reply N ms": replies slower than 500 ms
(LGS_SLOW_REPLY_MS), NACKs and commands that needed retries, with
the time since the first attempt.
- "COMM: no reply - WM STG attempt k/17 timed out after N ms": each
attempt that timed out.
- "COMM: command failed - ...": details next to "Communication Wait State
TO!".
- "COMM stats 60 s": replies, avg/max reply time, slow, timed-out attempts
(with the wait per attempt), failed commands.
The gateway's per-chunk "Send/Read x bytes" debug lines are replaced by
these per-request lines.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
A 2D sensor waited 10 x 100 ms (LGS_DEFAULT_TO_COUNTER) for each reply,
which is a local serial-line value. Through an Ethernet to serial gateway
on a mobile link the round trip is longer at times.
- basicTransport::isNetworkLink() (false by default). deviceETH2UART
returns true.
- deviceNodeSensor::m_nTOCounterBase is the wait per attempt.
device2DSensor sets it when it binds to its port:
LGS_NETWORK_TO_COUNTER (30 = 3 s) for a network link,
LGS_DEFAULT_TO_COUNTER (1 s) for a local serial port, which is unchanged.
All 2D waits use it, including the longer x4 / x16 waits of the
detection profile and mask commands. waitStateFunction() re-arms the
retry with it.
- E2UART_REPLY_TIMEOUT_MS 800 -> 2500 ms, below the sensor's 3 s, so the
gateway's I/O thread waits for the reply before sending the next request.
Tested with the fake device: replies after 300 ms (split), 1200 ms and
2000 ms (split) all reach their own request within the 3 s wait (ASan clean).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16