This is an old revision of the document!


CUPS trobleshooting

How to list installed printers /Vypíši nainstalované tiskárny

lpstat -p -d
printer Brother_PT-2420PC disabled since Fri 26 Jun 2015 11:40:33 AM CEST -
	Unplugged or turned off
printer QL-500 disabled since Fri 26 Jun 2015 01:58:41 PM CEST -
	Paused

Which dev file is my usb printer? /Který dev soubor představuje moji tiskárnu?

aptitude install foo2zjs
usb_printerid /dev/usb/lp0 
GET_DEVICE_ID string:
MFG:Brother;CMD:PT-CBP;MDL:QL-500;CLS:PRINTER;

Where do I find queue of pdf/ps files to be printed?

ls -1 /var/spool/cups 

Directory /etc/cups/ppd contains ppd files for installed printers.

See core data send to printer using printer specific language.

  1. “FileDevice Yes” to /etc/cups/cups-files.conf nebo /etc/cups/cupsd.conf
  2. restart cups
  3. execute:
lpadmin -p print_to_file_as_test_using_QL_500_drivers -E -v file:/tmp/printout -P /etc/cups/ppd/QL-500.ppd

Alternativní způsoby jak získat raw soubor. http://aplawrence.com/MacOSX/macosxcupstofile.html

Souobor pak mohu vytisknout pomocí

cat /tmp/printout> /dev/usb/lp0
lp -d Brother_PT-1500PC -oraw test_tisku.prn

Ukládání do raw souboru /tmp/printout nefunguje ze záhadných důvodů u debianu Jessie.

Špehovat USB umí ale i wireshark.

gksu wireshark
# nebo možná
sudo adduser $USER wireshark

Jak získat raw soubor na windows? How to get raw usb printer output on windows? Just change printing port to file and disable bidirectional print. http://pclhelp.com/pcl-to-pdf/how-to-capture-prn-file-windows/

Na soubor se můžeme podívat https://9cb21392cee7550e9d82f3f871ce806316582628.googledrive.com/host/0B7Vet6dn3-Gwd3BKVmwzR0pjU0E/index.html

Ve windows je možné prn soubor vytisknout pomocí program printfile. http://www.lerup.com/printfile/

https://wiki.ubuntu.com/DebuggingPrintingProblems

Kompletní popis “p-touch” jazyka pro nové wifi modely

http://download.brother.com/welcome/docp100064/cv_pte550wp750w_eng_raster_100.pdf

http://download.brother.com/welcome/docp000678/cv_qlseries_eng_raster_600.pdf

http://etc.nkadesign.com/Printers/QL550LabelPrinterProtocol

http://etc.nkadesign.com/uploads/Printers/95CRRASE.pdf

Neoficiální zjednoduší popis pro starší modely. http://www.undocprint.org/formats/page_description_languages/brother_p-touch

Skládání souborů, co posílá na tiskárnu, v perlu bez CUPS - http://etc.nkadesign.com/Printers/QL550LabelPrinterPerl

CUPS on android? CUPS na Androidu? Possible http://matejcik.blogspot.cz/2013/04/setting-up-usb-printer-in-androidlinux.html

How to install paralel printer to CUPS using usb to parallel adapter

Printer connected via this adapter does not seems to be detected via CUPS automatically

lsusb
Bus 004 Device 013: ID 067b:2305 Prolific Technology, Inc. PL2305 Parallel Port

When you connect the usb adapter, one more file will be created in /dev/usb/ directory. Note the name of the file. It represents your printer.

The CUPS uri is then : parallel:/dev/usb/lp0 for example Go to http://localhost:631 CUPS add printer dialog: “Other Network Printers→LPD/LPR Host or Printer” (weird or what?), pasted “parallel:/dev/usb/lp0” into the “Connection” (URI) field and followed the prompts.

Blabel

Binární editory

Práce s binárními sobory v ruby

Ruční práce s bitmapovými soubory

convert  -background white -fill black  -size x112 -gravity South -rotate 90 label:"Pokus tady napíši co chci"    test.pbm

Formát souboru pbm je velmi jednoduchý. http://netpbm.sourceforge.net/doc/pbm.html

Tyhle tiskárny ale tisknou zprava doleva. Prohodit pořadí bitů lze v ruby pomocí

následující konstrukce prohodí přehodí bity v bytu tak aby byli pozpátku.

irb(main):028:0> ["\xF0".unpack('b*')[0].reverse].pack('b*')
=> "\x0F"

Následující konstrukce převede řetězec na jednotlivé byty, u nich prohodí bity (zrcadlově otočí) a výsledný řetězec ještě zrcadlově otočí.

irb(main):025:0> "\xF0\x0F".chars.map{|s| [s.unpack('b*')[0].reverse].pack('b*')}.join().reverse
=> "\xF0\x0F

Umí jej vygenerovat i ghostcript.

gs -sOutputFile=label.pbm -sDEVICE=pbmraw -g720x$::LABELLENGTH -dNOPAUSE -dBATCH label.ps

Obrázek pro pin pomocí convert utility:

convert  -background white -fill black  -size x48 -gravity South -rotate 90 label:"123456789XXXX"    test.pbm

Výsledný program

Testování usb tiskáren

usb_printerid /dev/usb/lp0
GET_DEVICE_ID string:
MFG:Canon;CMD:BJL,BJRaster3,BSCCe;SOJ:TXT01;MDL:MP150;CLS:PRINTER;DES:Canon MP150;VER:1.08;STA:10;HRI:OTH;
root@praha-vpravo-internet-dualhead:~/udevadm/sPT-18R# usb_printerid /dev/usb/lp1
GET_DEVICE_ID string:
MFG:Brother;CMD:PT-CBP;MDL:PT-1500PC;CLS:PRINTER;
root@praha-vpravo-internet-dualhead:~/udevadm/sPT-18R# usb_printerid /dev/usb/lp2
Error: Input/output error: GET_DEVICE_ID on '/dev/usb/lp2'
root@praha-vpravo-internet-dualhead:~/udevadm/sPT-18R# usb_printerid /dev/usb/lp3
GET_DEVICE_ID string:
MFG:Brother;CMD:PT-CBP;MDL:PT-18R;CLS:PRINTER;
root@praha-vpravo-internet-dualhead:~/udevadm/sPT-18R# usb_printerid /dev/dot0 
GET_DEVICE_ID string:
MFG:Brother;CMD:PT-CBP;MDL:PT-18R;CLS:PRINTER;
root@praha-vpravo-internet-dualhead:~/udevadm/sPT-18R# usb_printerid /dev/usb/lp
lp0  lp1  lp2  lp3
 
cups_troubleshooting.1437733318.txt.gz · Last modified: 2015/07/24 12:21 (external edit)