On 2015-05-28 Thu 11:27 AM |, Craig Skinner wrote:
> On 2015-05-28 Thu 08:40 AM |, Antoine Jacoutot wrote:
> > > $ dmesg | egrep 'lpt|ugen' 
> > > ugen0 at uhub1 port 2 "Pr?lific Technology Inc. IEEE-1284 Controller" rev 
> > > 1.00/2.00 addr 3
> > 
> > sigh, I totally missed the fact that this was a parallel printer.
> > 
> 
> I've an old machine with a parallel port. What would I do to try it
> there, directly connected - without the USB adaptor?
> 


Thanks for the help people.

Short version:

The HP LaserJet 1100 has been working with CUPS when connected to an old
box with a parallel port. LAN clients connect to it with cups-browsed.


Long version for others with this printer (2 sections):

# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Small non-X11 network 'server' with parallel port & HP LaserJet 1100:
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Standard 5.6 release kernel & packages:

$ uname -mrsv
OpenBSD 5.6 GENERIC#274 i386

$ pkg_info -I hplip hpijs hpcups hpaio \
        cups cups-filters cups-libs avahi dbus \
        foomatic-db foomatic-db-engine
hplip-3.14.6        HP Linux Imaging and Printing
hpijs-3.14.6        HP ghostscript driver (spooler independent)
hpcups-3.14.6       HP native CUPS driver
hpaio-3.14.6        HP sane(7) scanner backend
cups-1.7.4p0        Common Unix Printing System
cups-filters-1.0.54p2 OpenPrinting CUPS filters
cups-libs-1.7.4     CUPS libraries and headers
avahi-0.6.31p13     framework for Multicast DNS Service Discovery
dbus-1.8.6v0        message bus system
foomatic-db-4.0.20131218 Foomatic PPD data
foomatic-db-engine-4.0.11 Foomatic PPD generator


/etc/rc.conf.local:
pkg_scripts='... dbus_daemon avahi_daemon cupsd'
# avahi pkg readme:
multicast_host='YES'


/etc/login.conf:
avahi_daemon:\
        :priority=18:\
        :tc=daemon:

cupsd:\
        :priority=12:\
        :tc=daemon:

dbus_daemon:\
        :priority=18:\
        :tc=daemon:


$ sudo cat /etc/cups/printers.conf
# Printer configuration file for CUPS v1.7.4
# Written by cupsd on 2015-05-29 22:21
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
<DefaultPrinter HP-LJ-1100>
UUID urn:uuid:c6d03a42-b71c-3b96-4f8d-320eae4576bb
Info Ye olde Lazar Jet
Location Box room
MakeModel Hewlett Packard LaserJet 1100
DeviceURI parallel:/dev/lpt0
State Idle
StateTime 1432934466
Type 8425500
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy stop-printer
</Printer>


Standard /etc/cups/cups-files.conf


$ sudo cat /etc/cups/cupsd.conf
# Sample configuration file for the CUPS scheduler.  See "man cupsd.conf" for a
# complete description of this file.
#
# /usr/local/share/doc/cups/help/ref-cupsd-conf.html
#

# Log general information in error_log - change "warn" to "debug"
# for troubleshooting...
LogLevel info
MaxLogSize 5m

# listen for connections from the local machine
Listen /var/run/cups/cups.sock

# Allow remote access
# DNS CNAME
Listen printer.internal:631
ServerAlias printer.internal printer

MaxClients 10
MaxJobsPerPrinter 10

FilterNice 18

PreserveJobFiles 1w
PreserveJobHistory 1w

# Show shared printers on the local network.
Browsing On
BrowseLocalProtocols DNSSD

# Web interface setting...
WebInterface No

# Default authentication type, when authentication is required...
DefaultAuthType Basic

# Restrict access to the server...
<Location />
  # Allow remote administration...
  Order allow,deny
  # Allow shared printing...
  Allow @LOCAL
</Location>

# Restrict access to the admin pages...
<Location /admin>
  # Allow remote administration...
  Order allow,deny
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  # Allow remote access to the configuration files...
  Order allow,deny
</Location>

# Set the default printer/job policies...
<Policy default>
  # Job/subscription privacy...
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default

  # Job-related operations must be done by the owner or an administrator...
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    Order deny,allow
  </Limit>

  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs 
Set-Job-Attributes Create-Job-Subscription Renew-Subscription 
Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job 
Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job 
CUPS-Get-Document>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  # All administration operations require an administrator to authenticate...
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class 
CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # All printer operations require a printer operator to authenticate...
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer 
Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs 
Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer 
Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs 
CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...
  <Limit Cancel-Job CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  <Limit All>
    Order deny,allow
  </Limit>
</Policy>

# Set the authenticated printer/job policies...
<Policy authenticated>
  # Job/subscription privacy...
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default

  # Job-related operations must be done by the owner or an administrator...
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    AuthType Default
    Order deny,allow
  </Limit>

  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs 
Set-Job-Attributes Create-Job-Subscription Renew-Subscription 
Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job 
Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job 
CUPS-Get-Document>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  # All administration operations require an administrator to authenticate...
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class 
CUPS-Delete-Class CUPS-Set-Default>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # All printer operations require a printer operator to authenticate...
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer 
Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs 
Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer 
Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs 
CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...
  <Limit Cancel-Job CUPS-Authenticate-Job>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  <Limit All>
    Order deny,allow
  </Limit>
</Policy>



This got me initial PPD & /etc/cups/printers.conf files:
$ lpadmin -p HP-LJ-1100 -E -v "parallel:/dev/lpt0" -P 
/usr/local/share/foomatic/db/source/PPD/HP/hp-laserjet_1100-hpijs.ppd.gz


The PPD file needed changed slightly:

$ diff hp-laserjet_1100-hpijs.ppd hp-laserjet_1100-hpijs-foomatic-rip-A4.ppd
170,171c170,171
< *cupsFilter: "application/vnd.cups-postscript 100 foomatic-rip-hplip"
< *cupsFilter: "application/vnd.cups-pdf 0 foomatic-rip-hplip"
---
> *cupsFilter: "application/vnd.cups-postscript 100 foomatic-rip"
> *cupsFilter: "application/vnd.cups-pdf 0 foomatic-rip"
175c175
< *DefaultPageSize: Letter
---
> *DefaultPageSize: A4
203c203
< *DefaultPageRegion: Letter
---
> *DefaultPageRegion: A4
229c229
< *DefaultImageableArea: Letter
---
> *DefaultImageableArea: A4
254c254
< *DefaultPaperDimension: Letter
---
> *DefaultPaperDimension: A4


The HP-LaserJet_1100-lj4dith.ppd works OK, but looses it a bit with some pdfs.

The hp-laserjet_1100-hpcups.ppd gives the best results.





# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
OpenBSD desktop LAN clients:
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Works with libreoffice, claws-mail, firefox, etc...


In /etc/rc.conf.local:
pkg_scripts='dbus_daemon avahi_daemon cups_browsed'
# avahi pkg readme:
multicast_host='YES'


/etc/login.conf:
avahi_daemon:\
        :priority=18:\
        :tc=daemon:

cups_browsed:\
        :priority=18:\
        :tc=daemon:

dbus_daemon:\
        :priority=18:\
        :tc=daemon:



Standard /etc/cups/cups-files.conf

$ egrep -v '^$|^#' /etc/cups/cups-browsed.conf 
BrowseRemoteProtocols DNSSD
CreateIPPPrinterQueues Yes
AutoShutdown avahi


$ egrep -v '^$|^#' /etc/cups/client.conf 
ServerName printer.internal

# Note: must match the print server's 'Listen' & 'ServerAlias' as above
# or be an IP address



$ avahi-browse -r -t _ipp._tcp
+    re0 IPv4 Ye olde Lazar Jet @ spruce                      _ipp._tcp         
   local
=    re0 IPv4 Ye olde Lazar Jet @ spruce                      _ipp._tcp         
   local
   hostname = [spruce.local]
   address = [192.168.1.10]
   port = [631]
   txt = ["org.freedesktop.Avahi.cookie=2492729538" "printer-type=0x80901E" 
"printer-state=3" "Duplex=T" "Color=T" "TLS=1.2" 
"UUID=c6d03a42-b71c-3b96-4f8d-320eae4576bb" 
"pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster"
 "product=(HP LaserJet 1100xi Printer)" "priority=0" "note=Box room" 
"adminurl=https://spruce.local:631/printers/HP-LJ-1100"; "ty=Unknown" 
"rp=printers/HP-LJ-1100" "qtotal=1" "txtvers=1"]



I was considering a cron script to generate a tmp /etc/cups/client.conf,
and update if cmp failed, but "The client.conf file is deprecated and
will no longer be supported in a future version of CUPS."
http://www.cups.org/documentation.php/doc-2.0/man-client.conf.html

$ avahi-browse -f -p -k -r -t _printer._tcp |
        awk -F\; '/\.local/ { "ServerName "$8 }'
ServerName 192.168.1.10



$ lpstat -p -d
printer HP-LJ-1100 is idle.  enabled since Fri May 29 22:21:06 2015
system default destination: HP-LJ-1100


$ lpc status
HP-LJ-1100:
        printer is on device 'parallel' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

$ lpq -a
no entries


Thanks to all.
-- 
"All snakes who wish to remain in Ireland will please raise their right
hands."
                -- Saint Patrick

Reply via email to