GithubHelp home page GithubHelp logo

michaelrsweet / lprint Goto Github PK

View Code? Open in Web Editor NEW
212.0 21.0 28.0 1.47 MB

A Label Printer Application

Home Page: https://www.msweet.org/lprint

License: Apache License 2.0

Makefile 1.40% C 91.76% M4 1.77% Shell 2.02% CSS 3.04%
ipp zpl dymo

lprint's People

Contributors

abdelq avatar graviszro avatar lgtm-migrator avatar michaelrsweet avatar proski avatar zdohnal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lprint's Issues

How do I uninstall?

I'm new and have been boxing with getting settings right. After failing several times, I tried deleting my botched device/jobs but I can't due to #17. Since that's resolved and on master, I tried building from master instead, but that errored out since it requires PAPPL. Is there a simple way to just delete everything I've installed/configured and start over? Thanks.

Adopt PAPPL framework

This issue is tracking the adoption of my new PAPPL framework for LPrint. PAPPL generalizes a lot of what LPrint does under the covers, which will remove about 3/4ths of the current code and make LPrint easier to maintain and adapt to new label printers in the future.

Linking failed - OSX: no return with 'lprint devices'.

Dear Michael,

I'm trying to compile and install Lprint on OSX 10.15.4 - No errors but make ends with

Linking lprint...
Code-signing lprint...
error: The specified item could not be found in the keychain.
make: *** [lprint] Error 1

Installation works, and lprint is available and seems to work.

But: I'm not getting any return when I try 'lprint devices'. I got one Dymo 4XL connected over USB. 'lprint drivers' returns all drivers.

I tried removing and reinstalling xcode + signing in - no changes.

Kind regards,
Erik

lprint devices: the call to libusb_claim_interface() fails silently with no error message

Hey there. Today is the first time I have compiled and ran your great new program, Unfortunately there seems to be some kind of an issue because the USB device is already in use or 'claimed' here on ubuntu. Despite me having power cycled it. And having deleted the existing printer entries for it in CUPS.

What appears on the screen after plugging the USB back in is 'adding printer...' etc. And then gnome or the OS is automatically re-adding the detected printer back in as some generic text printer device.

So then later on when I am calling your program here lprint devices I have enabled the debug trace logging and added my own trace lines. And I can see it successfully enumerates over all the connected usb devices and finds my label printer.

At this exact point in the code it tries to claim the printer and silently fails because the usb device is already 'claimed' which I assume simply means that it is already in use by another host program.

As a consequence of this the device pointer gets set to NULL and the rest of the routine falls through to the next unknown usb device being enumerated in the loop. Nothing is printed to stdout so there is no program output whatsoever.

Thing is... isn't that a pretty common scenario ? I have been reading here on stack that it might require a call to libusb_detach_kernel_driver() first of all in order to free up the device? That call is nowhere in your code ATM.

Or is there a different bug going on here? Or some other thing I am missing / should be doing elsewhere on the system (for example in udev, to stop the printer being grabbed by the system automatically).

Any help appreciated. Thank you. Just want to get a little bit further so we can assess how different this printer of mine is / if it can work under the existing Zebra driver or needs an entirely new driver for the other TSPL2 printer language.

lprint can't see Dymo LabelWriter

I have a Dymo LabelWriter 450 Twin Turbo hooked up to a Raspberry Pi 3 running Arch Linux (Linux <hostname> 5.5.11-1-ARCH #1 SMP Sun Mar 22 07:43:38 MDT 2020 aarch64 GNU/Linux).

When I start the lprint server via lprint server, and attempt to run lprint devices, no output is printed. However, if I run CUPS's lpinfo -v, I can see (amongst other lines) direct usb://DYMO/LabelWriter%20450%20Twin%20Turbo?serial=12100803191925.

I can add the printer with:

lprint add -d labelwriter -v "usb://DYMO/LabelWriter%20450%20Twin%20Turbo?serial=12100803191925" -m "dymo_lw-450-twin-turbo"

Upon attempting to send a print job, the server process logs the following:

[Printer labelwriter] Unable to open device 'usb://DYMO/LabelWriter%20450%20Twin%20Turbo?serial=12100803191925', pausing queue until printer becomes available.

I understand that aarch64 on the Raspberry Pi is a fairly unusual system to be running, but if you have any thoughts, I'd certainly appreciate them. I'm usually fairly comfortable but a little out of my depth in the printer domain, so apologies if this is lacking obvious debugging/diagnostics/etc. Happy to attempt any troubleshooting you might suggest.

Several other observations...

  • When I exit the lprint server process with Ctrl-C, I get the following:
I [2020-03-26T03:55:59Z] Shutting down main loop.
lprint: thread-watch.c:171: avahi_threaded_poll_lock: Assertion `p' failed.
fish: “lprint server” terminated by signal SIGABRT (Abort)
  • If I try to remove the printer with lprint delete -d labelwriter, I get the following:
lprint: Unable to get information for 'labelwriter' - successful-ok
  • If I add the printer to CUPS directly, I can print to it locally without too much trouble (although not remotely via IPP, although the error I'm getting there seems to be related to Dymo's raster2dymolw).

Last of all, just wanted to say thanks for developing this; it looks like there's been quite the back and forth over on apple/cups#5271, but just wanted to voice my support for your approach.

Code signature problems: dyld: Library not loaded: /usr/local/lib/libpappl.1.dylib

Hi Michael!

I'm getting this error running lprint:

dyld: Library not loaded: /usr/local/lib/libpappl.1.dylib
Referenced from: /usr/local/bin/lprint
Reason: no suitable image found. Did find:
/usr/local/lib/libpappl.1.dylib: code signature in (/usr/local/lib/libpappl.1.dylib) not valid for use in process using Library Validation: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
zsh: abort lprint

OSX: 11.6

Latest github-rep for lprint is used - no problems running .configure, and make is with no errors.

pappl-1.0.3 is used, no problems with .configure and make is with no errors.

Any clue?

Best wishes,
Erik

Support for TSPL Printers

I would like to see the support added for TSPL. TSPL was expanded it to TSPL2 and TSPL put out a massive manual but only TSPL is needed since it has a BITMAP command. Other companies use TSPL and have manuals which may mean they are using TSC components or they re-implemented the language.

Someone actually wrote an image to TSPL converter in javascript but it's really just sending this:

\r\nSIZE `label width` mm, `label height` mm
\r\nSET TEAR ON
\r\nSET CUTTER OFF
\r\nSET PEEL OFF
\r\nDENSITY `darkness`
\r\nCLS
\r\nBITMAP 0,0,`bitmap width`,`bitmap height`,1, `1-bit image data`
\r\nPRINT 1,1
\r\n

If you really wanted, you could send a raw raster data and make a program in TSPL to decode it. However, I'm pretty sure that could be done with ZPL and you didn't do that.

Localization support

Would be nice to have the lprint web interface (at least) use the strings files to localize what is shown.

USB device access broken/does not work.

Installed newest (1.1) version using snap install on fresh install of both debian 11 and raspberry pi OS buster.

On both systems, lprint 1.1 complains similarly about USB devices not being accessable.

There is something wrong with the permissions needed for USB access vs what is granted when lprint is installed via snap.

Support for DYMO LabelWriter Wireless and 5xx

While a driver is listed for the Dymo Labelwriter wireless (LWW), I can't get anything to print on the one I have. I don't get any errors, but nothing prints via usb or network. Looking at the code, it looks like the same driver is being used as for the LW 450 and others. CUPS can't print to the LWW either.

The only thing I've found that can print to the LWW is this project: https://github.com/minlux/dymon. Based on the info there it seems that the LWW is using a different protocol than earlier LWs. :(

Unfortunately, Dymo has not issued any guides for this model that I am aware of. The above project has reverse engineered some of the protocol though.

Is the LWW supposed to work?

Static file resources

Right now each of the static file resources (PNG and strings files) are manually tracked. Need to update server-client.c to maintain a static array of resources with filename, content type, size (0 for C string?), and a pointer to the data. The lprintProcessHTTP can look them up and respond accordingly.

LGTM build is failing.

I literally only changed strings in my PR, so it should build. I'm assuming this is a configuration issue with LGTM.

From the error log:

[2022-02-11 14:42:58] [ERROR] Spawned process exited abnormally (code 1; tried to run: [/opt/dist/tools/linux64/preload_tracer, /opt/dist/cpp/tools/do-build])
[2022-02-11 14:42:58] [build-stderr] A fatal error occurred: Exit status 1 from command: [/opt/dist/cpp/tools/do-build]
[2022-02-11 14:42:58] [build-stderr] deptrace-server: received exit command
[2022-02-11 14:42:59] [ERROR] Spawned process exited abnormally (code 2; tried to run: [/opt/work/lgtm-workspace/lgtm/extract.sh])
A fatal error occurred: Exit status 2 from command: [/opt/work/lgtm-workspace/lgtm/extract.sh]

Choose media options listings either metric or non-metric?

Hi,

When issuing

`lprint options -d <printer>`

Would it be possible to get the sizes also defined/listed in metric sizes?
Maybe a way to globally (to lprint) choose one or the other as default?
I did look in the code and unless I am mistaken the sizes where only defined in inches, but also having them in metric might be a useful thing?
Personally I don't usually use inches, especially not fractional inches, so they are kind of confusing to be presented with. I would imagine I'm not the only one. :-)

Thanks
KarlMag

Can lprint support the xprinter xp-460b aka TCL TDP-247 on linux ?

Got here from apple/cups#5092 (comment)

via

apple/cups#5271 (comment)

Thank you for this project so much. It looks great. I hope that it can work with these TSPL2 language printers.

All of my findings about this specific printer's supplied linux driver were already written over on there cups issue tracker.

I shall also be running the TSC Diagnostic utility on it (windows) and post any further results as to find out if there are any other types of printer languages which it supports other than the TSPL2 described in it's PPD file. Have not had any time whatsoever to look into lprint itself just yet. Having only recently found it from your other recent comment on the future of CUPS roadmap.

BTW there are also seems to be some windows "SDK" development kit tools on the same drivers download page. However they seem to be closed source too. Providing some percompiled dll API to interface with. Same with the iOS SDK it's also a precompiled .a static lib. However perhaps we don't need any of that.

Support for Zebra EPL2 Printers requested.

There are a zillion Zebra 2844 printers out there that do not support ZPL .. they use EPL2.

I use 5 of them for printing USPS and Fedex labels.

Could you add support for EPL2 in the upcoming 1.1 release?

It appears some of the supporting code for EPL2 support is already in there.

can't seem to set certain printer options

Hi again,
So continuing on from issue #6. I am testing / trying to use lprint with my xprinter xp-460b with the driver named zpl_4inch-203dpi-dt. Because that is the only one of the Zebra devices which seems to generally match my printer.

However it's not feeding right, and flashing after 1 print (as if the feeding is broken). And it only prints out the first 4 inches of the print.

Anyhow I wanted to try setting some of these printer options. In the hopes that it will then make the feeding work better etc. And maybe resolve some of these issues. Unfortunately this is not something that is working for me yet. And I'm not really sure why.

Here is the full list of print options I see getting reported back to me when i query lprint option

$ lprint options
Print job options:
  -n COPIES
  -o media=oe_4x6-label_4x6in (default)
  -o media=oe_1.25x0.25-label_1.25x0.25in
  -o media=oe_1.25x2.25-label_1.25x2.25in
  -o media=oe_1.5x0.25-label_1.5x0.25in
  -o media=oe_1.5x0.5-label_1.5x0.5in
  -o media=oe_1.5x1-label_1.5x1in
  -o media=oe_1.5x2-label_1.5x2in
  -o media=oe_2x0.37-label_2x0.37in
  -o media=oe_2x0.5-label_2x0.5in
  -o media=oe_2x1-label_2x1in
  -o media=oe_2x1.25-label_2x1.25in
  -o media=oe_2x2-label_2x2in
  -o media=oe_2x3-label_2x3in
  -o media=oe_2x4-label_2x4in
  -o media=oe_2x5.5-label_2x5.5in
  -o media=oe_2.25x0.5-label_2.25xin
  -o media=oe_2.25x1.25-label_2.25xin
  -o media=oe_30859-paint-can-label_2.25x3.125in
  -o media=oe_2.25x4-label_2.25x4in
  -o media=oe_2.25x5.5-label_2.25x5.5in
  -o media=oe_2.38x5.5-label_2.38x5.5in
  -o media=oe_2.5x1-label_2.5x1in
  -o media=oe_2.5x2-label_2.5x2in
  -o media=oe_2.75x1.25-label_2.75x1.25in
  -o media=oe_2.9x1-label_2.9x1in
  -o media=oe_3x1-label_3x1in
  -o media=oe_3x1.25-label_3x1.25in
  -o media=oe_3x2-label_3x2in
  -o media=oe_3x3-label_3x3in
  -o media=na_index-3x5_3x5in
  -o media=oe_3.25x2-label_3.25x2in
  -o media=oe_3.25x5-label_3.25x5in
  -o media=oe_3.25x5.5-label_3.25x5.5in
  -o media=oe_3.25x5.83-label_3.25x5.83in
  -o media=oe_3.25x7.83-label_3.25x7.83in
  -o media=oe_3.5x1-label_3.5x1in
  -o media=oe_4x1-label_4x1in
  -o media=oe_4x2-label_4x2in
  -o media=oe_4x3-label_4x3in
  -o media=oe_4x4-label_4x4in
  -o media=oe_4x5-label_4x5in
  -o media=na_index-4x6_4x6in
  -o media=oe_4x6.5-label_4x6.5in
  -o media=oe_4x13-label_4x13in
  -o media=roll_max_4x39.6in
  -o media=roll_min_0.75x0.25in
  -o media-source=main-roll (default)
  -o media-top-offset=0in (default)
  -o media-top-offset=-15mm to 15mm
  -o media-tracking=mark (default)
  -o media-tracking=continuous
  -o media-tracking=web
  -o media-type=labels (default)
  -o media-type=continuous
  -o media-type=labels-continuous
  -o orientation-requested=none (default)
  -o orientation-requested=portrait
  -o orientation-requested=landscape
  -o orientation-requested=reverse-landscape
  -o orientation-requested=reverse-portrait
  -o print-color-mode=monochrome (default)
  -o print-color-mode=bi-level
  -o print-content-optimize=auto (default)
  -o print-content-optimize=graphic
  -o print-content-optimize=photo
  -o print-content-optimize=text-and-graphic
  -o print-content-optimize=text
  -o print-darkness=-100 to 100
  -o print-quality=normal (default)
  -o print-quality=draft
  -o print-quality=high
  -o print-speed=1in to 12in
  -o printer-resolution=203dpi
  -t 'TITLE'

Printer options:
  -o label-tear-offset=-15mm to 15mm
  -o printer-darkness=0 to 100
  -o printer-geo-location='geo:LATITUDE,LONGITUDE'
  -o printer-location='LOCATION'
  -o printer-organization='ORGANIZATION'
  -o printer-organizational-unit='UNIT/SECTION'

Ok... so I try to use lprint modify ... to change some of the paper feeding options. The change does not seem to have any effect.

Ok... so I try to append the options manually each time I print something, by adding them directly to the lprint submit command. Like this:

$ lprint -o printer-resolution=203dpi -o media-tracking=continuous -o media-type=labels-continuous -o media=na_index-4x6_4x6in -o orientation-requested=portrait pdf-label_portrait.png
lprint: Unable to print 'pdf-label_portrait.png' - Unsupported printer-resolution resolution value.

And it won't accept the option. Ok so does that mean

  1. it's not supported by the driver i selected?

  2. Or does it mean that lprint has tried to communicate with my printer (using ZPL) and then via ZPL language the printer I have here will not let lprint to set that option to it?

  3. Or is this supposed to be a global (not printer specific option), does it mean some other problem?

OK so resolution is not supported. When I remove that option I just get a different error for the other settings:

$ lprint submit -o media-tracking=continuous -o media-type=labels-continuous -o media=na_index-4x6_4x6in -o orientation-requested=portrait pdf-label_portrait.png
lprint: Unable to print 'pdf-label_portrait.png' - Unsupported media-col collection value.
$ lprint submit -o media-type=labels-continuous -o media=na_index-4x6_4x6in -o orientation-requested=portrait pdf-label_portrait.png
lprint: Unable to print 'pdf-label_portrait.png' - Unsupported media-col collection value.
$ lprint submit -o media=na_index-4x6_4x6in -o orientation-requested=portrait pdf-label_portrait.png
lprint: Unable to print 'pdf-label_portrait.png' - Unsupported media-col collection value.

It finaly accepts just the last portrait option in the list of options that were tried:

$ lprint submit -o orientation-requested=portrait pdf-label_portrait.png
xprinter-xp-460b-3

This then prints out the first 4 inches of this PNG test label image, who's specs are:

$ identify pdf-label_portrait.png 
pdf-label_portrait.png PNG 812x1218 926x1389+52+166 8-bit Gray 256c 55293B 0.000u 0:00.000

And the red light is flashing. At least the feed mechanism seems to have stopped at approximately the correct tear off point. I tear the label off and press the feed button once, that is currently flashing red. The printer then feeds out about 1.5 labels worh approx (these are 4x6 labels in a roll). And makes a positive chirp noise through it's internal speaker. The red light around the button is still flashing.

So that's usually the point where I power cycle the printer and manually re-feed the labels back onto the roll. So they don't all get wasted.

I don't suppose you happen to have any ideas / suggestions?

Currently my other option currently is to perhaps abandon lprint for now and try instead this https://github.com/kylemacfarlane/zplgrf python project. Which claims to fix the dithering by being a CUPS filter. So you plug it into CUPS ppd file. And see. Unfortunately that other project I cannot try it out yet. As cannot find the executable comdline program which it claims to install! Which is a shame because that is really my only issue with using the TSC driver over in CUPS that the dithering is broken.

Still hoping we can get lprint working at some point too. As this is also a very important piece of software going forwards.

Left Margin on Dymo LabelWriter 450

I am very close to creating a barcode label kiosk using lprint and a raspberry pi 400 running Buster. This is a giant leap from the 8 second delay that CUPS creates betweeen jobs. No matter what settings I use, it appears that lprint is attempting to center the label across the entire width of the dymo printer. This printer has a maximum label width of about 2.5 inches. When you load a smaller label, you cannot center it in the carriage. You have to left-align the roll. If I print a larger label size, it still attempts to center it across the entire carriage. I am printing 1x1 labels and I only get about the left 1/8" of the image on the label. Everyting else is hanging off to the right. I understand this uses the cups 1/100mm measurements for margins but I can't figure out how to change them as -o options and the current ones in .lprint.conf don't match what I am seeing on the paper. I apologize if this issue is covered somewhere else. I can't seem to find anything about it in the documentation, man pages, cups programming manuals, etc.

Support for Seiko Smart Label Printers

Many of these printers are not supported by cups (pre-SLP 100 models) but are readily available and quite serviceable but do not have driver support. Error handling in CUPS is lacking (wrong labels loaded etc.). Slap had support for these printers, but it is a command line only solution, not really suitable for end users and does not support newer models (post-SLP 240 models). Thank you for you consideration. Thanks and cheers.

macOS package doesn't start/load LPrint server automatically

I'm running lprint 1.1.0, installed via the pkg here on github.

I can run lprint devices and see the printer, but I can't add the printer.

Any ideas?

❯ sw_vers
ProductName:	macOS
ProductVersion:	12.1
BuildVersion:	21C52

~
❯ lprint devices
snmp://amandas-printer
usb://Zebra%20/LP2844%20?serial=42J112901277

~ took 4s
❯ lprint add -d zebra -v 'usb://Zebra%20/LP2844%20?serial=42J112901277' -m epl2_4inch-203dpi-dt
lprint: Unable to start server: Bad file descriptor

~
❯ lprint add -d zebra -v usb://Zebra%20/LP2844%20?serial=42J112901277 -m epl2_4inch-203dpi-dt
lprint: Unable to start server: Bad file descriptor

~
❯ sudo lprint add -d zebra -v usb://Zebra%20/LP2844%20?serial=42J112901277 -m epl2_4inch-203dpi-dt
lprint: Unable to start server: Bad file descriptor

~
❯ sudo lprint add -d zebra -v 'usb://Zebra%20/LP2844%20?serial=42J112901277' -m epl2_4inch-203dpi-dt
lprint: Unable to start server: Bad file descriptor

~
❯ lprint drivers
lprint: statefile='/Users/wolf/.lprint.conf'
E [2022-01-01T19:37:50.935Z] [Device] Unable to claim USB interface: Access denied (insufficient permissions)
dymo_lm-400 "DYMO LabelMANAGER 400" "MFG:DYMO;MDL:LabelMANAGER 400 ;"
dymo_lm-450 "DYMO LabelMANAGER 450" "MFG:DYMO;MDL:LabelMANAGER 450 ;"
dymo_lm-pc "DYMO LabelMANAGER PC" "MFG:DYMO;MDL:LabelMANAGER PC ;"
dymo_lm-pc-ii "DYMO LabelMANAGER PC II" "MFG:DYMO;MDL:LabelMANAGER PC II ;"
dymo_lm-pnp "DYMO LabelMANAGER PNP" "MFG:DYMO;MDL:LabelMANAGER PNP ;"
dymo_lp-350 "DYMO LabelPOINT 350" "MFG:DYMO;MDL:LabelPOINT 350 ;"
dymo_lw-300 "DYMO LabelWriter 300" "MFG:DYMO;MDL:LabelWriter 300;"
dymo_lw-310 "DYMO LabelWriter 310" "MFG:DYMO;MDL:LabelWriter 310;"
dymo_lw-315 "DYMO LabelWriter 315" "MFG:DYMO;MDL:LabelWriter 315;"
dymo_lw-320 "DYMO LabelWriter 320" "MFG:DYMO;MDL:LabelWriter 320;"
dymo_lw-330 "DYMO LabelWriter 330" "MFG:DYMO;MDL:LabelWriter 330;"
dymo_lw-330-turbo "DYMO LabelWriter 330 Turbo" "MFG:DYMO;MDL:LabelWriter 330 Turbo;"
dymo_lw-400 "DYMO LabelWriter 400" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-400-turbo "DYMO LabelWriter 400 Turbo" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-450 "DYMO LabelWriter 450" "MFG:DYMO;MDL:LabelWriter 450;"
dymo_lw-450-duo-label "DYMO LabelWriter 450 DUO Label" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-450-duo-tape "DYMO LabelWriter 450 DUO Tape" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-450-turbo "DYMO LabelWriter 450 Turbo" "MFG:DYMO;MDL:LabelWriter 450 Turbo;"
dymo_lw-450-twin-turbo "DYMO LabelWriter 450 Twin Turbo" "MFG:DYMO;MDL:LabelWriter 450 Twin Turbo;"
dymo_lw-4xl "DYMO LabelWriter 4XL" "MFG:DYMO;MDL:LabelWriter 4XL;"
dymo_lw-duo-label "DYMO LabelWriter DUO Label" "MFG:DYMO;MDL:LabelWriter DUO Label;"
dymo_lw-duo-tape "DYMO LabelWriter DUO Tape" "MFG:DYMO;MDL:LabelWriter DUO Tape;"
dymo_lw-duo-tape-128 "DYMO LabelWriter DUO Tape 128" "MFG:DYMO;MDL:LabelWriter DUO Tape 128;"
dymo_lw-se450 "DYMO LabelWriter SE450" "MFG:DYMO;MDL:LabelWriter SE450;"
epl2_2inch-203dpi-dt "Zebra ZPL 2-inch/203dpi/Direct-Thermal" ""
epl2_2inch-203dpi-tt "Zebra ZPL 2-inch/203dpi/Thermal-Transfer" ""
epl2_2inch-300dpi-dt "Zebra ZPL 2-inch/300dpi/Direct-Thermal" ""
epl2_2inch-300dpi-tt "Zebra ZPL 2-inch/300dpi/Thermal-Transfer" ""
epl2_4inch-203dpi-dt "Zebra ZPL 4-inch/203dpi/Direct-Thermal" "COMMAND SET:EPL;"
epl2_4inch-203dpi-tt "Zebra ZPL 4-inch/203dpi/Thermal-Transfer" ""
epl2_4inch-300dpi-dt "Zebra ZPL 4-inch/300dpi/Direct-Thermal" ""
epl2_4inch-300dpi-tt "Zebra ZPL 4-inch/300dpi/Thermal-Transfer" ""
zpl_2inch-203dpi-dt "Zebra ZPL 2-inch/203dpi/Direct-Thermal" ""
zpl_2inch-203dpi-tt "Zebra ZPL 2-inch/203dpi/Thermal-Transfer" ""
zpl_2inch-300dpi-dt "Zebra ZPL 2-inch/300dpi/Direct-Thermal" ""
zpl_2inch-300dpi-tt "Zebra ZPL 2-inch/300dpi/Thermal-Transfer" ""
zpl_2inch-600dpi-tt "Zebra ZPL 2-inch/600dpi/Thermal-Transfer" ""
zpl_4inch-203dpi-dt "Zebra ZPL 4-inch/203dpi/Direct-Thermal" ""
zpl_4inch-203dpi-tt "Zebra ZPL 4-inch/203dpi/Thermal-Transfer" ""
zpl_4inch-300dpi-dt "Zebra ZPL 4-inch/300dpi/Direct-Thermal" ""
zpl_4inch-300dpi-tt "Zebra ZPL 4-inch/300dpi/Thermal-Transfer" ""
zpl_4inch-600dpi-tt "Zebra ZPL 4-inch/600dpi/Thermal-Transfer" ""

~
❯ sudo lprint drivers
lprint: statefile='/Users/wolf/.lprint.conf'
E [2022-01-01T19:37:58.347Z] [Device] Unable to claim USB interface: Access denied (insufficient permissions)
dymo_lm-400 "DYMO LabelMANAGER 400" "MFG:DYMO;MDL:LabelMANAGER 400 ;"
dymo_lm-450 "DYMO LabelMANAGER 450" "MFG:DYMO;MDL:LabelMANAGER 450 ;"
dymo_lm-pc "DYMO LabelMANAGER PC" "MFG:DYMO;MDL:LabelMANAGER PC ;"
dymo_lm-pc-ii "DYMO LabelMANAGER PC II" "MFG:DYMO;MDL:LabelMANAGER PC II ;"
dymo_lm-pnp "DYMO LabelMANAGER PNP" "MFG:DYMO;MDL:LabelMANAGER PNP ;"
dymo_lp-350 "DYMO LabelPOINT 350" "MFG:DYMO;MDL:LabelPOINT 350 ;"
dymo_lw-300 "DYMO LabelWriter 300" "MFG:DYMO;MDL:LabelWriter 300;"
dymo_lw-310 "DYMO LabelWriter 310" "MFG:DYMO;MDL:LabelWriter 310;"
dymo_lw-315 "DYMO LabelWriter 315" "MFG:DYMO;MDL:LabelWriter 315;"
dymo_lw-320 "DYMO LabelWriter 320" "MFG:DYMO;MDL:LabelWriter 320;"
dymo_lw-330 "DYMO LabelWriter 330" "MFG:DYMO;MDL:LabelWriter 330;"
dymo_lw-330-turbo "DYMO LabelWriter 330 Turbo" "MFG:DYMO;MDL:LabelWriter 330 Turbo;"
dymo_lw-400 "DYMO LabelWriter 400" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-400-turbo "DYMO LabelWriter 400 Turbo" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-450 "DYMO LabelWriter 450" "MFG:DYMO;MDL:LabelWriter 450;"
dymo_lw-450-duo-label "DYMO LabelWriter 450 DUO Label" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-450-duo-tape "DYMO LabelWriter 450 DUO Tape" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-450-turbo "DYMO LabelWriter 450 Turbo" "MFG:DYMO;MDL:LabelWriter 450 Turbo;"
dymo_lw-450-twin-turbo "DYMO LabelWriter 450 Twin Turbo" "MFG:DYMO;MDL:LabelWriter 450 Twin Turbo;"
dymo_lw-4xl "DYMO LabelWriter 4XL" "MFG:DYMO;MDL:LabelWriter 4XL;"
dymo_lw-duo-label "DYMO LabelWriter DUO Label" "MFG:DYMO;MDL:LabelWriter DUO Label;"
dymo_lw-duo-tape "DYMO LabelWriter DUO Tape" "MFG:DYMO;MDL:LabelWriter DUO Tape;"
dymo_lw-duo-tape-128 "DYMO LabelWriter DUO Tape 128" "MFG:DYMO;MDL:LabelWriter DUO Tape 128;"
dymo_lw-se450 "DYMO LabelWriter SE450" "MFG:DYMO;MDL:LabelWriter SE450;"
epl2_2inch-203dpi-dt "Zebra ZPL 2-inch/203dpi/Direct-Thermal" ""
epl2_2inch-203dpi-tt "Zebra ZPL 2-inch/203dpi/Thermal-Transfer" ""
epl2_2inch-300dpi-dt "Zebra ZPL 2-inch/300dpi/Direct-Thermal" ""
epl2_2inch-300dpi-tt "Zebra ZPL 2-inch/300dpi/Thermal-Transfer" ""
epl2_4inch-203dpi-dt "Zebra ZPL 4-inch/203dpi/Direct-Thermal" "COMMAND SET:EPL;"
epl2_4inch-203dpi-tt "Zebra ZPL 4-inch/203dpi/Thermal-Transfer" ""
epl2_4inch-300dpi-dt "Zebra ZPL 4-inch/300dpi/Direct-Thermal" ""
epl2_4inch-300dpi-tt "Zebra ZPL 4-inch/300dpi/Thermal-Transfer" ""
zpl_2inch-203dpi-dt "Zebra ZPL 2-inch/203dpi/Direct-Thermal" ""
zpl_2inch-203dpi-tt "Zebra ZPL 2-inch/203dpi/Thermal-Transfer" ""
zpl_2inch-300dpi-dt "Zebra ZPL 2-inch/300dpi/Direct-Thermal" ""
zpl_2inch-300dpi-tt "Zebra ZPL 2-inch/300dpi/Thermal-Transfer" ""
zpl_2inch-600dpi-tt "Zebra ZPL 2-inch/600dpi/Thermal-Transfer" ""
zpl_4inch-203dpi-dt "Zebra ZPL 4-inch/203dpi/Direct-Thermal" ""
zpl_4inch-203dpi-tt "Zebra ZPL 4-inch/203dpi/Thermal-Transfer" ""
zpl_4inch-300dpi-dt "Zebra ZPL 4-inch/300dpi/Direct-Thermal" ""
zpl_4inch-300dpi-tt "Zebra ZPL 4-inch/300dpi/Thermal-Transfer" ""
zpl_4inch-600dpi-tt "Zebra ZPL 4-inch/600dpi/Thermal-Transfer" ""

Custom media dimensions or printable area for Dymo LabelWriter

I'm trying to print from a Dymo LabelWriter 450 Twin Turbo to these die-cut labels. From the template for Dymo's software provided by the manufacturer (reproduced in this gist), these labels are derived from Dymo's #30299 price tag label, which seems to correspond to oe_price-tag-label_0.9375x0.875in.

If I attempt to print the test pattern below with lprint -o media=oe_price-tag-label_0.9375x0.875in -o media-source=alternate-roll labtag081_testpattern.png, the printed area does not span the full width of the label:


Input:
labtag081_testpattern

Result:
print_result


If I add empty padding on the left side of the test pattern, it just shrinks the printed size, it doesn't shift it to the right. Is there a way to re-define the "printable area" of a label, or define custom margins or label types?

Thank you!

lprint command issues

I use Zebra label printers shared from Windows PCs which causes me some issues. Lprint running on a single board Linux computer looks like perfect solution to my sharing issues so I purchased a FriendlyARM NanoPi NEO-LTS 512MB to act as a print server. I installed the FriendlyCore image with Ubuntu Core 16.04.7 kernel 4.14.111 and fully upgraded and updated it before installing the lprint snap. I also installed the edge snap of cups to install version 2.4. I also installed libusb-1.0 and libpng16-16 so I think I have all the dependencies covered.

I have a couple of problems running lprint which I’m hoping you can help me with please, I’m running these as root.

  1. When I run the command lprint server -o server-name=ps1 -o server-port=80 I get the message “Ignored Avahi state 101.” and it I don’t get the command prompt back. The server is running and I can view the lprint Printers page from a browser. I was unsure of the avahi version so I tried installing an avahi snap taking it to version 0.8, after that I received the message “Ignored Avahi state 101.” instead.

  2. I have a Zebra GK420D connected via USB and can see it when I run lsusb however when I run lprint devices I get the message “lprint: Unable to initialize USB access: Other error”. I did see the other issue regarding permissions but I’m running the command as root.

  3. If I run ps ax | grep lprint I can see that lprint appears to be running. If I then run lprint shutdown I get the message “lprint: Unable to shutdown server – Success” and lprint still appears to be running.

If you have any advice on what I should try next that would be greatly appreciated as I’ve exhausted my knowledge and the info I can find online. Thank you.

Web Interface with PAM-based HTTP Basic Auth

lprint should expand the current read-only web interface with one that can manage printers and defaults. This web interface needs to be authenticated as well.

  • PAM authentication
  • lprint -u support for add, modify, and delete
  • Add printer interface
  • Modify printer interface to set defaults and media-ready
  • Delete printer interface

'devices' sub-command gives error message

lprint installed fine, but the command 'lprint devices' gives the message:

lprint: Unable to initialize USB access: Other error

However, 'lprint drivers' gives the expected output. My printers are all network connected - there are no USB printers involved. My system is running the latest version of LinuxFX which is based on Ubuntu 20.04 with a modified interface that strongly resembles Windows 10. Are there some other sub-commands I should try in order to help identify this problem?

Unable to start lprint server: Bad file descriptor

I builded Lprint with Xcode on Ma Os (10.15), but I am unable to add device:

I found DEVICE-URI with lprint devices, then I ran:

$sudo lprint add -d zd220 -v usb://Zebra%20Technologies%20/ZTC%20ZD220-203dpi%20ZPL?serial=myserial -m zpl_4inch-203dpi-dt
subcommand='add'
num_options=3
options[0].name='device-uri', value='usb://Zebra%20Technologies%20/ZTC%20ZD220-203dpi%20ZPL?serial=myserial'
options[1].name='lprint-driver', value='zpl_4inch-203dpi-dt'
options[2].name='printer-name', value='zd220'
num_files=0
Unable to start lprint server: Bad file descriptor

systemd service file in wrong directory

When preparing the Debian package of lprint, lintian complains:
E: lprint: systemd-service-file-outside-lib etc/systemd/system/lprint.service
N:
N: The package ships a systemd service file outside /lib/systemd/system/
N:
N: Systemd in Debian searches for unit files in /lib/systemd/system/ and
N: /etc/systemd/system. Notably, it does not look in
N: /usr/lib/systemd/system/ for service files.
N:
N: System administrators should have the possibility to overwrite a
N: service file (or parts of it, in newer systemd versions) by placing a
N: file in /etc/systemd/system, so the canonical location used for
N: service files is /lib/systemd/system/.

Do you mind changing the directory of the service file to /lib/systemd/system?

Thorsten

Can't remove printer with lprint delete

When I try to delete a printer using lprint delete, a non-zero exit status is returned and the printer is not deleted.

$ lprint status
Running, idle since Thu, 26 Mar 2020 20:12:59 GMT
$ lprint printers
test-labelwriter
$ lprint delete -d test-labelwriter
lprint: Unable to get information for 'test-labelwriter' - successful-ok
<exit status=1>
$ lprint printers
test-labelwriter

Let me know if there's any other debugging information I can provide — thanks!


Printer: Dymo LabelWriter 450 Twin Turbo
System: Linux <hostname> 5.5.11-1-ARCH #1 SMP Sun Mar 22 07:43:38 MDT 2020 aarch64 GNU/Linux

Printing to tape on LabelWriter DUO

I am trying to get my automatic label creation script working using lprint, as apparently I should do that (moving it away from cups).
At first I succeeded almost, but now all my labels are printed with an offset (first part of the label is skipped, printing starts too late, then doesn't fit the label and the rest is printed on the next label).
Apparently it's not an issue with the printer or the label roll, as it always feeds to the correct point (where tearing is exactly between two labels). I already power cycled the printer a few times and re-created the printer, but no improvement.
Also I wonder what resolution to use best for the png. I am using this label "oe_sm-multipurpose-label_1x2.125in" (Dymo 11352 labels). Printing at 300 dpi, I guess I should use 300 x 637 pixels but I can't get lprint to no touch the image (NOT scale it). I also had this problem with cups. It always leaves some space on one side, depending on what dimension is altered. I don't want that, I want 1:1 pixel printing, so any pixel falling off the printing area, should be simply ignored. Otherwise I can't make reliable/reproducable labels. Is that possible?

Support for Munbyn ITPP941

I was able to modify rastertolabel in CUPS to support Munbyn ITPP941. I verified the code behavior on MacOS against Munbyn's own rastertolabel from its MacOS driver. I was able to achieve exactly the same output. I tried changing all options and I was able to figure out how they affect the output.

The code is available here: https://github.com/proski/cups/blob/beeprt/filter/rastertolabel.c
The diff: proski/cups@9ade138

Beeprt and Rollo label printers are apparently compatible, but I cannot guarantee anything, as I don't have them. I know they share the same closed-source Linux CUPS filter called rastertolabelbeeprt (it has some bugs compared to the MacOS version). Munbyn drivers for Windows use "beeprt" in the driver names. So I tried to follow the pattern and used BEEPRT as the symbol.

cupsModelNumber 20 is used in PPDs of all three devices. While it's not the choice of CUPS developers, I believe it can be accommodated.

There is also a new 300 dpi model on Munbyn, called ITPP988. I could not get its filter run on MacOS without the hardware (it actually needs the PRINTER environment variable to point to the printer name, and rejects the model I have). However, I did my best to write the code that would likely accommodate that printer. The 203 dpi model assumes exactly 8 dots per millimeter, so I assume the 300 dpi model is using 12 dots per millimeter.

Anyway, that code needs to be ported to lprint if it cannot be merged to CUPS.

I'm going to try it, but I would welcome comments about my code for far and ideas how to proceed.

ZEBRA EPL2 Drivers are mislabeled as ZPL

lprint drivers
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
lprint: statefile='/var/snap/lprint/215/lprint.conf'
E [2022-01-20T02:52:13.873Z] [Device] Unable to initialize USB access: Other error
dymo_lm-400 "DYMO LabelMANAGER 400" "MFG:DYMO;MDL:LabelMANAGER 400 ;"
dymo_lm-450 "DYMO LabelMANAGER 450" "MFG:DYMO;MDL:LabelMANAGER 450 ;"
dymo_lm-pc "DYMO LabelMANAGER PC" "MFG:DYMO;MDL:LabelMANAGER PC ;"
dymo_lm-pc-ii "DYMO LabelMANAGER PC II" "MFG:DYMO;MDL:LabelMANAGER PC II ;"
dymo_lm-pnp "DYMO LabelMANAGER PNP" "MFG:DYMO;MDL:LabelMANAGER PNP ;"
dymo_lp-350 "DYMO LabelPOINT 350" "MFG:DYMO;MDL:LabelPOINT 350 ;"
dymo_lw-300 "DYMO LabelWriter 300" "MFG:DYMO;MDL:LabelWriter 300;"
dymo_lw-310 "DYMO LabelWriter 310" "MFG:DYMO;MDL:LabelWriter 310;"
dymo_lw-315 "DYMO LabelWriter 315" "MFG:DYMO;MDL:LabelWriter 315;"
dymo_lw-320 "DYMO LabelWriter 320" "MFG:DYMO;MDL:LabelWriter 320;"
dymo_lw-330 "DYMO LabelWriter 330" "MFG:DYMO;MDL:LabelWriter 330;"
dymo_lw-330-turbo "DYMO LabelWriter 330 Turbo" "MFG:DYMO;MDL:LabelWriter 330 Turbo;"
dymo_lw-400 "DYMO LabelWriter 400" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-400-turbo "DYMO LabelWriter 400 Turbo" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-450 "DYMO LabelWriter 450" "MFG:DYMO;MDL:LabelWriter 450;"
dymo_lw-450-duo-label "DYMO LabelWriter 450 DUO Label" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-450-duo-tape "DYMO LabelWriter 450 DUO Tape" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-450-turbo "DYMO LabelWriter 450 Turbo" "MFG:DYMO;MDL:LabelWriter 450 Turbo;"
dymo_lw-450-twin-turbo "DYMO LabelWriter 450 Twin Turbo" "MFG:DYMO;MDL:LabelWriter 450 Twin Turbo;"
dymo_lw-4xl "DYMO LabelWriter 4XL" "MFG:DYMO;MDL:LabelWriter 4XL;"
dymo_lw-duo-label "DYMO LabelWriter DUO Label" "MFG:DYMO;MDL:LabelWriter DUO Label;"
dymo_lw-duo-tape "DYMO LabelWriter DUO Tape" "MFG:DYMO;MDL:LabelWriter DUO Tape;"
dymo_lw-duo-tape-128 "DYMO LabelWriter DUO Tape 128" "MFG:DYMO;MDL:LabelWriter DUO Tape 128;"
dymo_lw-se450 "DYMO LabelWriter SE450" "MFG:DYMO;MDL:LabelWriter SE450;"
epl2_2inch-203dpi-dt "Zebra ZPL 2-inch/203dpi/Direct-Thermal" ""
epl2_2inch-203dpi-tt "Zebra ZPL 2-inch/203dpi/Thermal-Transfer" ""
epl2_2inch-300dpi-dt "Zebra ZPL 2-inch/300dpi/Direct-Thermal" ""
epl2_2inch-300dpi-tt "Zebra ZPL 2-inch/300dpi/Thermal-Transfer" ""
epl2_4inch-203dpi-dt "Zebra ZPL 4-inch/203dpi/Direct-Thermal" "COMMAND SET:EPL;"
epl2_4inch-203dpi-tt "Zebra ZPL 4-inch/203dpi/Thermal-Transfer" ""
epl2_4inch-300dpi-dt "Zebra ZPL 4-inch/300dpi/Direct-Thermal" ""
epl2_4inch-300dpi-tt "Zebra ZPL 4-inch/300dpi/Thermal-Transfer" ""
zpl_2inch-203dpi-dt "Zebra ZPL 2-inch/203dpi/Direct-Thermal" ""
zpl_2inch-203dpi-tt "Zebra ZPL 2-inch/203dpi/Thermal-Transfer" ""
zpl_2inch-300dpi-dt "Zebra ZPL 2-inch/300dpi/Direct-Thermal" ""
zpl_2inch-300dpi-tt "Zebra ZPL 2-inch/300dpi/Thermal-Transfer" ""
zpl_2inch-600dpi-tt "Zebra ZPL 2-inch/600dpi/Thermal-Transfer" ""
zpl_4inch-203dpi-dt "Zebra ZPL 4-inch/203dpi/Direct-Thermal" ""
zpl_4inch-203dpi-tt "Zebra ZPL 4-inch/203dpi/Thermal-Transfer" ""
zpl_4inch-300dpi-dt "Zebra ZPL 4-inch/300dpi/Direct-Thermal" ""
zpl_4inch-300dpi-tt "Zebra ZPL 4-inch/300dpi/Thermal-Transfer" ""
zpl_4inch-600dpi-tt "Zebra ZPL 4-inch/600dpi/Thermal-Transfer" ""

All of the epl2_xxxx drivers above are labeled "Zebra ZPL...."

Improve server-mode documentation

Would it be possible to clearly document how to configure lprint as a autostart server daemon with an example ?

I would imagine many users of this software would be installing it on an inexpensive device such as a raspberry pi to create "airprint" enabled label printers. The docs describing the server functionality currently don't clearly show how to do this. If you run "lprint server" you have a process that is still attached to the initiating shell, not a background server.

Save server configuration & start as daemon

Dear michaelrsweet,

Thanks for your hard work!
I have some questions regarding the server mode.
What I want to achieve is making a Dymo 450 Duo available to a
cups server on another server (same network).
This works, but there is a problem.

"lprint server -o server-port=8631 -o server-name=dietpi &"
I'm using this command as an autostart on a Raspberry Pi Zero W with DietPi.

So my questions are:
Is there another way of "daemonizing" the server?
I've installed the package with apt. lib-cups and some other needed packages were installed,
but no full cups.
Is there another auth-server than cups, which can be used? Maybe system users?

--
Also I cannot modify the printers. :'(
We're using yellow DYMO D1 as tape (12x7000mm) and white LW Adress Labels (36x89mm) as labels (dymo-450-label)

user@DietPi:~# lprint modify -d dymo-450-tape -o print-content-optimize=text
lprint: Unable to modify printer - Unsupported print-content-optimize-mode-default keyword value.

Support for Configuring/Saving Custom Label Sizes

I like to define some custom label sizes for a ZPL printer.
My understanding, all media options are predefined in lpirnt-zpl.c as lprint_zpl_2inch_media respective lprint_zpl_4inch_media.
I like to define something like om_label_100x150mm or om_label_40x25mm?
It would be nice, if somebody can point me in right direction, where to change it in addition?
Thanks in advance

Unable to start server: Bad file descriptor

Hi,
I am running MacOS 12.2.1 and downloaded your prebuilt .pkg (v1.1.0) from the releases page and I am unable to add a new printer. If I run the add command, I always get the following error:

❯ lprint add -d ZebraLP2844 -v socket://192.168.111.76 -m epl2_4inch-203dpi-dt
lprint: Unable to start server: Bad file descriptor

Can you help me out? Thanks!

Delete still broken after 2c541b50

Expected

After adding a printer named fred, running lprint delete -d fred afterward lprint printers should not show the printer fred.

Actual

lprint delete -d fred gives an error message, and the printer fred remains visible with lprint printers.

Reproduce Steps

Build pappl and lprint using branch fix-delete in my fork

tmp=$(mktemp -d /tmp/lprint.XXX)
mkdir $tmp
cd $tmp
git clone -b fix-delete https://github.com/cslauritsen/lprint
git clone https://github.com/cslauritsen/pappl

cat <<'%' > Dockerfile
FROM ubuntu:20.04 as builder

ENV TZ=America/New_York
RUN apt-get update -y

RUN ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
RUN apt-get install -y libcups2-dev
RUN apt-get install -y libavahi-client-dev
RUN apt-get install -y gcc
RUN apt-get install -y make
RUN apt-get install -y tar
RUN apt-get install -y libusb-1.0-0-dev

RUN mkdir -p /build
RUN chown nobody /build
RUN apt-get install -y libpng-dev
RUN apt-get install -y libjpeg-dev
RUN apt-get install -y libpam0g-dev
RUN apt-get install -y libavahi-client-dev
RUN apt-get install -y avahi-daemon
RUN apt-get install -y libgnutls28-dev

WORKDIR /build
COPY pappl pappl
WORKDIR /build/pappl
RUN ./configure
RUN make all 
RUN make install

WORKDIR /build
COPY lprint lprint
WORKDIR /build/lprint
RUN ./configure
RUN make all 
RUN make install

FROM ubuntu:20.04 as runtime
RUN apt-get update -y \
    && DEBIAN_FRONTEND=noninteractive apt-get install -y \
        tzdata \
        libpng-tools \
        libjpeg8 \
        libpam0g \
        libavahi-client3 \
        libgnutls30 \
        libcups2 \
        libusb-1.0-0 \
    && apt-get clean all
COPY --from=builder /usr/local /usr/local
ENV LD_LIBRARY_PATH=/usr/local/lib
%

docker build -t deleteme .
docker run --rm -d --name=lprint deleteme lprint server
docker exec -ti lprint bash
# run inside the container bash shell
lprint add -v usb://dev/null -m zpl_4inch-203dpi-dt -d fred
lprint printers
lprint delete -d fred # >> lprint: Unable to get information for 'fred' - successful-ok
lprint printers # >> fred
exit
# back to host shell
docker rm -f lprint
docker rmi lprint

image

suggestion(s) for lprint devices when: nothing, no error message is printed as regular user, but works as superuser

Just a small matter. Not sure really which of these solution(s) you might prefer. It's just some suggestions to help for other users in case they encounter a similar difficulty.

When I ran the subcomand lprint devices without superuser privileges, then nothing was printed as the program output.

I could see in the extra debug logging that this call was failling to libusb_open()

To solve this problem, at least for my ubuntu linux system here. I realized that the following very specific udev rule needed to be added for my printer:

$ cat /etc/udev/rules.d/xprinter-xp-460b.rules 
# udev rules for xprinter xp-460b thermal label printer 4x6 inches
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="2d37", ATTR{idProduct}=="4296", MODE="0666"

This then granted the needed permissions to allow the call to libusb_open() to succeed. Otherwise that point in the code will fail silently and fall through. With no indication as to the reason for why nothing is detected.

The other alternative option was to run lprint as root user. Which also worked just fine. However being that libusb is a userland service perhaps some people would prefer to run it as such. Without elevating permissions? So maybe the udev rule seems like a better idea. IDK.

Perhaps printing out a suitable warning message would be helpful. If it is possible to determine the most likely reason for the failed call to libusb_open(). So that the regular user who is not technically inclined can be made aware and know how to resolve the issue. I.e. that they need to either run lprint as the root user, or otherwise modify their udev rules by adding an appropriate entry. Perhaps even more help is to report the matched (but failed) usb device vendor id and product id. Then that is enough information for a user how to modify their udev rules to allow that type of a device through.

Another possible solution is to just install all of the udev rules at the packaging level (snap or whatever distro). That ensures the lprint program can always have permission to access all of the printers which it knows it supports.

Another way would be to include an explanation as troubleshooting steps in the documentation or FAQ. Well whatever! At least you have a bug report about it now.

LPrint API?

Is there any API through either lprint or through CUPS in order to add an label printer using the drivers from lprint application?

Dymo LW Multi-purpose labels 13x25mm

Hi,
Just got aware of your project, and I am instantly in love with it, even before really having tested it (much), since I have multiple Dymo printers.

First issue I ran across is that I can't seem to see default support for the in title mentioned labels
(also see; https://www.dymo.com/en-GB/lw-multi-purpose-labels-13-x-25-mm-lw-multi-purpose-labels-1-2-in-x-1-in ) These where the ones loaded in the closest-at-hand lw-450 here.

While I guess I can define the label sizes myself using PWG, I'm still not quite sure how I would go about those since they are two labels side-by-side then next pair, etc.
(It's always annoyed me with those particular labels, since you will always waste one if you print an odd number of labels.)

But yeah.. how to handle those?

Thanks
KarlMag

no macOS disk image is present in the source distribution

Just getting to know lprint and looking at the installation doc:

A disk image is included with all source releases on Github for use on macOS 10.14 and higher.

But no disk image is present in the source distribution (expecting .dmg, .img etc.)

PS: thank you for the amazing work on lprint/pappl/cups

lprint server: Unable to create IPv6 listener for localhost:8631: Address family not supported by protocol

Again there could be multiple different reasons for this one. Perhaps it's something to do with the server name, or the way the url address:port number string is being constructed. Or perhaps it's something like my system's unix permissions not letting your program open up a port. Not sure.

79° [id:~/.dev/lprint] master(+40/-0)* 1 ± sudo lprint server -o server-name=localhost -o server-port=8631
subcommand='server'
num_options=2
options[0].name='server-name', value='localhost'
options[1].name='server-port', value='8631'
num_files=0
F [2020-01-22T15:11:37Z] Unable to create IPv6 listener for localhost:8631: Address family not supported by protocol

θ79° [id:~/.dev/lprint] master(+40/-0)* 1 ± sudo lprint server -o server-name=127.0.0.1 -o server-port=8631
subcommand='server'
num_options=2
options[0].name='server-name', value='127.0.0.1'
options[1].name='server-port', value='8631'
num_files=0
F [2020-01-22T15:11:40Z] Unable to create IPv6 listener for 127.0.0.1:8631: Address family not supported by protocol
θ82° [id:~/.dev/lprint] master(+40/-0)* 1 ± 

Here is a syscall trace log (by prefixing strace to the cmdline)

https://gist.github.com/dreamcat4/ee83750b1f2eec6e850539b44f886ab0

this bit:

socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = 4
setsockopt(4, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(4, {sa_family=AF_INET, sin_port=htons(8631), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
listen(4, 5)                            = 0
fcntl(4, F_GETFD)                       = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = -1 EAFNOSUPPORT (Address family not supported by protocol)

Unable to start lprint server: No such file or directory

I see this happen sometimes. Not sure why it happens!

$ lprint add -o printer-resolution=203dpi -o media-tracking=continuous -o media-type=labels-continuous -o media=na_index-4x6_4x6in -o orientation-requested=portrait -v usb://Xprinter/XP-460B?serial=460BUG19A190014 -m zpl_4inch-203dpi-dt -d xprinter-xp-460b 
subcommand='add'
num_options=8
options[0].name='device-uri', value='usb://Xprinter/XP-460B?serial=460BUG19A190014'
options[1].name='lprint-driver', value='zpl_4inch-203dpi-dt'
options[2].name='media', value='na_index-4x6_4x6in'
options[3].name='media-tracking', value='continuous'
options[4].name='media-type', value='labels-continuous'
options[5].name='orientation-requested', value='portrait'
options[6].name='printer-name', value='xprinter-xp-460b'
options[7].name='printer-resolution', value='203dpi'
num_files=0
Unable to start lprint server: No such file or directory

If you look in the full gist pastie below, it includes an strace log to show which file(s) it was struggling / failing to open. Perhaps the unix socket.

https://gist.github.com/dreamcat4/a4b1f97572e3750fc359794c77ef3adb

Hopefully the strace included here is enough for you to see / understand. Otherwise please let me know if you need any further information about it.

rs232 rastertoescpx style printer support

I have a number of rs232 based receipt printers currently using the rastertoescpx driver or some similar vendor customized raster drivers for use as part of kiosk style embedded Linux appliances I support.

Is support for these sort of rs232 based receipt printer devices something planned to be added to lprint?

I noticed the readme doesn't really mention if lprint being designed for these sort of common rs232 based receipt printers:

LPrint implements printing for a variety of common label and receipt printers connected via network or USB. 

Shutting down lprint server results in SIGABRT

If I start the lprint server and then exit the process with Ctrl-C, the following is printed:

$ lprint server -o log-file=- -o log-level=debug
I [2020-03-26T14:35:20Z] System configuration loaded, 1 printers.
I [2020-03-26T14:35:20Z] Listening for local connections at '/tmp/lprint1001.sock'.
I [2020-03-26T14:35:20Z] Starting main loop.
^CI [2020-03-26T14:35:21Z] Shutting down main loop.
lprint: thread-watch.c:171: avahi_threaded_poll_lock: Assertion `p' failed.
fish: “lprint server -o log-file=- -o…” terminated by signal SIGABRT (Abort)

A quick Google search would suggest that the Avahi message can be seen in other software, but I'm not sure of its significance, or why SIGABRT would be seen. Let me know if there's any other diagnostic information I can provide!


Printer: Dymo LabelWriter 450 Twin Turbo
System: Linux <hostname> 5.5.11-1-ARCH #1 SMP Sun Mar 22 07:43:38 MDT 2020 aarch64 GNU/Linux

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.