Raspberry pi 3. установка и настройка принт-сервера cups

Printer Drivers

This article or section needs expansion.

The drivers for a printer may come from any of the sources shown below. See CUPS/Printer-specific problems for an incomplete list of drivers that others have managed to get working.

When a PPD file is provided to CUPS, the CUPS server will regenerate the PPD files and save them in .

Foomatic

To use foomatic, install and at least one of:

  • — a collection of XML files used by foomatic-db-engine to generate PPD files.
  • — prebuilt PPD files.
  • — a collection of XML files from printer manufacturers under non-free licenses used by foomatic-db-engine to generate PPD files.
  • — prebuilt PPD files under non-free licenses.

The foomatic PPDs may require additional filters, such as AUR.

Gutenprint

Install and .

Note: When the Gutenprint packages get updated, the printers using Gutenprint drivers will stop working until you run as root and restart CUPS. cups-genppdupdate will update the PPD files of the configured printers, see for more details.

Manufacturer-specific drivers

Many printer manufacturers supply their own Linux drivers. These are often available in the official Arch repositories or in the AUR.

Some of those drivers are described in more detail in CUPS/Printer-specific problems.

Самодельный принт сервер: формирование образа

Устанавливаем xresprobe и pinguybuilder sudo wget https://launchpad.net/ubuntu/+source/xresprobe/0.4.24ubuntu9/+build/1274262/+files/xresprobe_0.4.24ubuntu9_amd64.deb sudo wget http://downloads.sourceforge.net/project/pinguy-os/ISO_Builder/pinguybuilder_4.3-8_all-beta.deb sudo dpkg -i xresprobe_0.4.24ubuntu9_amd64.deb sudo dpkg -i pinguybuilder_4.3-8_all-beta.deb

Если есть неудовлетворённые зависимости, выполняется:

sudo apt-get –f install Чистим систему sudo apt-get -f install sudo apt autoclean sudo apt autoremove Создаём образ sudo PinguyBuilder backup

Если процесс был прерван, надо удалить временные файлы:

sudo PinguyBuilder clean

Программа создаст образ ISO (размером 500-600 Мб), который надо записать на флешку, флешку воткнуть в материнскую плату и всё это положить в коробку. Материнскую плату надо настроить на включение при подаче питания и запитать от одного выключателя вместе с принтером.

Результат: в любом свободном месте ставится принтер, подключенный к принт-серверу. Время готовности после включения – 2-2,5 минуты. Если что-то работает не так, как хотелось бы, это допиливается через сценарий script.sh, который пишется в корень флешки.

Configuration

The CUPS server configuration is located in and (see and ). After editing either file, restart to apply any changes. The default configuration is sufficient for most users.

User groups with printer administration privileges are defined in in the . The and and groups are used by default.

is built with support and libpaper defaults to the Letter paper size. To avoid having to change the paper size for each print queue you add, edit and set your system default paper size. See .

cups-browsed

This article or section is out of date.

Note:

  • is only needed to dynamically add and remove printers as they appear and disappear from a network. It is not required if you simply want to add a an DNS-SD/mDNS supporting network printer to CUPS.

Allowing admin authentication through PolicyKit

PolicyKit can be configured to allow users to configure printers using a GUI without the admin password.

Note: You may need to install for working this rules.

Here is an example that allows members of the wheel user group to administer printers without a password:

/etc/polkit-1/rules.d/49-allow-passwordless-printer-admin.rules
polkit.addRule(function(action, subject) { 
    if (action.id == "org.opensuse.cupspkhelper.mechanism.all-edit" && 
        subject.isInGroup("wheel")){ 
        return polkit.Result.YES; 
    } 
});

Without a local CUPS server

CUPS can be configured to directly connect to remote printer servers instead of running a local print server. This requires installation of the package. Some applications will still require the package for printing.

To use a remote CUPS server, set the environment variable to . For instance, if you want to use a different print server for a single Firefox instance (substitute with your print server name/port):

$ CUPS_SERVER=printserver.mydomain:port firefox

To make this configuration permanent create configuration file and add a hostname of the remote CUPS server to it:

ServerName server

You can also specify a custom port:

ServerName server:port

Устранение неполадок в системе печати

Не всегда удается настроить принтер с первого раза и иногда настройка становится чрезвычайно сложной, убивающей веры в свои силы. Постараюсь описать некоторые шаги по устранению проблем с печатью:

  • Постарайтесь проверить работоспособность принтера на другой ОС. Естественно, если он не заработает в другой ОС, то проблема скорее всего в аппаратной части.
  • Проверьте все физические соединения. Питание, информационный провод. Проверьте включен ли принтер и имеется ли бумага в лотке, а так же нет ли сигнализации об ошибках на принтере.
  • Если принтер подключается по USB, LPT, COM, то посмотрите выводы команд lsusb, dmesg на наличие записей о принтере. Если принтер с Ethernet-интерфейсом, проверьте связь с ним командой ping.
  • Если все вышеперечисленные проверки завершились успехом — тщательно проверьте настройки CUPS.
  • Проверьте в Веб-интерфейсе, не остановлена ли очередь печати принтера.
  • Если в статусе принтера написано waiting for job copmlete, то что-то мешает CUPS очистить очередь печати принтера (например отсутствие физического соединения с принтером или нехватка прав доступа).
  • Если при печати на бумаге выводится всякий мусор, то скорее всего выбраны неверные параметры/модель принтера.
  • Так же, для поиска неисправности необходимо просмотреть логи принтера в каталоге /var/log/cups/
  • Ну и как всегда, вам в помощь яндэкс и гугл.

Problems resulting from upgrades

Issues that appeared after CUPS and related program packages underwent a version increment

CUPS stops working

The chances are that a new configuration file is needed for the new version to work properly. Messages such as «404 — page not found» may result from trying to manage CUPS via localhost:631, for example.

To use the new configuration, copy to (backup the old configuration if needed) and restart CUPS to employ the new settings.

All jobs are «stopped»

The factual accuracy of this article or section is disputed.

To check the printer’s settings go to Printers, then Modify Printer. Copy down the information displayed, click ‘Modify Printer’ to proceed to the next page(s), and so on.

All jobs are «The printer is not responding»

On networked printers, you should check that the hostname in the printer’s URI resolves to the printer’s IP address via DNS, e.g. if your printer’s connection looks like this:

lpd://BRN_020554/BINARY_P1

then the hostname ‘BRN_020554’ needs to resolve to the printer’s IP from the server running CUPS. If Avahi is being used, ensure that is working.

Alternatively, replace the hostname used in the URI with the printer’s IP address.

Решение проблем

Общие советы по устранению неполадок смотрите в CUPS/Решение проблем.

Не удается отправить на печать из приложений GTK

Если ты получил сообщение getting printer information failed (ошибка получения информации о принтере), когда пытался отправить на печать из приложения GTK, тогда добавь эту строку в свой :

 # serverip 	some.name.org 	ServersHostname

Ошибки разрешений в Windows

Некоторые пользователи исправили ошибки ‘NT_STATUS_ACCESS_DENIED’ (Windows клиенты), используя несколько иной синтаксис:

smb://рабочая_группа/имя_пользователя:пароль@имя_хоста/имя_принтера

Использование

CUPS можно полностью контролировать с помощью инструментов командной строки (CLI) из пакетов lp* и cups*.
В качестве альтернативы можно использовать или одно из нескольких .

  • Имя принтера — короткое, но описательное имя, используемое в системе для идентификации принтера. Это имя не должно содержать пробелов или специальных символов. Например, принтер, соответствующий HP LaserJet 5P, может быть назван «hpljet5p». С каждым физическим принтером можно связать более одной очереди.
  • Расположение — это описание физического расположения принтера (например, «спальня», или «кухня»). Это помогает поддерживать несколько принтеров.
  • Описание — полное описание принтера. Обычно используется полное имя принтера (например, «HP LaserJet 5P»).

Инструменты CLI

Примечание: Нельзя сгруппировать переключатели командной строки

This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.

Список устройств
# lpinfo -v
$ /usr/lib/cups/backend/snmp ip_address # Используйте SNMP для поиска URI
Список моделей
$ lpinfo -m
Добавление нового принтера
# lpadmin -p имя принтера -E -v uri -m model

Имя принтера зависит от тебя.
Например:

# lpadmin -p HP_DESKJET_940C -E -v "usb://HP/DESKJET%20940C?serial=CN16E6C364BH" -m drv:///HP/hp-deskjet_940c.ppd.gz
# lpadmin -p AirPrint -E -v "ipp://10.0.1.25/ipp/print" -m everywhere    # Принтеры без драйверов (Apple AirPrint или IPP Everywhere)
# lpadmin -p SHARED_PRINTER -m raw    # Необработанный принтер; нет PPD или фильтра	
# lpadmin -p Test_Printer -E -v "ipp://10.0.1.3/ipp/print" -m pxlmono.ppd    # Указание PPD вместо модели

Примечание: При указании PPD используйте только имя файла, а не полный путь (например, вместо )

Установите принтер по умолчанию
$ lpoptions -d имя принтера
Изменение параметров
$ lpoptions -p имя принтера -l # Список параметров
$ lpoptions -p имя принтера -o option=value # Установка параметра

Например:

$ lpoptions -p HP_DESKJET_940C -o PageSize=A4
Проверка cостояния принтера
$ lpstat -s
$ lpstat -p имя принтера
Отключение принтера
# cupsdisable имя принтера
Включение принтера
# cupsenable имя принтера
Настройка принтера для приема заданий
# cupsaccept имя принтера
Удаление принтера

Сначала настройте принтер для отклонения всех входящих записей:

# cupsreject имя принтера

Затем отключите его.

# cupsdisable имя принтера

Наконец, удалите его.

# lpadmin -x имя принтера
Печать файла
$ lpr файл
$ lpr -# 17 файл            # распечатать файл 17 раз
$ echo 'Привет, мир!' | lpr -p # распечатать результат команды. Переключатель -p добавляет заголовок.
Проверка очереди
$ lpq
$ lpq -a # во всех очередях
Очистка очереди
# lprm   # удаляет только последнюю запись
# lprm - # удаляет все записи

Веб интерфейс

Примечание: Если используется HTTPS-соединение с CUPS, оно может длиться очень долго, прежде чем интерфейс появится при первом доступе. Это связано с тем, что первый запрос инициирует создание SSL-сертификатов, которое может занимать много времени.

Для выполнения административных задач требуется аутентификация веб-интерфейса. Аутентифицируйте себя либо как , либо убедитесь, что ваш пользователь входит в группу с полномочиями управления принтерами, для получения дополнительной информации смотрите .

Добавление принтера

Перейдите на вкладку Администрирование.

Изменение существующих принтеров

Перейдите на вкладку Принтеры и выберите принтер для изменения.

Проверка принтера

Перейдите на вкладку Принтеры и выберите принтер.

Приложения с GUI

Если у вашего пользователя нет достаточных привилегий для администрирования CUPS, приложения будут запрашивать пароль root при запуске. Чтобы предоставить пользователям права администратора без необходимости доступа root, смотрите .

GtkLP — Интерфейс GTK+ для CUPS.

print-manager — Инструмент для управления заданиями печати и принтерами (KDE).

system-config-printer — Инструмент настройки принтера GTK+ и апплет состояния (GNOME и другие).

Installation

Install the package.

If you intend to «print» into a PDF document, also install the package. By default, pdf files are stored in . The location can be changed in .

Enable and start .

Socket activation

provides a unit. If is enabled (and is disabled), systemd will not start CUPS immediately; it will just listen to the appropriate sockets. Then, whenever a program attempts to connect to one of these CUPS sockets, systemd will start and transparently hand over control of these ports to the CUPS process.

This way, CUPS is only started once a program wants to make use of the service.

Print steps

it is important to know how CUPS works if wanting to solve related issues:

  1. An application sends a .ps file (PostScript, a script language that details how the page will look) to CUPS when ‘print’ has been selected (this is the case with most programs).
  2. CUPS then looks at the printer’s PPD file (printer description file) and figures out what filters it needs to use to convert the .ps file to a language that the printer understands (like PJL, PCL), usually GhostScript.
  3. GhostScript takes the input and figures out which filters it should use, then applies them and converts the .ps file to a format understood by the printer.
  4. Then it is sent to the back-end. For example, if the printer is connected to a USB port, it uses the USB back-end.

Printer sharing

This article or section needs expansion.

DNS-SD advertisement

To announce the printer to the network over DNS-SD/mDNS (Bonjour in Apple world), Avahi must be installed and running on the server.

To enable it, either select Share printers connected to this system in the web interface, or manually set in :

/etc/cups/cupsd.conf
...
Browsing On
...

Afterwards restart .

Note that «browsing» at the print server is a different thing from «browsing» at a remote networked host. On the print server, provides the DNS-SD protocol support which the broadcasts. The service is unnecessary on the print server, unless also broadcasting the old CUPS protocol, or the print server is also «browsing» for other networked printers. On the remote networked host, the service is required to «browse» for network broadcasts of print services, and running will also automatically start .

The service will be automatically started when a USB printer is plugged in, however this may not be the case for other connection types. If is not running, does not broadcast the print services, so in that case the systemd unit service file must be modified to start on boot, and then the service must again be «enabled/installed» with the new dependency. To do this, edit the service file section to add a dependency, and then enable and start the service.

Sharing via Internet Printing Protocol

The server can be configured using either the web interface or by manually editing .

Open up the web interface to the server, select the Administration tab, look under the Server heading, and enable the «Share printers connected to this system» option. Save your change by clicking on the Change Settings button. The server will automatically restart.

On the server computer (the one directly connected to the printer), allow access to the server by modifying the location directive. For instance:

/etc/cups/cupsd.conf
<Location />
    Order allow,deny
    Allow localhost
    Allow 192.168.0.*
</Location>
...

Also make sure the server is listening on the IP address the client will use:

/etc/cups/cupsd.conf
...
Listen <hostname>:631
...

After making any modifications, restart .

If CUPS is started using socket activation, create a drop-in snippet for so that socket activation also works for remote connections:

/etc/systemd/system/org.cups.cupsd.socket.d/override.conf
ListenStream=631

Sharing via Samba

Samba is an implementation of the Windows file and printer sharing protocols, even the most vintage ones.

To configure Samba on the Linux server, edit file to allow access to printers. File can look something like this:

/etc/samba/smb.conf
...
printing = CUPS
...


    comment = All Printers
    path = /var/spool/samba
    browseable = yes
    # to allow user 'guest account' to print.
    guest ok = no
    writable = no
    printable = yes
    create mode = 0700
    write list = root @adm @wheel yourusername

That should be enough to share the printer, yet adding an individual printer entry may be desirable:

/etc/samba/smb.conf
    comment = Samsung ML-1250 Laser Printer
    printer = ml1250
    path = /var/spool/samba
    printing = cups
    printable = yes
    user client driver = yes
    # to allow user 'guest account' to print.
    guest ok = no
    writable = no
    write list = root @adm @wheel yourusername
    valid users = root @adm @wheel yourusername

Please note that this assumes configuration was made so that users must have a valid account to access the printer. To have a public printer, set to , and remove the line. To add accounts, set up a regular GNU/Linux account and then set up a Samba password on the server. See .

After this, restart and .

Sharing via Line Printer Daemon protocol

Warning: cups-lpd does not perform any access control based on the settings in . Therefore, running cups-lpd on your server will allow any computer on your network (and perhaps the entire Internet) to print to your server.

Enable and start .

USB-принтеры

Конфликт с SANE

Если у вас также запущен SANE, возможно, что он конфликтует с CUPS. Чтобы исправить это, создайте правило Udev, обозначающее устройство как совпадающее с libsane:

/etc/udev/rules.d/99-printer.rules
ATTRS{idVendor}=="vendor id(код производителя)", ATTRS{idProduct}=="product id(код продукта)", MODE="0664", GROUP="lp", ENV{libsane_matched}="yes"

Конфликт с usblp

Если у вас возникли проблемы с работой USB-принтера, вы можете попробовать запрет загрузки для модуля ядра :

/etc/modprobe.d/blacklistusblp.conf
blacklist usblp

Пользователям кастомного ядра может потребоваться вручную загрузить модуль ядра , прежде чем продолжить.

После установки модулей подключите принтер и проверьте, обнаружило ли его ядро, выполнив следующие действия:

# journalctl -e

или

# dmesg

Если вы используете , вывод должен указывать на то, что принтер был обнаружен следующим образом:

Feb 19 20:17:11 kernel: printer.c: usblp0: USB Bidirectional
printer dev 2 if 0 alt 0 proto 2 vid 0x04E8 pid 0x300E
Feb 19 20:17:11 kernel: usb.c: usblp driver claimed interface cfef3920
Feb 19 20:17:11 kernel: printer.c: v0.13: USB Printer Device Class driver

Если вы запретили загрузку , вы увидите что-то вроде:

usb 3-2: new full speed USB device using uhci_hcd and address 3
usb 3-2: configuration #1 chosen from 1 choice

USB autosuspend

Ядро Linux автоматически приостанавливает USB-устройства, когда есть поддержка драйверов и устройства не используются. Это может сэкономить электроэнергию, но некоторые USB-принтеры считают, что они не подключены, когда ядро приостанавливает USB-порт, предотвращая печать. Это можно устранить, отключив autosuspend для конкретного устройства, для получения дополнительной информации смотрите .

Плохие разрешения

Проверьте разрешения USB-порта принтера. Получите номер шины (BUSID) и устройства (DEVID) от :

 lsusb 
 Bus <BUSID> Device <DEVID>: ID <PRINTERID>:<VENDOR> Hewlett-Packard DeskJet D1360

Проверьте владельца, просмотрев devfs:

 # ls -l /dev/bus/usb/<BUSID>/<DEVID>

Демон cups запускается от пользователя «cups» и относится к группе «lp», поэтому либо этому пользователю, либо группе требуется доступ на чтение и запись в USB-устройство. Если вы считаете, что разрешения выглядят неправильно, вы можете временно изменить группу и разрешение:

# chgrp lp /dev/bus/usb/<BUSID>/<DEVID>
# chmod 664 /dev/bus/usb/<BUSID>/<DEVID>

Затем проверьте, может ли cups теперь видеть устройство USB правильно.

Чтобы сделать постоянное изменение разрешения, которое будет запускаться автоматически при каждом запуске компьютера, добавьте следующую строку.

/etc/udev/rules.d/10-local.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="<VENDOR>", ATTRS{idProduct}=="<PRINTERID>", GROUP:="lp", MODE:="0664"

После редактирования перезагрузите правила udev этой командой:

# udevadm control --reload-rules

Каждая система может отличаться, поэтому обратитесь к вики-странице .

Other

Printer «Paused» or «Stopped» with Status «Rendering completed»

Low ink

When low on ink, some printers will get stuck in «Rendering completed» status and, if it is a network printer, the printer may even become unreachable from CUPS’ perspective despite being properly connected to the network. Replacing the low/depleted ink cartridge(s) in this setting will return the printer to «Ready» status and, if it is a network printer, will make the printer available to CUPS again.

Note: If you use third-party ink cartridges, the ink levels reported by the printer may be inaccurate. If you use third-party ink and your printer used to work fine but is now getting stuck on «Rendering completed» status, replace the ink cartridges regardless of the reported ink levels before trying other fixes.

Unknown supported format: application/postscript

Comment the lines:

application/octet-stream        application/vnd.cups-raw        0      -

from , and:

application/octet-stream

in .

(Also applicable to error «-1 not supported!»)

Try to remove Foomatic drivers or refer to for a workaround.

Printer becomes stuck after a problem

When an issue arises during printing, the printer in CUPS may become unresponsive. reports that the printer , and it can be reactivated using . In the CUPS web interface, the printer is shown as Paused, and can be reactivated by resuming the printer.

Samsung: URF ERROR — Incomplete Session by time out

This error is usually encountered when printing files over the network through IPP to a Samsung printer, and is solved by using the AUR package.

Note: The corresponding error code 11-1112 corresponds to an internal wiring problem with the printer, so contacting Samsung’s tech support is futile.

Brother: Printer prints multiple copies

Sometimes the printer will print multiple copies of a document (for instance a MFC-9330CDW printed 10 copies). The solution is to .

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector