fix: /status usually reports offline even though printing works #2

Open
opened 2026-10-19 03:42:40 +00:00 by time · 0 comments
Collaborator

The web UI's /status endpoint (CONFIG?/BATTERY? over the shared RFCOMM socket) intermittently or persistently reports the printer as offline, while print jobs on the same link succeed. Observed behavior on the P21 at 09:E2:D5:44:88:8A:

  • The first command right after a fresh link is often dropped (returns an empty reply or a stray 0x00 byte); a second attempt works.
  • Sometimes the printer stops answering text queries entirely for a while (returns b'\x00' to CONFIG?), then recovers after a disconnect/reconnect or a pause.
  • The web UI's _with_link gives up after 3 empty-reply retries, which is not enough when the printer needs a longer settle.

Fix direction: treat a stray short/garbage reply as "retry" (not just empty), increase settle/retry budget for queries, and consider closing the RFCOMM socket between query bursts so the link re-initializes cleanly. The status poll is already at 15 min cadence — the goal is that when it does fire, it succeeds.

Reported 2026-10-18 during web UI development (branch webui).

The web UI's `/status` endpoint (CONFIG?/BATTERY? over the shared RFCOMM socket) intermittently or persistently reports the printer as offline, while print jobs on the same link succeed. Observed behavior on the P21 at 09:E2:D5:44:88:8A: - The first command right after a fresh link is often dropped (returns an empty reply or a stray `0x00` byte); a second attempt works. - Sometimes the printer stops answering text queries entirely for a while (returns `b'\x00'` to `CONFIG?`), then recovers after a disconnect/reconnect or a pause. - The web UI's `_with_link` gives up after 3 empty-reply retries, which is not enough when the printer needs a longer settle. Fix direction: treat a stray short/garbage reply as "retry" (not just empty), increase settle/retry budget for queries, and consider closing the RFCOMM socket between query bursts so the link re-initializes cleanly. The status poll is already at 15 min cadence — the goal is that when it does fire, it succeeds. Reported 2026-10-18 during web UI development (branch `webui`).
Sign in to join this conversation.
No labels
bug
docs
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
daru/nelko-p21-print#2
No description provided.