Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D11_H Bug when printing - unpack requires a buffer of 4 bytes. #8

Open
Adrian-Grimm opened this issue Aug 14, 2024 · 10 comments
Open

Comments

@Adrian-Grimm
Copy link

I've the D11_H version with 300dpi and when I print I get the error message:

image

unpack requires a buffer of 4 bytes.

Print output is then just a empty label with nothing printed on it.

@fraro
Copy link

fraro commented Sep 15, 2024

Have you found a solution for this? I'm thinking about buying a D11_H, but using the original software is a no-go.

Did you try setting the dpi to 300 in the code (AppConfig.py) ?
Where in the code does this error happen?

@oeloo
Copy link

oeloo commented Sep 16, 2024

I am also interested in buying a D11_H because it has 300dpi resolution. Thanks for sharing, this bug is stopping me from buying it. Hope it can be fixed.

@olefrerichs
Copy link

olefrerichs commented Oct 3, 2024

Same error with D110-M 2024 on mac os 15.0

@oeloo
Copy link

oeloo commented Oct 3, 2024

According to the thread mentioned by @fraro , to solve the problem for D110-M 2024 and D11_H is to modify the line 7 of NiimPrintX/NiimPrintX/ui/AppConfig.py :
self.print_dpi = 300 # DPI value for printing
instead of:
self.print_dpi = 203 # DPI value for printing
because these 2 devices print at 300 DPI whereas the former ones were only printing at 203 DPI.

@olefrerichs
Copy link

Thanks for your answer, I tried to change the line, but sadly with the same result. I don't have to compile anything, right? Just relaunch the UI app?

@oeloo
Copy link

oeloo commented Oct 4, 2024

As the code is 100% Python, no compilation is needed.
There is an other modification that makes sense to do in addition on NiimPrintX/NiimPrintX/ui/AppConfig.py :

  • modify this
    self.label_sizes = { "d110": { "size": { "30mm x 15mm": (30, 15), "40mm x 12mm": (40, 12), "50mm x 14mm": (50, 14), "75mm x 12mm": (75, 12), "109mm x 12.5mm": (109, 12.5), }, "density": 3 }, "d11": { "size": { "30mm x 14mm": (30, 14), "40mm x 12mm": (40, 12), "50mm x 14mm": (50, 14), "75mm x 12mm": (75, 12), "109mm x 12.5mm": (109, 12.5), }, "density": 3 }, "d101": { "size": { "30mm x 14mm": (30, 14), "40mm x 12mm": (40, 12), "50mm x 14mm": (50, 14), "75mm x 12mm": (75, 12), "109mm x 12.5mm": (109, 12.5), }, "density": 3 }, "b18": { "size": { "40mm x 14mm": (40, 14), "50mm x 14mm": (50, 14), "120mm x 14mm": (120, 14), }, "density": 3 } }
  • to this:
    self.label_sizes = { "d110_m": { "size": { "30mm x 15mm": (30, 15), "40mm x 12mm": (40, 12), "50mm x 14mm": (50, 14), "75mm x 12mm": (75, 12), "109mm x 12.5mm": (109, 12.5), }, "density": 3 }, "d11_h": { "size": { "30mm x 14mm": (30, 14), "40mm x 12mm": (40, 12), "50mm x 14mm": (50, 14), "75mm x 12mm": (75, 12), "109mm x 12.5mm": (109, 12.5), }, "density": 3 }, "d101": { "size": { "30mm x 14mm": (30, 14), "40mm x 12mm": (40, 12), "50mm x 14mm": (50, 14), "75mm x 12mm": (75, 12), "109mm x 12.5mm": (109, 12.5), }, "density": 3 }, "b18": { "size": { "40mm x 14mm": (40, 14), "50mm x 14mm": (50, 14), "120mm x 14mm": (120, 14), }, "density": 3 } }

If it does not work with a '_', try with a dash instead '-'.

@olefrerichs
Copy link

Thank you for your answer!

I tried your change, then the application won't start at all with error in terminal "KeyError: 'd110'". I guess "d110" is the default at load, so I added underneath it the block for "d110_m". Then it starts, I can choose "D110_M", printer connects. Printing still doesn't work, but now sometimes "unpack requires a buffer of 4 bytes." or new: no error is shown. Just after some timeout (60s or so) the message "disconnected" pops up, Status at the bottom of the main window remains green "connected". I also tried with "d110-m", but then the printer can't be found/connected after startup.

Can I output some kind of log to give you further details?

@oeloo
Copy link

oeloo commented Oct 4, 2024

I confirm d110 is the default to load:
@click.option( "-m", "--model", type=click.Choice(["b1", "b18", "b21", "d11", "d110"], False), default="d110", show_default=True, help="Niimbot printer model", ) in NiimPrintX/cli/command.py
Add the "d110_m" and "d11_h" to this list

@olefrerichs
Copy link

Sadly still "unpack requires a buffer of 4 bytes." after some timeout when I click print. Connects to printer, everything seems fine, but the printer just moves out an empty label and the error appears on screen.

@oeloo
Copy link

oeloo commented Oct 10, 2024

So, the new Niimbot printer 300 dpi feature requires more advanced knowledge of how this application works. @labbots definitely needs a new 300 dpi Niimbot printer 🙂

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

No branches or pull requests

4 participants