diff --git a/pureboot/pureboot.py b/pureboot/pureboot.py index 54332ac..6a8308b 100644 --- a/pureboot/pureboot.py +++ b/pureboot/pureboot.py @@ -497,8 +497,20 @@ class OneWirePort: raise Error(f"one-wire echo missing after {len(data) - len(remaining)} of " f"{len(data)} byte(s) — is the adapter's RX tied to the line?") self.lost_echoes += len(remaining) - verbose(f"one-wire: {len(remaining)} of {len(data)} knock byte(s) lost to the " - f"device's ack; retrying") + # Which loss this is matters, and the count says it. *Some* bytes lost is + # the device's ack winning the line against the host's series resistor — + # ordinary, and what the retry absorbs. *Every* byte lost is nothing + # coming back at all, which is a line that is not free: an application + # holding the shared pin low (this rig's LED demo ends that way), a + # wedge, or an RX that is not on the line. Same retry either way, but + # blaming an ack that never happened sends the reader to the wrong place. + if len(remaining) == len(data): + verbose(f"one-wire: none of {len(data)} byte(s) echoed — the line is not " + f"coming back. Held low by something? (a pin driven low, a wedge, " + f"or an RX not on the line)") + else: + verbose(f"one-wire: {len(remaining)} of {len(data)} knock byte(s) lost to the " + f"device's ack; retrying") def write_blind(self, data): self.write(data, blind=True)