Printing via Cups "lp -p Generic-text-only file"

Asked by Lutz

I want print labels out of database with php. Script is ok. I use language for printer TSPL2, as sample and want print via Generic-text-only with command "lp -d Generic-text-only TSPL2-file". It works only first time. I have to unplug usb-cable and pug it back then is function again. If I use the command "sudo cat lable2 >/dev/usb/lp0" I have got no problems i can repeat the command many times.
At cups I can see this after the job passed:
Generic-text-only Generic text-only lutz12-n130 Generic text-only printer Idle - "Sending data to printer."

The ERROR-log shows:
D [30/Mar/2012:02:23:42 +0100] cupsdAcceptClient: 27 from localhost (Domain)
D [30/Mar/2012:02:23:42 +0100] Report: clients=2
D [30/Mar/2012:02:23:42 +0100] Report: jobs=148
D [30/Mar/2012:02:23:42 +0100] Report: jobs-active=0
D [30/Mar/2012:02:23:42 +0100] Report: printers=3
D [30/Mar/2012:02:23:42 +0100] Report: printers-implicit=0
D [30/Mar/2012:02:23:42 +0100] Report: stringpool-string-count=24628
D [30/Mar/2012:02:23:42 +0100] Report: stringpool-alloc-bytes=11440
D [30/Mar/2012:02:23:42 +0100] Report: stringpool-total-bytes=508128
D [30/Mar/2012:02:23:42 +0100] cupsdReadClient: 27 POST / HTTP/1.1
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Active clients", busy="Not busy"
D [30/Mar/2012:02:23:42 +0100] cupsdAuthorize: No authentication data provided.
D [30/Mar/2012:02:23:42 +0100] cupsdReadClient: 27 1.1 Get-Printer-Attributes 1
D [30/Mar/2012:02:23:42 +0100] Get-Printer-Attributes ipp://localhost:631/printers/Generic-text-only
D [30/Mar/2012:02:23:42 +0100] Returning IPP successful-ok for Get-Printer-Attributes (ipp://localhost:631/printers/Generic-text-only) from localhost
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Not busy", busy="Active clients"
D [30/Mar/2012:02:23:42 +0100] cupsdReadClient: 27 POST /printers/Generic-text-only HTTP/1.1
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Active clients", busy="Not busy"
D [30/Mar/2012:02:23:42 +0100] cupsdAuthorize: No authentication data provided.
D [30/Mar/2012:02:23:42 +0100] cupsdReadClient: 27 1.1 Create-Job 1
D [30/Mar/2012:02:23:42 +0100] Create-Job ipp://localhost:631/printers/Generic-text-only
D [30/Mar/2012:02:23:42 +0100] cupsdMarkDirty(----J-)
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Active clients"
D [30/Mar/2012:02:23:42 +0100] add_job: requesting-user-name="lutz12"
I [30/Mar/2012:02:23:42 +0100] [Job 204] Adding start banner page "none".
D [30/Mar/2012:02:23:42 +0100] cupsdMarkDirty(-----S)
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Active clients and dirty files"
I [30/Mar/2012:02:23:42 +0100] [Job 204] Queued on "Generic-text-only" by "lutz12".
D [30/Mar/2012:02:23:42 +0100] Returning IPP successful-ok for Create-Job (ipp://localhost:631/printers/Generic-text-only) from localhost
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Dirty files", busy="Active clients and dirty files"
D [30/Mar/2012:02:23:42 +0100] cupsdReadClient: 27 POST /printers/Generic-text-only HTTP/1.1
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Dirty files"
D [30/Mar/2012:02:23:42 +0100] cupsdAuthorize: No authentication data provided.
D [30/Mar/2012:02:23:42 +0100] cupsdReadClient: 27 1.1 Send-Document 1
D [30/Mar/2012:02:23:42 +0100] Send-Document ipp://localhost:631/printers/Generic-text-only
D [30/Mar/2012:02:23:42 +0100] cupsdIsAuthorized: requesting-user-name="lutz12"
D [30/Mar/2012:02:23:42 +0100] [Job 204] Auto-typing file...
D [30/Mar/2012:02:23:42 +0100] [Job 204] Request file type is text/plain.
D [30/Mar/2012:02:23:42 +0100] cupsdMarkDirty(----J-)
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Active clients and dirty files"
I [30/Mar/2012:02:23:42 +0100] [Job 204] File of type text/plain queued by "lutz12".
I [30/Mar/2012:02:23:42 +0100] [Job 204] Adding end banner page "none".
D [30/Mar/2012:02:23:42 +0100] cupsdMarkDirty(----J-)
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Active clients and dirty files"
D [30/Mar/2012:02:23:42 +0100] cupsdMarkDirty(----J-)
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Active clients and dirty files"
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Active clients and dirty files"
D [30/Mar/2012:02:23:42 +0100] cupsdMarkDirty(-----S)
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Active clients and dirty files"
D [30/Mar/2012:02:23:42 +0100] [Job 204] job-sheets=none,none
D [30/Mar/2012:02:23:42 +0100] [Job 204] argv[0]="Generic-text-only"
D [30/Mar/2012:02:23:42 +0100] [Job 204] argv[1]="204"
D [30/Mar/2012:02:23:42 +0100] [Job 204] argv[2]="lutz12"
D [30/Mar/2012:02:23:42 +0100] [Job 204] argv[3]="lable2"
D [30/Mar/2012:02:23:42 +0100] [Job 204] argv[4]="1"
D [30/Mar/2012:02:23:42 +0100] [Job 204] argv[5]="finishings=3 number-up=1 job-uuid=urn:uuid:5eeba8e6-79e4-381e-706c-44a7ba7b4787 job-originating-host-name=localhost time-at-creation=1333070622 time-at-processing=1333070622 AP_D_InputSlot="
D [30/Mar/2012:02:23:42 +0100] [Job 204] argv[6]="/var/spool/cups/d00204-001"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[0]="CUPS_CACHEDIR=/var/cache/cups"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[1]="CUPS_DATADIR=/usr/share/cups"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[2]="CUPS_DOCROOT=/usr/share/cups/doc-root"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[3]="CUPS_FONTPATH=/usr/share/cups/fonts"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[4]="CUPS_REQUESTROOT=/var/spool/cups"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[5]="CUPS_SERVERBIN=/usr/lib/cups"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[6]="CUPS_SERVERROOT=/etc/cups"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[7]="CUPS_STATEDIR=/var/run/cups"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[8]="HOME=/var/spool/cups/tmp"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[9]="PATH=/usr/lib/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[10]="SERVER_ADMIN=root@lutz12-n130"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[11]="SOFTWARE=CUPS/1.5.2"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[12]="TMPDIR=/var/spool/cups/tmp"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[13]="USER=root"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[14]="CUPS_SERVER=/var/run/cups/cups.sock"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[15]="CUPS_ENCRYPTION=IfRequested"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[16]="IPP_PORT=631"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[17]="CHARSET=utf-8"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[18]="LANG=en_GB.UTF-8"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[19]="PPD=/etc/cups/ppd/Generic-text-only.ppd"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[20]="RIP_MAX_CACHE=128m"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[21]="CONTENT_TYPE=text/plain"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[22]="DEVICE_URI=usb://Unknown/Printer"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[23]="PRINTER_INFO=Generic text-only"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[24]="PRINTER_LOCATION=lutz12-n130"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[25]="PRINTER=Generic-text-only"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[26]="PRINTER_STATE_REASONS=none"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[27]="CUPS_FILETYPE=document"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[28]="FINAL_CONTENT_TYPE=printer/Generic-text-only"
D [30/Mar/2012:02:23:42 +0100] [Job 204] envp[29]="AUTH_I****"
I [30/Mar/2012:02:23:42 +0100] [Job 204] Started filter /usr/lib/cups/filter/textonly (PID 14401)
I [30/Mar/2012:02:23:42 +0100] [Job 204] Started backend /usr/lib/cups/backend/usb (PID 14402)
D [30/Mar/2012:02:23:42 +0100] cupsdMarkDirty(-----S)
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Active clients, printing jobs, and dirty files", busy="Active clients and dirty files"
D [30/Mar/2012:02:23:42 +0100] Returning IPP successful-ok for Send-Document (ipp://localhost:631/printers/Generic-text-only) from localhost
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Active clients, printing jobs, and dirty files"
D [30/Mar/2012:02:23:42 +0100] cupsdReadClient: 27 WAITING Closing on EOF
D [30/Mar/2012:02:23:42 +0100] cupsdCloseClient: 27
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [30/Mar/2012:02:23:42 +0100] [Job 204] print_device
D [30/Mar/2012:02:23:42 +0100] [Job 204] libusb_get_device_list=7
D [30/Mar/2012:02:23:42 +0100] [Job 204] PAGE: 1 1
D [30/Mar/2012:02:23:42 +0100] cupsdMarkDirty(-----S)
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] PID 14401 (/usr/lib/cups/filter/textonly) exited with no errors.
D [30/Mar/2012:02:23:42 +0100] [Job 204] STATE: +connecting-to-device
D [30/Mar/2012:02:23:42 +0100] cupsdMarkDirty(-----S)
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Dirty files", busy="Printing jobs and dirty files"
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Job 204] STATE: -connecting-to-device
D [30/Mar/2012:02:23:42 +0100] cupsdMarkDirty(-----S)
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Dirty files"
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
I [30/Mar/2012:02:23:42 +0100] [Job 204] Sending data to printer.
D [30/Mar/2012:02:23:42 +0100] [Job 204] Set job-printer-state-message to "Sending data to printer.", current level=INFO
D [30/Mar/2012:02:23:42 +0100] [Job 204] Read 260 bytes of print data...
D [30/Mar/2012:02:23:42 +0100] cupsdMarkDirty(-----S)
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [30/Mar/2012:02:23:42 +0100] cupsdMarkDirty(-----S)
D [30/Mar/2012:02:23:42 +0100] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:42 +0100] [Job 204] Wrote 260 bytes of print data...
D [30/Mar/2012:02:23:42 +0100] [Job 204] Sent 260 bytes...
D [30/Mar/2012:02:23:42 +0100] [Job 204] Waiting for read thread to exit...
D [30/Mar/2012:02:23:49 +0100] [Job 204] Read thread still active, aborting the pending read...
D [30/Mar/2012:02:23:50 +0100] PID 14402 (/usr/lib/cups/backend/usb) exited with no errors.
D [30/Mar/2012:02:23:50 +0100] cupsdMarkDirty(-----S)
D [30/Mar/2012:02:23:50 +0100] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
I [30/Mar/2012:02:23:50 +0100] [Job 204] Job completed.
D [30/Mar/2012:02:23:50 +0100] cupsdMarkDirty(----J-)
D [30/Mar/2012:02:23:50 +0100] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [30/Mar/2012:02:23:50 +0100] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [30/Mar/2012:02:23:50 +0100] cupsdMarkDirty(-----S)
D [30/Mar/2012:02:23:50 +0100] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [30/Mar/2012:02:23:50 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:50 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:50 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:50 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:50 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:50 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:50 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:50 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:50 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:50 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:50 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:50 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:50 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:50 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:50 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:50 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:50 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:50 +0100] [Notifier] state=3
D [30/Mar/2012:02:23:51 +0100] [Job 204] Unloading...
D [30/Mar/2012:02:23:59 +0100] cupsdReadClient: 17 WAITING Closing on EOF
D [30/Mar/2012:02:23:59 +0100] cupsdCloseClient: 17
D [30/Mar/2012:02:23:59 +0100] cupsdSetBusyState: newbusy="Dirty files", busy="Printing jobs and dirty files"
D [30/Mar/2012:02:23:59 +0100] cupsdAcceptClient: 17 from localhost:631 (IPv4)
D [30/Mar/2012:02:23:59 +0100] cupsdReadClient: 17 GET /admin/log/error_log? HTTP/1.1
D [30/Mar/2012:02:23:59 +0100] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Dirty files"
D [30/Mar/2012:02:23:59 +0100] cupsdAuthorize: Authorized as lutz12 using Basic

------------------------------------------------------------------------------------------------------------------------------------
what runs here wrong? please.

Question information

Language:
English Edit question
Status:
Solved
For:
Common Print Dialog Edit question
Assignee:
No assignee Edit question
Solved by:
Lutz
Solved:
Last query:
Last reply:
Revision history for this message
Lutz (lutz-goad) said :
#1

Problem Solved:
1. installed Cups new
2. Installed RAW Printer
3. use comman: "lp -d RawPrint -o raw File"

can now lp-command repeat without problems.
via php use command via pipe: popen, fputs and works fine.