fix: printer settings (beep off, never power off) not reliably applied #3

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

The web UI applies BEEP \x00 (beep off) and TIMER \x00 (never auto power off) once, on the first RFCOMM link per server process. Two problems:

  1. The beep is still audible when the web UI is used, and the auto power-off may not actually be disabled — the commands are sent once and never verified or re-sent.
  2. If the printer is manually power-cycled, its settings revert and the web UI never re-applies them, because the "configured" flag is per-connection, not per-printer-power-cycle.

Fix: push the desired settings (beep off, timer never) on every status query, not just first link. The settings commands have no response, so this is cheap and idempotent. Also verify via CONFIG? after applying and surface the effective values in /status.

Note for the fix: the settings commands require a space before the raw-byte argument — BEEP \x00\r\n / TIMER \x00\r\n, exactly as p21_print.py sends them (f"BEEP {chr(0)}"). Without the space the parser misreads the argument (observed: timer byte corrupted to 0xff). The README's settings table should be updated to show the space (see the docs issue).

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

The web UI applies `BEEP \x00` (beep off) and `TIMER \x00` (never auto power off) once, on the first RFCOMM link per server process. Two problems: 1. The beep is still audible when the web UI is used, and the auto power-off may not actually be disabled — the commands are sent once and never verified or re-sent. 2. If the printer is manually power-cycled, its settings revert and the web UI never re-applies them, because the "configured" flag is per-connection, not per-printer-power-cycle. Fix: push the desired settings (beep off, timer never) on *every* status query, not just first link. The settings commands have no response, so this is cheap and idempotent. Also verify via `CONFIG?` after applying and surface the effective values in `/status`. Note for the fix: the settings commands require a space before the raw-byte argument — `BEEP \x00\r\n` / `TIMER \x00\r\n`, exactly as `p21_print.py` sends them (`f"BEEP {chr(0)}"`). Without the space the parser misreads the argument (observed: timer byte corrupted to `0xff`). The README's settings table should be updated to show the space (see the docs issue). 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#3
No description provided.