Fix multi-page CSV print DataError by using single print session#118
Fix multi-page CSV print DataError by using single print session#1183dberg wants to merge 1 commit intoMultiMote:devfrom
Conversation
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>
|
It implements #76, If I understand correctly? |
|
Tested with my printers. B21_C2B, B21_PRO, B1 - ok. 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. :) |
|
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. |
MultiMote
left a comment
There was a problem hiding this comment.
Please make changes:
- Switch your base branch to dev.
- Update
@mmote/niimbluelibto0.0.1-alpha.37 - Add
currentPrintTask.printPage(encoded, quantity)call aftercurrentPrintTask.waitForPageFinished()(in the page loop).
|
@3dberg Are you planning to make changes, or should I accept the PR as is and make the adjustments myself? |

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.