Skip to content

Fix multi-page CSV print DataError by using single print session#118

Open
3dberg wants to merge 1 commit intoMultiMote:devfrom
3dberg:fix/multi-page-csv-print
Open

Fix multi-page CSV print DataError by using single print session#118
3dberg wants to merge 1 commit intoMultiMote:devfrom
3dberg:fix/multi-page-csv-print

Conversation

@3dberg
Copy link
Copy Markdown
Contributor

@3dberg 3dberg commented Mar 8, 2026

Previously, each CSV row created a separate print session (printInit → printPage → waitForFinished → printEnd), causing DataError on subsequent pages because the printer wasn't ready to reinitialize immediately. Now uses a single session with the correct totalPages count, sending all pages before waiting.

Previously, each CSV row created a separate print session
(printInit → printPage → waitForFinished → printEnd), causing
DataError on subsequent pages because the printer wasn't ready
to reinitialize immediately. Now uses a single session with the
correct totalPages count, sending all pages before waiting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MultiMote
Copy link
Copy Markdown
Owner

It implements #76, If I understand correctly?

@MultiMote MultiMote changed the base branch from main to dev March 8, 2026 16:11
@MultiMote
Copy link
Copy Markdown
Owner

MultiMote commented Mar 8, 2026

Tested with my printers. B21_C2B, B21_PRO, B1 - ok.
D110 - fails after first page.

before-pr.log

after-pr.log

For this reason, I have not yet replaced the dumb printing method, as it is as compatible with most printers 😅

I will need to try multi-page printing with D110 in the official application and make a packet capture.

@3dberg
Copy link
Copy Markdown
Contributor Author

3dberg commented Mar 8, 2026

Tested with my printers. B21_C2B, B21_PRO, B1 - ok. D110 - fails after first page.

before-pr.log

after-pr.log

For this reason, I have not yet replaced the dumb printing method, as it is as compatible with most printers 😅

I will need to try multi-page printing with D110 in the official application and make a packet capture.

Having multiple options for the different models would be beneficial. For my M2, it works, but with the current single session, it fails on page 1. :)

@MultiMote
Copy link
Copy Markdown
Owner

Earlier, I added page delay option to deal with DataError

image

I will try to figure out the D110 printing error. I think it's time to start using the multi-page printing protocol functionality properly.

@MultiMote
Copy link
Copy Markdown
Owner

MultiMote commented Mar 8, 2026

official_xlsx_x3.txt

https://dev.mmote.ru/niim-parser/

ok, seems the issue is not calling waitForFinished() after each page, everything else is ok

For D110 status is polled after each page, for newer models - when all pages are sent.

So, It require changes in niimbluelib.

Copy link
Copy Markdown
Owner

@MultiMote MultiMote left a comment

Choose a reason for hiding this comment

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

Please make changes:

  1. Switch your base branch to dev.
  2. Update @mmote/niimbluelib to 0.0.1-alpha.37
  3. Add currentPrintTask.printPage(encoded, quantity) call after currentPrintTask.waitForPageFinished() (in the page loop).

@MultiMote
Copy link
Copy Markdown
Owner

@3dberg Are you planning to make changes, or should I accept the PR as is and make the adjustments myself?

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