Skip to content

Check the primed read with pr129_check.py, on #20 units and TP1X boards - #138

Merged
QuiteYellow merged 3 commits into
scratch/test-scriptsfrom
scripts/primed-check
Nov 20, 2026
Merged

QuiteYellow merged 3 commits into
scratch/test-scriptsfrom
scripts/primed-check

Conversation

@QuiteYellow

@QuiteYellow QuiteYellow commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Updates pr129_check.py (#135) for #129's newest commit, f74a26e, which sends a primer before block 0 of a read under a fragment length.

  • Arm 1 at 1024 now reads /device/0 after /oic/d, so one handshake per unit tests the fix at the length it targets. Arm 2 at 512 is unchanged and gives a second data point.
  • --path names the resources to read after /oic/d, once per resource, and defaults to /device/0. The Can't connect to BespokeAI Washer/Dryer #20 command stays the same, and a TP1X board from Washer and Dryer both disconnect from WiFi momentarily when DTLS handshake is attempted mbillow/localthings#504 can name /information/vs/0 and /oic/res. Each path is checked before anything is sent: absolute, no query, nothing under /oic/sec, at most six.
  • Discovery waits for a slow directory. On Can't connect to BespokeAI Washer/Dryer #20 run 2 the washer's port answer came after the 1 s the library gives that lookup, and its multi-block directory took 2.0 s for block 0 and 1.6 s for block 1. The washer also went quiet for almost 6 s during discovery. The old 3 s attempt could not hold that, so the script printed "lists no secure port". It still probes every few seconds until the directory first answers, so the check after an arm sees a returning appliance quickly. After that, each attempt gets up to 30 s with one retry, within the 60 s budget.
  • The docstring now says which bodies the primer cannot help: the firmware never splits a body of 1024 bytes or less, so list the --path resources over 1024 bytes first. The prompt gives the worst-case run time for the paths passed.
  • The pip line pins f74a26e. The install note now says git is needed, since that line clones the repository.

This branch has no CI. test_pr129_check.py (36 tests, offline) passes on Python 3.11 and 3.14 with the library at f74a26e. On 2026-11-20, before the discovery change, I ran the script against my dryer from a fresh venv in the bridge image on the host network. Both handshakes completed. /device/0 (4607 bytes) came back 2.05 at 1024 in 2.0 s and at 512 in 4.1 s, the dryer answered plaintext 0.1 s after each arm, and the output carried no address, UUID or serial. Separately, the pip line at f74a26e installs in a fresh Python 3.11 venv with pip 24.0. The new discovery is tested offline only: no slow directory was available here.

The library commit this script pins sends a primer before block 0 of a read
under a fragment length, and a dryer here then returned /device/0 at 1024 in
512-byte blocks (2026-11-19). Arm 1 now reads /device/0 after /oic/d, so one
handshake per unit tests the fix at the length it targets; arm 2 keeps 512 as
the second data point.

The resources to read come from --path, default /device/0, so the #20 command
is unchanged and a TP1X board can name /information/vs/0 and /oic/res
(localthings#504). Each path is checked before anything is sent: absolute, no
query, nothing under /oic/sec, at most six.

Publish-Approved: 2026-11-20T10:20:00+00:00
On #20 run 2 the washer's directory replies took 0.76 to 5.76 s. Discovery had
3 s with no retry, so it gave up partway and the script printed that the
directory lists no secure port, which was false. Each attempt now has 10 s and
one retry, and an answer without a port is asked again until the 60 s budget
runs out, as silence already was. The time reported for the plaintext check
still counts to the first answer.

Publish-Approved: 2026-11-20T10:35:00+00:00
…yte rule

The review of #138 found that discovery still could not hold #20 run 2's
washer. The library gives the filtered doxm lookup at most 1 s, and the
washer's doxm replies came later than that, so the port had to come from the
multi-block directory: 2.0 s for block 0, 1.6 s for block 1, with a 6 s burst
of silence. Discovery now probes with 3 s attempts until the directory first
answers, as before, so the check after an arm still sees a returning
appliance within seconds. After the first answer it gives each attempt up to
30 s with one retry. No attempt runs past the 60 s budget, so "within 60 s"
holds.

The docstring said a primed read comes back in smaller blocks and advised
listing smaller --path resources first. The firmware never splits a body of
1024 bytes or less, so such a body over the length still fails, and listed
first it ends the session. It now says so, and advises listing the large
ones first.

The run-time estimate left out the new reads. The prompt now gives the worst
case for the paths passed: up to 30 s per failed read, in each arm.

Publish-Approved: 2026-11-20T11:10:00+00:00

@QuiteYellow-reviewer QuiteYellow-reviewer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review at deaeb80.

Not run: no hardware run and no CI on this branch. The script's own tests were not run in this review.

Five points. Four are inline. One is about the PR body:

Problem: The PR body does not describe deaeb80, and its test count is stale.
Trigger: deaeb80 changes discovery: 10 s per attempt, one retry, and another attempt when an answer has no port. The body gives 33 tests. The test file at head has 34.
Fix: Add deaeb80 to the body, give the count at head, and name the commit that the dryer run used.

Comment thread pr-129-fragment-length/pr129_check.py Resolved
Comment thread pr-129-fragment-length/pr129_check.py Resolved
Comment thread pr-129-fragment-length/pr129_check.py Resolved
Comment thread pr-129-fragment-length/pr129_check.py Resolved
@QuiteYellow
QuiteYellow merged commit 4ae2e47 into scratch/test-scripts Nov 20, 2026
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