niimprint icon indicating copy to clipboard operation
niimprint copied to clipboard

Wait for finish to send end_print

Open glaserL opened this issue 1 year ago • 16 comments

First, thanks a lot for your work! I recently bought a B21 and .. well, want to make it more complicated than simply installing an app!

I noticed the same behaviour as in #3 and realized increasing the sleep duration also helped.

Somehow I got the exception below, when calling get_print_status. Unsure if this is related to using usb? So I had to modify it a bit.

/niimprint/niimprint/printer.py", line 299, in get_print_status
    page, progress1, progress2 = struct.unpack(">HBB", packet.data)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
struct.error: unpack requires a buffer of 4 bytes

Right now it simply prints Progress: VALUE, if you want that changed or have it send to logger i can change that of course.

Looking forward to your feedback!

glaserL avatar Feb 23 '24 16:02 glaserL

Thanks, I'll try to find some time on the next week to finally fix this. The problem is that I only have a B21 at hand, and I'm afraid the modification you're suggesting can (for example) break D11/D110 instead. The only way I can be sure my code works is to buy every single one of niimbot printers 🥲

AndBondStyle avatar Feb 23 '24 16:02 AndBondStyle

I'm afraid the modification you're suggesting can (for example) break D11/D110 instead.

I have D110 so I can test this changes. «Be not afraid», yeah.

Orhideous avatar Feb 23 '24 16:02 Orhideous

Awesome! Did you test your PR on D110 already?

AndBondStyle avatar Feb 23 '24 16:02 AndBondStyle

Which one?…

Orhideous avatar Feb 23 '24 16:02 Orhideous

@Orhideous oh, sorry, I confused you with this PR author. Anyway, testing is appreciated :)

AndBondStyle avatar Feb 23 '24 16:02 AndBondStyle

Thanks for the fast response! You are right, https://github.com/AndBondStyle/niimprint/issues/3#issuecomment-1867058175 mentioned a difference between whole job progress and label progress but I'm not sure how to print multiple labels at once so I didn't take it into account - this might make the progress logging behave weird.

If you don't have time for extensive testing you can also just c+p a few logs and I try to make sense of them!

glaserL avatar Feb 23 '24 16:02 glaserL

Hey, thanks for all the feedback!

sorry life happened, I'll fixup this PR on the weekend and try to have a look at #17

glaserL avatar Apr 04 '24 08:04 glaserL

Probably should have taken a better look at the open PRs before making mine. Looks like this PR address the problem I patched. @glaserL is there any update with this PR?

jhnnyb avatar May 28 '24 05:05 jhnnyb

No, unfortunately not. I know I promised an update weeks ago, next week should (seriously) work out, not sure if it'll be Monday. What printer do you have? I think we already have access to B21 and a D110 so we can make sure we don't break other printers.

glaserL avatar May 28 '24 06:05 glaserL

No issue, there isn't any rush. I have a B1, so I can help test compatibility.

jhnnyb avatar May 28 '24 14:05 jhnnyb

sorry life happened

Same story... Can't get myself to sit down and fix all accumulated issues

Anyway, I'm pretty sure that as-is, this PR will break D110 compatibility. @Orhideous if you're available, can you please test this?

AndBondStyle avatar May 28 '24 14:05 AndBondStyle

No worries, such is life. The utility still has been very useful for making custom stickers! I might have access to a D110, if @Orhideous isn't available I can see if I can get my hands on it to test on.

jhnnyb avatar May 28 '24 14:05 jhnnyb

Good lord! Finally got around to it, sorry for the insane delay. @AndBondStyle you mentioned it breaks D110, why exactly? I added the changes from @azplanlos in #28 , is that sufficient?

glaserL avatar Jun 15 '24 14:06 glaserL

I have now had a chance to test this PR and: Yes, it works for me. (one failed (half) print before importing this, and one successful print after doing the pull).

rewolff avatar May 06 '25 14:05 rewolff

During testing today, we at one point got three blank stickers instead of one printed one. So maybe this patch is not complete yet.

rewolff avatar May 12 '25 14:05 rewolff