Can’t you use your thermal printer through CUPS? You may need to add a driver package for it via services.printing.drivers, but I don’t know if most folks should be using the usblp module for anything these days.
Hi again, thank you for your time, but that not a posible solution, the driver don’t “speak” the same language of the printer.
I use the printer to print barcodes (hundreds of them). Thermals printers have a set of native commands in the printer (ESC/POS)
If I print “\x1b\x21\x3012345678” with the lp command prints exactly that
But echoing the same string to the printer directly prints a bardoce in code128 format, that represents the last 8 character of the string. Those escape character are the ESC/POS commands, for cups is a normal string.
I need to use usblp kernel module and cups at the same time… or a way to cups understand the ESC/POS commands, but i think is way easier the first, because is the default dehaviour in Arch what is I using right now in that PC for this reason (I like to use NixOS in all my computers)
That kernel module is indeed being blacklisted by the CUPS (NixOS) module:
# Cups uses libusb to talk to printers, and does not use the
# linux kernel driver. If the driver is not in a black list, it
# gets loaded, and then cups cannot access the printers.
boot.blacklistedKernelModules = [ "usblp" ];
If this comment it still valid, it does really look like it’s not possible to use both at the same time.
EDIT: if you say you can just do so in Arch, then it may be that this is no longer true. Maybe try to override the blacklist with lib.mkForce.