fix: batch printing corrupts the second label (feeds back, prints solid black) #1

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

When printing a run of multiple labels via the web UI (/print with count > 1), the first label prints correctly, but the second label pulls roughly 1/4 of the first label back into the printer and prints a solid block of black instead.

The web UI currently paces labels with a fixed 2 s delay between jobs (send_job loop in webui/p21_webui.py), because the ESC ! ? status byte is silent on this unit so we can't poll for "ready". Hypotheses: (a) 2 s is shorter than the feed time for a 40 mm label, so the next job's CLS/BITMAP/PRINT lands while the motor is still feeding the previous label; (b) the RFCOMM link needs re-syncing between jobs (the first-command-after-link-up drop behavior hints at a fragile command state machine).

Fix direction: measure the actual feed time for a full label and use a generous delay (or make it scale with label length), and/or re-establish the link per label. Verify with a 3-label run and confirm each label is clean and fully separated.

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

When printing a run of multiple labels via the web UI (`/print` with count > 1), the first label prints correctly, but the second label pulls roughly 1/4 of the first label back into the printer and prints a solid block of black instead. The web UI currently paces labels with a fixed 2 s delay between jobs (`send_job` loop in `webui/p21_webui.py`), because the `ESC ! ?` status byte is silent on this unit so we can't poll for "ready". Hypotheses: (a) 2 s is shorter than the feed time for a 40 mm label, so the next job's `CLS`/`BITMAP`/`PRINT` lands while the motor is still feeding the previous label; (b) the RFCOMM link needs re-syncing between jobs (the first-command-after-link-up drop behavior hints at a fragile command state machine). Fix direction: measure the actual feed time for a full label and use a generous delay (or make it scale with label length), and/or re-establish the link per label. Verify with a 3-label run and confirm each label is clean and fully separated. 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#1
No description provided.