Skip to content
Art edited this page Mar 6, 2016 · 2 revisions

Problem Statement

Having to go to the printer and manually connect it in to their computer, especially from laptop

Requirements

Functional

  1. Connect via network X
  2. Connect from laptop and desktop running windows 10 and 7
  3. 4 printers via USB X
  4. Printer: HP and Dell
  5. View ink levels and print jobs and queue from computers

Non functional

  1. No need to manually operate
  2. No screen or keyboard X
  3. Automatic updates and reboot at night time
  4. Automatic IP address X
  5. Automatic discovery – others computers can easily find the print server on the network
  6. Always turned on

Solution

Hardware Specification

  • Raspberry Pi
    • 4 USB ports
    • Ethernet network port
    • HDMI and audio not needed
    • Micro USB power socket
  • Ethernet cable
  • Micro USB Power Adaptor (1 Amp) Printers already have USB cables and power, and a spare ethernet port is available

Software Specification

  • minibian
    • features
      • Light-weight Operating System but with full range of Raspbian packages available
      • DHCP for automatic IP address
    • settings
      • use default root user (see Improvements below)
  • Samba
    • share Printers (and Printer Drivers) with Windows users
  • CUPS
    • features
      • Linux printing system
      • makes drivers available to clients
      • browser-based administrative control and operator panel
    • settings
      • no authentication (allow connected users to perform ANY action)
  • avahi-discover
    • allows people with devices on to automatically discover printers on this print server

Setup

# connect to pi console
# default password is raspberry
ssh root@print-server
# as root on minibian no need for sudo
apt-get update
apt-get install -y samba cups avahi-discover
# Add current user to printer admins group
usermod -a -G lpadmin $USER
vi /etc/cups/cupsd.conf

and change the sections as follows

## Only listen for connections from the local machine.
#Listen localhost:631
#Listen /var/run/cups/cups.sock

# Listen on any interface to port 631
Port 631
# credit - https://help.ubuntu.com/lts/serverguide/cups.html

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

# Restrict access to the server...
<Location />
  Order allow,deny
  Allow all #### Anyone can access
</Location>

# Restrict access to the admin pages...
<Location /admin>
  Order allow,deny
  Allow all #### Anyone can administer
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
#  AuthType Default
#  Require user @SYSTEM
  Order allow,deny
  Allow all #### Anyone can change config
</Location>

then

vi /etc/samba/smb.conf

and change the sections as follows

[global]

## Browsing/Identification ###

   workgroup = WORKGROUP
   wins support = yes

### Printer Services - using CUPS (NEW sub-section towards end of [global] )

   load printers = yes
   printing = cups
   printcap name = cups

[printers]
   comment = All Printers
   browseable = yes
   printable = yes
   guest ok = yes
   path = /var/lib/samba/printers
#   path = /var/spool/samba/

# ?   use client driver = yes 


# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
   comment = Printer Drivers
   path = /usr/share/cups/drivers
   browseable = yes
   read only = yes
   guest ok = yes
   write list = root, @lpadmin

For more information on using Samba, please see [https://github.com/artmg/lubuild/blob/master/help/configure/network-shares-with-Samba.md]

potential improvements

  • run the services as a user which is NOT root
    • best-practice security recommends only grant least privilege required