Labelprinter: Difference between revisions

From NURDspace
No edit summary
 
(31 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Inventory
{{Inventory
|InventoryOwner=Space
|Name=Label Printer
|InventoryStatus=Working and ready for use
|Owner=Space
|InventoryHostname=printer-desktop
|Status=Infrastructure
|Location=SlabPi
|Picture=Labelprinter.jpg
|Tool=Yes
|Category=General
}}
}}
[[Image:Labelprinter.jpg|250px|right]]
= Description =
This is the label printer.


This is the label printer.
Drivers + entry in cups is on the [[SlabPi]] at the moment.  
= How to use =


Drivers + entry in cups is on the printer-desktop at the moment, this might move to the dockstar at some point in time.
== Via irc ==
* Use <code>!label</code>
If you have the right permissions and the bot can reach [[SlabPi]] you should see [[GHBot]] telling you that it is printing your text. Right now the bot has no way of knowing that stuff will actually be printed at [[SlabPi]].


=== What hardware is this ===
= What hardware is this =


* Seiko SLP-200
* Seiko SLP-650
* 99014 Shipping Labels
* 99014 Shipping Labels
* Use 'paper size 'Shipping (SLP-SRL)'''
= Known issues =
== Label alignment ==
<s>
Do not print multiple labels at once. After each print, you should correct for the fact that the will not be correctly fed. You need to adjust for that by hand. Maybe fixable with https://github.com/danieloneill/SeikoSLPLinuxDriver ?
</s>
This has finally been fixed <3 You should be able to print many labels now without any alignment issues.
== Printer disabled ==
Sometimes it just stops working at all, that is, the bot will tell you it is printing, but no label is coming out. Somehow the printer gets disabled sometimes.
All commands below should be executed on [[SlabPi]].
* Check the status
<code>lpstat -p</code>


=== How to use ===
If you see output like this, the printer is disabled indeed:


# Make image (pixels 767x384 is about maximum you get)
<code>
# Press print
printer SII_SLP650 disabled since Sat 23 Mar 2019 08:30:04 PM CET -
# Select 'papersize' '''Shipping (SLP-SRL)'''
Unable to send data to printer.
# Press print again :)
</code>


If you did multiple failed tries, you should probably empty the queue first.
* See what's in the queue
<code>lpstat</code>
* Delete something from the queue (ID is 339 in this example)
<code>cancel -a SII_SLP650-339</code>
* If the queue is empty, you can enable the labelprinter like this:
<code>cupsenable SII_SLP650</code>


=== Tips for making excellent labels ===
= Tips for making excellent labels (tbd) =
These tips are saved for posterity. For now only !label kan be used.


* There is no grayscale, make images 1 bit color (and use floyd-steinberg (normal) dithering if needed, looks teh best :) )
* There is no grayscale, make images 1 bit color (and use floyd-steinberg (normal) dithering if needed, looks teh best :) )
* There are a couple of previously printed labels in de homedir of user "printer" (/printerhome/ on [[Printer-desktop]]) which can easily be re-used.
* For text only, you can use !label @ [[GHBot]]
= How does the printing from [[GHBot]] work? =
Scripts in /home/labelprinter gets executed from [[GHBot]]. For now it's label.sh which takes an empty label and puts text in there using imagemagick which gets printed.
== label.sh ==
Script that is called to do the printing.
<pre>
#!/bin/bash
# Takes arguments and puts it as text in a templated label for our labelprinter
if [[ $# -eq 0 ]] ; then
    echo 'No arguments given, exiting...'
    exit 0
fi
echo $*
if [ "$(echo $1 | awk '{print substr($0,0,3)}')" == "0x" ] ; then
#This is a sanitised input from GHBot.
#INPUT=$(python3 -c "print(bytes.fromhex('$1'.strip()[2:]).decode('utf8'))")
INPUT=$(python -c "print('$1'[2:].decode('hex'))")
else
INPUT="$*"
fi
echo $INPUT
cd /home/labelprinter/nurdbotlabelprinting/
cp empty.png output.png
convert output.png output.gif
convert output.gif -background none -font "Garuda.ttf"  -gravity Center\
-size 744x377 caption:"$INPUT" -layers flatten output.gif
convert output.gif -rotate 90 output.gif
# lpr -PSII_SLP650 output.gif
# lp -o landscape -o fit-to-page -o media=Shipping -d SII_SLP650 output.gif
# print!
lp -d SII_SLP650 output.gif
# qiv output.gif
echo $INPUT >> label.log
#code for moving to next empty label but it's not reliable
#printf "\f" |lpr -P SLP650
</pre>
== PPD that seems to work ==
<pre>
*PPD-Adobe: "4.3"
*%%%% PPD file for SLP650/SLP650SE with CUPS.
*%%%% Created by the CUPS PPD Compiler CUPS v1.5.3.
*% Seiko Instruments Inc Smart Label Printer PPD file for
*% the Common UNIX Printing System (CUPS).
*% Copyright 1997-2003 by Easy Software Products.
*% These coded instructions, statements, and computer programs are the
*% property of Easy Software Products and are pr
*FormatVersion: "4.3"
*FileVersion: "13.37"
*LanguageVersion: English
*LanguageEncoding: ISOLatin1
*PCFileName: "siislp650-NURD.ppd"
*Product: "(SII SLP650)"
*Manufacturer: "SII"
*ModelName: "SII SLP650/NURD"
*ShortNickName: "SII SLP650/NURD"
*NickName: "SII SLP650/NURD, 13.37"
*PSVersion: "(3010.000) 550"
*LanguageLevel: "3"
*ColorDevice: False
*DefaultColorSpace: Gray
*FileSystem: False
*Throughput: "25"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
*% Driver-defined attributes...
*APPrinterIconPath: "/Library/Printers/SII/rastertosiislp.app/Contents/Resources/DriverIcons/slp650.icns"
*cupsVersion: 1.5
*cupsModelNumber: 294
*cupsManualCopies: False
*cupsFilter: "application/vnd.cups-raster 0 /usr/lib/cups/filter/seikoslp.rastertolabel"
*cupsLanguages: "en"
*OpenUI *PageSize/Media Size: PickOne
*OrderDependency: 10 AnySetup *PageSize
*DefaultPageSize: Nurds
*PageSize Nurds/Nurds (SLP-NURD): "<</PageSize[153 268]/ImagingBBox null>>setpagedevice"
*CloseUI: *PageSize
*OpenUI *PageRegion/Media Size: PickOne
*OrderDependency: 10 AnySetup *PageRegion
*DefaultPageRegion: Nurds
*PageRegion Nurds/Nurds (SLP-NURD): "<</PageSize[153 268]/ImagingBBox null>>setpagedevice"
*CloseUI: *PageRegion
*DefaultImageableArea: Nurds
*ImageableArea Nurds/Nurds (SLP-NURD): "0 0 153.071 286.299"
*DefaultPaperDimension: Nurds
*PaperDimension Nurds/Nurds (SLP-NURD): "153.071 286.299"
*MaxMediaWidth: "153"
*MaxMediaHeight: "268"
*HWMargins: 0 0 0 0
*CustomPageSize True: "pop pop pop <</PageSize[5 -2 roll]/ImagingBBox null>>setpagedevice"
*ParamCustomPageSize Width: 1 points 36 153
*ParamCustomPageSize Height: 2 points 36 268
*ParamCustomPageSize WidthOffset: 3 points 0 0
*ParamCustomPageSize HeightOffset: 4 points 0 0
*ParamCustomPageSize Orientation: 5 int 0 0
*OpenUI *Resolution/Resolution: PickOne
*OrderDependency: 10 AnySetup *Resolution
*DefaultResolution: 300dpi
*Resolution 300dpi/300 DPI: "<</HWResolution[300 300]/cupsBitsPerColor 1/cupsRowCount 0/cupsRowFeed 0/cupsRowStep 0/cupsColorSpace 3>>setpagedevice"
*CloseUI: *Resolution
*OpenGroup: SIISLPOptions/SIISLPOptions
*OpenUI *Density/Output Quality: PickOne
*OrderDependency: 10 AnySetup *Density
*DefaultDensity: MediumQuality
*Density LowQuality/Low: ""
*Density MediumQuality/Medium: ""
*Density HighQuality/High: ""
*CloseUI: *Density
*OpenUI *FinePrint/Fine Print: Boolean
*OrderDependency: 10 AnySetup *FinePrint
*DefaultFinePrint: False
*FinePrint True/1: ""
*FinePrint False/0: ""
*CloseUI: *FinePrint
*CloseGroup: SIISLPOptions
*DefaultFont: Courier
*Font AvantGarde-Book: Standard "(1.05)" Standard ROM
*Font AvantGarde-BookOblique: Standard "(1.05)" Standard ROM
*Font AvantGarde-Demi: Standard "(1.05)" Standard ROM
*Font AvantGarde-DemiOblique: Standard "(1.05)" Standard ROM
*Font Bookman-Demi: Standard "(1.05)" Standard ROM
*Font Bookman-DemiItalic: Standard "(1.05)" Standard ROM
*Font Bookman-Light: Standard "(1.05)" Standard ROM
*Font Bookman-LightItalic: Standard "(1.05)" Standard ROM
*Font Courier: Standard "(1.05)" Standard ROM
*Font Courier-Bold: Standard "(1.05)" Standard ROM
*Font Courier-BoldOblique: Standard "(1.05)" Standard ROM
*Font Courier-Oblique: Standard "(1.05)" Standard ROM
*Font Helvetica: Standard "(1.05)" Standard ROM
*Font Helvetica-Bold: Standard "(1.05)" Standard ROM
*Font Helvetica-BoldOblique: Standard "(1.05)" Standard ROM
*Font Helvetica-Narrow: Standard "(1.05)" Standard ROM
*Font Helvetica-Narrow-Bold: Standard "(1.05)" Standard ROM
*Font Helvetica-Narrow-BoldOblique: Standard "(1.05)" Standard ROM
*Font Helvetica-Narrow-Oblique: Standard "(1.05)" Standard ROM
*Font Helvetica-Oblique: Standard "(1.05)" Standard ROM
*Font NewCenturySchlbk-Bold: Standard "(1.05)" Standard ROM
*Font NewCenturySchlbk-BoldItalic: Standard "(1.05)" Standard ROM
*Font NewCenturySchlbk-Italic: Standard "(1.05)" Standard ROM
*Font NewCenturySchlbk-Roman: Standard "(1.05)" Standard ROM
*Font Palatino-Bold: Standard "(1.05)" Standard ROM
*Font Palatino-BoldItalic: Standard "(1.05)" Standard ROM
*Font Palatino-Italic: Standard "(1.05)" Standard ROM
*Font Palatino-Roman: Standard "(1.05)" Standard ROM
*Font Symbol: Special "(001.005)" Special ROM
*Font Times-Bold: Standard "(1.05)" Standard ROM
*Font Times-BoldItalic: Standard "(1.05)" Standard ROM
*Font Times-Italic: Standard "(1.05)" Standard ROM
*Font Times-Roman: Standard "(1.05)" Standard ROM
*Font ZapfChancery-MediumItalic: Standard "(1.05)" Standard ROM
*Font ZapfDingbats: Special "(001.005)" Special ROM
*% End of siislp650.ppd, 14340 bytes.
</pre>

Latest revision as of 10:21, 5 February 2024

Label Printer
Labelprinter.jpg
Owner Space
Status Infrastructure
Location SlabPi
Tool Yes
Tool category General

Label Printer

Labelprinter.jpg {{{InventoryOwner}}}Property "Tool Owner" (as page type) with input value "{{{InventoryOwner}}}" contains invalid characters or is incomplete and therefore can cause unexpected results during a query or annotation process. SlabPi

Description

This is the label printer.

Drivers + entry in cups is on the SlabPi at the moment.

How to use

Via irc

  • Use !label

If you have the right permissions and the bot can reach SlabPi you should see GHBot telling you that it is printing your text. Right now the bot has no way of knowing that stuff will actually be printed at SlabPi.

What hardware is this

  • Seiko SLP-650
  • 99014 Shipping Labels
  • Use 'paper size 'Shipping (SLP-SRL)

Known issues

Label alignment

Do not print multiple labels at once. After each print, you should correct for the fact that the will not be correctly fed. You need to adjust for that by hand. Maybe fixable with https://github.com/danieloneill/SeikoSLPLinuxDriver ?

This has finally been fixed <3 You should be able to print many labels now without any alignment issues.

Printer disabled

Sometimes it just stops working at all, that is, the bot will tell you it is printing, but no label is coming out. Somehow the printer gets disabled sometimes. All commands below should be executed on SlabPi.

  • Check the status

lpstat -p

If you see output like this, the printer is disabled indeed:

printer SII_SLP650 disabled since Sat 23 Mar 2019 08:30:04 PM CET - Unable to send data to printer.

If you did multiple failed tries, you should probably empty the queue first.

  • See what's in the queue

lpstat

  • Delete something from the queue (ID is 339 in this example)

cancel -a SII_SLP650-339

  • If the queue is empty, you can enable the labelprinter like this:

cupsenable SII_SLP650

Tips for making excellent labels (tbd)

These tips are saved for posterity. For now only !label kan be used.

  • There is no grayscale, make images 1 bit color (and use floyd-steinberg (normal) dithering if needed, looks teh best :) )
  • There are a couple of previously printed labels in de homedir of user "printer" (/printerhome/ on Printer-desktop) which can easily be re-used.
  • For text only, you can use !label @ GHBot

How does the printing from GHBot work?

Scripts in /home/labelprinter gets executed from GHBot. For now it's label.sh which takes an empty label and puts text in there using imagemagick which gets printed.

label.sh

Script that is called to do the printing.

#!/bin/bash
# Takes arguments and puts it as text in a templated label for our labelprinter
if [[ $# -eq 0 ]] ; then
    echo 'No arguments given, exiting...'
    exit 0
fi
echo $*
if [ "$(echo $1 | awk '{print substr($0,0,3)}')" == "0x" ] ; then
#This is a sanitised input from GHBot.
#INPUT=$(python3 -c "print(bytes.fromhex('$1'.strip()[2:]).decode('utf8'))")
INPUT=$(python -c "print('$1'[2:].decode('hex'))")
else
INPUT="$*"
fi
echo $INPUT
cd /home/labelprinter/nurdbotlabelprinting/
cp empty.png output.png
convert output.png output.gif
convert output.gif -background none -font "Garuda.ttf"  -gravity Center\
 -size 744x377 caption:"$INPUT" -layers flatten output.gif

convert output.gif -rotate 90 output.gif

# lpr -PSII_SLP650 output.gif
# lp -o landscape -o fit-to-page -o media=Shipping -d SII_SLP650 output.gif

# print!
lp -d SII_SLP650 output.gif

# qiv output.gif
echo $INPUT >> label.log

#code for moving to next empty label but it's not reliable
#printf "\f" |lpr -P SLP650

PPD that seems to work

*PPD-Adobe: "4.3"
*%%%% PPD file for SLP650/SLP650SE with CUPS.
*%%%% Created by the CUPS PPD Compiler CUPS v1.5.3.
*% Seiko Instruments Inc Smart Label Printer PPD file for
*% the Common UNIX Printing System (CUPS).
*% Copyright 1997-2003 by Easy Software Products.
*% These coded instructions, statements, and computer programs are the
*% property of Easy Software Products and are pr
*FormatVersion: "4.3"
*FileVersion: "13.37"
*LanguageVersion: English
*LanguageEncoding: ISOLatin1
*PCFileName: "siislp650-NURD.ppd"
*Product: "(SII SLP650)"
*Manufacturer: "SII"
*ModelName: "SII SLP650/NURD"
*ShortNickName: "SII SLP650/NURD"
*NickName: "SII SLP650/NURD, 13.37"
*PSVersion: "(3010.000) 550"
*LanguageLevel: "3"
*ColorDevice: False
*DefaultColorSpace: Gray
*FileSystem: False
*Throughput: "25"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
*% Driver-defined attributes...
*APPrinterIconPath: "/Library/Printers/SII/rastertosiislp.app/Contents/Resources/DriverIcons/slp650.icns"
*cupsVersion: 1.5
*cupsModelNumber: 294
*cupsManualCopies: False
*cupsFilter: "application/vnd.cups-raster 0 /usr/lib/cups/filter/seikoslp.rastertolabel"
*cupsLanguages: "en"
*OpenUI *PageSize/Media Size: PickOne
*OrderDependency: 10 AnySetup *PageSize
*DefaultPageSize: Nurds
*PageSize Nurds/Nurds (SLP-NURD): "<</PageSize[153 268]/ImagingBBox null>>setpagedevice"
*CloseUI: *PageSize
*OpenUI *PageRegion/Media Size: PickOne
*OrderDependency: 10 AnySetup *PageRegion
*DefaultPageRegion: Nurds
*PageRegion Nurds/Nurds (SLP-NURD): "<</PageSize[153 268]/ImagingBBox null>>setpagedevice"
*CloseUI: *PageRegion
*DefaultImageableArea: Nurds
*ImageableArea Nurds/Nurds (SLP-NURD): "0 0 153.071 286.299"
*DefaultPaperDimension: Nurds
*PaperDimension Nurds/Nurds (SLP-NURD): "153.071 286.299"
*MaxMediaWidth: "153"
*MaxMediaHeight: "268"
*HWMargins: 0 0 0 0
*CustomPageSize True: "pop pop pop <</PageSize[5 -2 roll]/ImagingBBox null>>setpagedevice"
*ParamCustomPageSize Width: 1 points 36 153
*ParamCustomPageSize Height: 2 points 36 268
*ParamCustomPageSize WidthOffset: 3 points 0 0
*ParamCustomPageSize HeightOffset: 4 points 0 0
*ParamCustomPageSize Orientation: 5 int 0 0
*OpenUI *Resolution/Resolution: PickOne
*OrderDependency: 10 AnySetup *Resolution
*DefaultResolution: 300dpi
*Resolution 300dpi/300 DPI: "<</HWResolution[300 300]/cupsBitsPerColor 1/cupsRowCount 0/cupsRowFeed 0/cupsRowStep 0/cupsColorSpace 3>>setpagedevice"
*CloseUI: *Resolution
*OpenGroup: SIISLPOptions/SIISLPOptions
*OpenUI *Density/Output Quality: PickOne
*OrderDependency: 10 AnySetup *Density
*DefaultDensity: MediumQuality
*Density LowQuality/Low: ""
*Density MediumQuality/Medium: ""
*Density HighQuality/High: ""
*CloseUI: *Density
*OpenUI *FinePrint/Fine Print: Boolean
*OrderDependency: 10 AnySetup *FinePrint
*DefaultFinePrint: False
*FinePrint True/1: ""
*FinePrint False/0: ""
*CloseUI: *FinePrint
*CloseGroup: SIISLPOptions
*DefaultFont: Courier
*Font AvantGarde-Book: Standard "(1.05)" Standard ROM
*Font AvantGarde-BookOblique: Standard "(1.05)" Standard ROM
*Font AvantGarde-Demi: Standard "(1.05)" Standard ROM
*Font AvantGarde-DemiOblique: Standard "(1.05)" Standard ROM
*Font Bookman-Demi: Standard "(1.05)" Standard ROM
*Font Bookman-DemiItalic: Standard "(1.05)" Standard ROM
*Font Bookman-Light: Standard "(1.05)" Standard ROM
*Font Bookman-LightItalic: Standard "(1.05)" Standard ROM
*Font Courier: Standard "(1.05)" Standard ROM
*Font Courier-Bold: Standard "(1.05)" Standard ROM
*Font Courier-BoldOblique: Standard "(1.05)" Standard ROM
*Font Courier-Oblique: Standard "(1.05)" Standard ROM
*Font Helvetica: Standard "(1.05)" Standard ROM
*Font Helvetica-Bold: Standard "(1.05)" Standard ROM
*Font Helvetica-BoldOblique: Standard "(1.05)" Standard ROM
*Font Helvetica-Narrow: Standard "(1.05)" Standard ROM
*Font Helvetica-Narrow-Bold: Standard "(1.05)" Standard ROM
*Font Helvetica-Narrow-BoldOblique: Standard "(1.05)" Standard ROM
*Font Helvetica-Narrow-Oblique: Standard "(1.05)" Standard ROM
*Font Helvetica-Oblique: Standard "(1.05)" Standard ROM
*Font NewCenturySchlbk-Bold: Standard "(1.05)" Standard ROM
*Font NewCenturySchlbk-BoldItalic: Standard "(1.05)" Standard ROM
*Font NewCenturySchlbk-Italic: Standard "(1.05)" Standard ROM
*Font NewCenturySchlbk-Roman: Standard "(1.05)" Standard ROM
*Font Palatino-Bold: Standard "(1.05)" Standard ROM
*Font Palatino-BoldItalic: Standard "(1.05)" Standard ROM
*Font Palatino-Italic: Standard "(1.05)" Standard ROM
*Font Palatino-Roman: Standard "(1.05)" Standard ROM
*Font Symbol: Special "(001.005)" Special ROM
*Font Times-Bold: Standard "(1.05)" Standard ROM
*Font Times-BoldItalic: Standard "(1.05)" Standard ROM
*Font Times-Italic: Standard "(1.05)" Standard ROM
*Font Times-Roman: Standard "(1.05)" Standard ROM
*Font ZapfChancery-MediumItalic: Standard "(1.05)" Standard ROM
*Font ZapfDingbats: Special "(001.005)" Special ROM
*% End of siislp650.ppd, 14340 bytes.