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

B1 printing a blank label #17

Open
MoshiBin opened this issue Apr 3, 2024 · 13 comments
Open

B1 printing a blank label #17

MoshiBin opened this issue Apr 3, 2024 · 13 comments

Comments

@MoshiBin
Copy link

MoshiBin commented Apr 3, 2024

When I try to print any image, the the printer just prints an empty label with nothing printed on it.
Printing from the app works correctly - so it's not a hardware issue.
This is a B1, firmware version 5.10.

Here's one verbose log of trying to print one of the example files:

$ poetry run python -m niimprint -v -i examples/B21_30x15mm_240x120px.png -c bluetooth -a "$PRINTER_ADDR" 
DEBUG | PngImagePlugin:call:190 - STREAM b'IHDR' 16 13
DEBUG | PngImagePlugin:call:190 - STREAM b'pHYs' 41 9
DEBUG | PngImagePlugin:call:190 - STREAM b'IDAT' 62 5054
DEBUG | printer:_log_buffer:146 - send: 55:55:21:01:05:25:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:31:01:01:31:aa:aa
DEBUG | printer:_log_buffer:146 - send: 55:55:23:01:01:23:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:33:01:01:33:aa:aa
DEBUG | printer:_log_buffer:146 - send: 55:55:01:01:01:01:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:02:01:01:02:aa:aa
DEBUG | printer:_log_buffer:146 - send: 55:55:03:01:01:03:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:04:01:01:04:aa:aa
DEBUG | printer:_log_buffer:146 - send: 55:55:13:04:00:78:00:f0:9f:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:14:02:01:00:17:aa:aa
DEBUG | printer:_log_buffer:146 - send: 55:55:e3:01:01:e3:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:d3:03:00:77:01:a6:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:e4:01:01:e4:aa:aa
DEBUG | printer:_log_buffer:146 - send: 55:55:f3:01:01:f3:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:f4:01:01:f4:aa:aa

I also tried creating a file with the exact dimensions for my label - it's 40mm x 30mm so I went with (40mm * 8ppmm) - 16px = 304px by (30mm * 8ppmm) - 16px = 224px - same issue, label prints empty.

$ poetry run python -m niimprint -i dummy_304x224_000_fff.png -v -r 90 -c bluetooth -a "$PRINTER_ADDR" 
DEBUG | PngImagePlugin:call:190 - STREAM b'IHDR' 16 13
DEBUG | PngImagePlugin:call:190 - STREAM b'sRGB' 41 1
DEBUG | PngImagePlugin:call:190 - STREAM b'IDAT' 54 5346
DEBUG | printer:_log_buffer:146 - send: 55:55:21:01:05:25:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:31:01:01:31:aa:aa
DEBUG | printer:_log_buffer:146 - send: 55:55:23:01:01:23:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:33:01:01:33:aa:aa
DEBUG | printer:_log_buffer:146 - send: 55:55:01:01:01:01:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:02:01:01:02:aa:aa
DEBUG | printer:_log_buffer:146 - send: 55:55:03:01:01:03:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:04:01:01:04:aa:aa
DEBUG | printer:_log_buffer:146 - send: 55:55:13:04:01:30:00:e0:c6:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:14:02:01:00:17:aa:aa
DEBUG | printer:_log_buffer:146 - send: 55:55:e3:01:01:e3:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:d3:03:00:c7:01:16:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:d3:03:01:2f:01:ff:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:e4:01:01:e4:aa:aa
DEBUG | printer:_log_buffer:146 - send: 55:55:f3:01:01:f3:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:f4:01:01:f4:aa:aa

Looking at #3 I thought I had the same issue, so I picked the PR #12 and tried again, still printed a blank label:

Long verbose log snippet
$ poetry run python -m niimprint -i dummy_304x224_000_fff.png -v -r 90 -c bluetooth -a "$PRINTER_ADDR" 
DEBUG | PngImagePlugin:call:190 - STREAM b'IHDR' 16 13
DEBUG | PngImagePlugin:call:190 - STREAM b'sRGB' 41 1
DEBUG | PngImagePlugin:call:190 - STREAM b'IDAT' 54 5346
DEBUG | printer:_log_buffer:152 - send: 55:55:21:01:05:25:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:31:01:01:31:aa:aa
DEBUG | printer:_log_buffer:152 - send: 55:55:23:01:01:23:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:33:01:01:33:aa:aa
DEBUG | printer:_log_buffer:152 - send: 55:55:01:01:01:01:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:02:01:01:02:aa:aa
DEBUG | printer:_log_buffer:152 - send: 55:55:03:01:01:03:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:04:01:01:04:aa:aa
DEBUG | printer:_log_buffer:152 - send: 55:55:13:04:01:30:00:e0:c6:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:14:02:01:00:17:aa:aa
DEBUG | printer:_log_buffer:152 - send: 55:55:e3:01:01:e3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:d3:03:00:c7:01:16:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:d3:03:01:2f:01:ff:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:e4:01:01:e4:aa:aa
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:00:00:01:ef:00:01:00:00:56:aa:aa
Progress: 0
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:00:00:01:ef:00:01:00:00:56:aa:aa
Progress: 0
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:00:00:01:ef:00:01:00:00:56:aa:aa
Progress: 0
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:00:00:01:ef:00:01:00:00:56:aa:aa
Progress: 0
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:00:00:01:ef:00:01:00:00:56:aa:aa
Progress: 0
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:00:00:01:ef:00:01:00:00:56:aa:aa
Progress: 0
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:00:00:01:ef:00:01:00:00:56:aa:aa
Progress: 0
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:00:00:01:ef:00:01:00:00:56:aa:aa
Progress: 0
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:00:00:01:ef:00:01:00:00:56:aa:aa
Progress: 0
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:00:00:01:ef:00:01:00:00:56:aa:aa
Progress: 0
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:00:01:ef:00:01:00:00:32:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:00:01:ef:00:01:00:00:32:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:00:01:ef:00:01:00:00:32:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:00:01:ef:00:01:00:00:32:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:00:01:ef:00:01:00:00:32:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:00:01:ef:00:01:00:00:32:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:01:01:ef:00:01:00:00:33:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:01:01:ef:00:01:00:00:33:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:01:01:ef:00:01:00:00:33:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:01:01:ef:00:01:00:00:33:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:02:01:ef:00:01:00:00:30:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:02:01:ef:00:01:00:00:30:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:02:01:ef:00:01:00:00:30:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:03:01:ef:00:01:00:00:31:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:03:01:ef:00:01:00:00:31:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:03:01:ef:00:01:00:00:31:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:03:01:ef:00:01:00:00:31:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:04:01:ef:00:01:00:00:36:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:04:01:ef:00:01:00:00:36:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:04:01:ef:00:01:00:00:36:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:05:01:ef:00:01:00:00:37:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:05:01:ef:00:01:00:00:37:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:05:01:ef:00:01:00:00:37:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:05:01:ef:00:01:00:00:37:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:06:01:ef:00:01:00:00:34:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:06:01:ef:00:01:00:00:34:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:06:01:ef:00:01:00:00:34:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:06:01:ef:00:01:00:00:34:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:07:01:ef:00:01:00:00:35:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:07:01:ef:00:01:00:00:35:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:07:01:ef:00:01:00:00:35:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:07:01:ef:00:01:00:00:35:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:08:01:ef:00:01:00:00:3a:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:08:01:ef:00:01:00:00:3a:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:09:01:ef:00:01:00:00:3b:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:09:01:ef:00:01:00:00:3b:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:09:01:ef:00:01:00:00:3b:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:09:01:ef:00:01:00:00:3b:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:0a:01:ef:00:01:00:00:38:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:0a:01:ef:00:01:00:00:38:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:0a:01:ef:00:01:00:00:38:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:0a:01:ef:00:01:00:00:38:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:0a:01:ef:00:01:00:00:38:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:0b:01:ef:00:01:00:00:39:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:0b:01:ef:00:01:00:00:39:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:0b:01:ef:00:01:00:00:39:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:12:01:ef:00:01:00:00:20:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:15:01:ef:00:01:00:00:27:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:18:01:ef:00:01:00:00:2a:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:1b:01:ef:00:01:00:00:29:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:1f:01:ef:00:01:00:00:2d:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:22:01:ef:00:01:00:00:10:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:25:01:ef:00:01:00:00:17:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:28:01:ef:00:01:00:00:1a:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:2b:01:ef:00:01:00:00:19:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:2e:01:ef:00:01:00:00:1c:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:32:01:ef:00:01:00:00:00:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:37:01:ef:00:01:00:00:05:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:3d:01:ef:00:01:00:00:0f:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:41:01:ef:00:01:00:00:73:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:45:01:ef:00:01:00:00:77:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:49:01:ef:00:01:00:00:7b:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:4f:01:ef:00:01:00:00:7d:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:55:01:ef:00:01:00:00:67:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:5c:01:ef:00:01:00:00:6e:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:60:01:ef:00:01:00:00:52:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:00:64:63:01:ef:00:01:00:00:51:aa:aa
Progress: 100
DEBUG | printer:_log_buffer:152 - send: 55:55:a3:01:01:a3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:b3:0a:00:01:64:00:01:ef:00:01:00:00:33:aa:aa
DEBUG | printer:_log_buffer:152 - send: 55:55:f3:01:01:f3:aa:aa
DEBUG | printer:_log_buffer:152 - recv: 55:55:f4:01:01:f4:aa:aa
@aprosvetova
Copy link

aprosvetova commented Apr 5, 2024

I had the same problem with D101.
I compared the BT traffic I sniffed and the bytes niimprint is trying to send.

The discrepancies I found:

  1. niimprint sends "start page print", niimbot app doesn't (wtf?)
  2. niimprint sets dimension as 4 bytes struct.pack(">HH", w, h), niimbot sends 6 bytes instead (more like struct.pack(">HHH", w, h, 1))

There might be more differences (like it alternates between 0x84 and 0x85 for image packets), but I haven't looked deeper, because I just tried fixing the set_dimension packet and it worked! My D101 printed a 12x40 mm label (96x320 px) without any issues. I didn't even need to apply the patch from #12, and to be fair the niimbot app bt traffic suggests that it's not necessary.

I have no idea what the "1" part in set_dimension means though. I don't have any other labels to test this with.

@AndBondStyle
Copy link
Owner

@aprosvetova do you mind sharing the traffic capture? I'm trying to collect data for different models to analyze protocol differences.

@aprosvetova
Copy link

Here you go @AndBondStyle.
I started recording shortly before printing, the actual printing begins around packet 43-49 and ends with the last packets of my dump.
d101.csv

@aprosvetova
Copy link

Oh, I forgot to add something important.
These are cleaned up BLE packets, the original app uses BLE to communicate to the printer.
That's where the weird MAC address with the first 3 bytes rotated is used.
Happily, the good old rfcomm approach still works on the other MAC, with the same payloads.

@Mugne2010
Copy link

Sorry,one question,does this disables NFC so i can use any label?Thank you

@aprosvetova
Copy link

@Mugne2010 nope the NFC part is handled by the printer. The printer even stores the amount of uses per label serial number to not let you go backwards with it. I cloned the tag when I had 17 uses, then printed a new label, tried emulating the first dump, and the printer still returned 18 uses.

Some deeper analysis is needed though. Say, if we are able to change the serial number in the dump, we might make the printer think it’s a new label. I’m pretty sure it won’t be easy, they either sign the tag content or straight up encrypt it.

If anyone is interested to look more into it, the NTAG password is 12 34 56 78.

@MoshiBin
Copy link
Author

I tried changing the set_dimension function to send the extra two bytes as mentioned above, unfortunately my B1 still prints an empty label.

@aprosvetova
Copy link

@MoshiBin I'd suggest you to record the traffic between your printer and the app. Maybe there are more differences in packets for your printer model.

  • If you have an Android-based smartphone, they usually allow btsnoop logging.
  • If you have a Mac with Apple Silicon, you can install Niimbot on your computer and use PacketLogger, which is included in the Additional Tools for Xcode bundle.

You can share the dump here if you need help reading it.

@TheZoc TheZoc mentioned this issue Apr 30, 2024
@marekmicek
Copy link

I have a B1 hardware version 5.10, firmware version 5.11. It was also printing blanks for me. Turned out to be the same issue as for @aprosvetova. In addition I needed to increase the timeout as with only this fix the printing was cut in the middle.

sniffed data:
data_sent_niimbot.txt

patch:
patch.txt

@etaloncop
Copy link

The updated setdimensions work on B21S, the third parameter is quantity

@theopoon
Copy link

theopoon commented Sep 20, 2024

Same here on B1, I try print via USB instead, also blank label

$ python3 niimprint -v -m b1 -c usb -a /dev/ttyACM0 -r 90 -i ./384x240.png
DEBUG | PngImagePlugin:call:190 - STREAM b'IHDR' 16 13
DEBUG | PngImagePlugin:call:190 - STREAM b'sRGB' 41 1
DEBUG | PngImagePlugin:call:190 - STREAM b'gAMA' 54 4
DEBUG | PngImagePlugin:call:190 - STREAM b'pHYs' 70 9
DEBUG | PngImagePlugin:call:190 - STREAM b'IDAT' 91 2789
DEBUG | printer:_log_buffer:146 - send: 55:55:21:01:05:25:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:31:01:01:31:aa:aa
DEBUG | printer:_log_buffer:146 - send: 55:55:23:01:01:23:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:33:01:01:33:aa:aa
DEBUG | printer:_log_buffer:146 - send: 55:55:01:01:01:01:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:02:01:01:02:aa:aa
DEBUG | printer:_log_buffer:146 - send: 55:55:03:01:01:03:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:04:01:01:04:aa:aa
DEBUG | printer:_log_buffer:146 - send: 55:55:13:04:01:80:00:f0:66:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:14:02:01:00:17:aa:aa
DEBUG | printer:_log_buffer:146 - send: 55:55:e3:01:01:e3:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:d3:03:00:c7:01:16:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:d3:03:01:7f:01:af:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:e4:01:01:e4:aa:aa
DEBUG | printer:_log_buffer:146 - send: 55:55:f3:01:01:f3:aa:aa
DEBUG | printer:_log_buffer:146 - recv: 55:55:f4:01:01:f4:aa:aa

@MultiMote
Copy link

MultiMote commented Sep 20, 2024

@theopoon you can try to test your B1 here.

If it is working for you, it is unimplemented protocol problem and niimprint need some code changes to make this printer work.

@theopoon
Copy link

@theopoon you can try to test your B1 here.

If it is working for you, it is unimplemented protocol problem and niimprint need some code changes to make this printer work.

Yes, confirm it does work with the link.

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

8 participants