Repository navigation
add RS485SocketTool ESP32 hardware testing guide - #6
Conversation
Self-serve TESTING.md for bringing up the RS485SocketTool example on an ESP32: parts list, ESP32<->transceiver<->bus wiring (pins/flags matching the esp32 platformio env), build/flash steps, single-node smoke test and two-node send/receive test with the exact serial strings the sketch emits, plus a troubleshooting table. Carries the deferred hardware Testing Required from the RS485-on-ESP32 example work (ArduinoLibs #4). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
aphelps-claude-bot
left a comment
There was a problem hiding this comment.
Self-review of the RS485SocketTool hardware TESTING.md (docs-only). Verified every technical claim against RS485Utils/examples/RS485SocketTool/RS485SocketTool.ino and platformio/RS485SocketTool/platformio.ini: pins RECV=16/XMIT=17/ENABLED=18, RS485_HARDWARE_SERIAL=2, 115200 monitor baud, nano env exists, default ADDRESS 128, broadcast via sendMsgTo(SOCKET_ADDR_ANY, ...), non-interactive (no Serial.read), 2-byte payload 'T' + count, and the exact strings *** RS485SocketTool initialized *** / * Sending N (every SEND_PERIOD = 1000 ms) / * Received data <len>:. All match.
One substantive inaccuracy found (inline, §5 expected output): the documented hex payload bytes will not actually print at the env's -DDEBUG_LEVEL=1, because print_hex_buffer emits via DEBUG4_HEXVAL which is compiled out below DEBUG_LEVEL=4. Two minor clarifications also inline. No architectural or cross-file issues.
Self-review finding: the guide showed '* Received data 2: 54 01', but print_hex_buffer emits the bytes via DEBUG4_HEXVAL, which compiles out below DEBUG_LEVEL=4; both envs build at level 1, so the real line is '* Received data 2:' with no hex. Correct the expected output (a tester would otherwise think reception failed), note how to see the hex (-DDEBUG_LEVEL=4) and the count-lag, and spell out the nano env's default AVR pins (7/4/2). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
aphelps-claude-bot
left a comment
There was a problem hiding this comment.
Re-review of 6086dd0 (fix RS485 guide: received payload hex is hidden at DEBUG_LEVEL=1) — incremental diff over d11dabb only.
- Prior finding 1 (hex payload not printed at
-DDEBUG_LEVEL=1) — addressed. §5 now shows* Received data 2:with no hex, explains theprint_hex_buffer→DEBUG4_HEXVALgating, and gives the-DDEBUG_LEVEL=4rebuild path. Verified againstDebug/Debug.h(DEBUG4_HEXVALmaps toDEBUG1_HEXVALonly atDEBUG_LEVEL >= 4, empty otherwise) andDebug/Debug.cpp:50-54. - Prior finding 2 (counter off-by-one between payload and
* Sending N) — addressed. The lag-by-one note matches the sketch (send_buffer[1] = count++;thenDEBUG1_VALUELN("* Sending ", count)). - Prior finding 3 (nano env pin defaults unspecified) — addressed. §5 now states RECV=7/XMIT=4/ENABLED=2; verified the
nanoenv inplatformio/RS485SocketTool/platformio.inipasses no pin flags, so the sketch defaults atRS485SocketTool.ino:22-26apply. - One new minor issue (inline, §5): the illustrative
DEBUG_LEVEL=4output formatting doesn't match what the code actually prints. Cosmetic, suggestion attached.
No other issues introduced by this commit.
Re-review nit: the illustrative '* Received data 2: 54 02' didn't match
Arduino HEX formatting (no zero-pad, per-byte leading space). Describe the
DEBUG_LEVEL=4 payload as space-separated hex ('T'=54 then the counter) and
note the no-zero-pad quirk, rather than showing a wrong literal.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
aphelps-claude-bot
left a comment
There was a problem hiding this comment.
Re-review of 6f0d6e3 (rs485 guide: drop the fabricated debug-level-4 hex example) — incremental diff over 6086dd0 only.
- Prior finding (illustrative
DEBUG_LEVEL=4output didn't match actual formatting) — addressed. The fabricated literal* Received data 2: 54 02is removed; §5 now describes the payload generically as space-separated hex after the colon ('T'=54, then the sender's counter) and notes the no-zero-pad and counter-lag quirks. Verified against the code:print_hex_bufferloopsDEBUG4_HEXVAL(" ", buff[b])→Serial.print(F(" ")); Serial.print(y, HEX)(one space per byte, ArduinoHEXunpadded), and the sketch storessend_buffer[1] = count++before printing* Sending N, so the lag-by-one note is correct.
No new issues introduced by this commit. All prior findings resolved.
aphelps
left a comment
There was a problem hiding this comment.
This is a bit dated now but lets clear it out
Summary
A self-serve
TESTING.mdfor bringing up theRS485SocketToolexample on an ESP32, co-located with the sketch atRS485Utils/examples/RS485SocketTool/. It carries the deferred hardwareTesting Requiredstep from the RS485-on-ESP32 example work (#4) — Adam can now validate on real hardware when the parts arrive, without needing anyone in the loop.Contents
platformio/RS485SocketTool/platformio.ini(esp32env,Serial2).pio run -e esp32 --target upload; monitor at 115200).*** RS485SocketTool initialized ***,* Sending N,* Received data <len>: <hex>).Test plan
Docs-only; verified against the sketch source and the example's
platformio.ini:No automated build in this PR. Actually flashing hardware is the eventual real-world confirmation — that IS the purpose of this guide, tracked separately.
🤖 Generated with Claude Code