Jump to content

Recommended Posts

Posted (edited)

http://bin.entware.net/aarch64-k3.10/test/airprint/

http://bin.entware.net/mipselsf-k3.4/test/airprint/

http://bin.entware.net/mipssf-k3.4/test/airprint/

1. установить пакет:

opkg install airprint

остальные зависят от модели устройства (напр., для SCX-4220 - `opkg install splix`)

2. добавить группy для avahi

 echo "nogroup:x:65535:" >> /opt/etc/group

3. для настройки через web отредактировать файл "/opt/etc/cups/cupsd.conf":

в строке "Listen localhost:631" удалить запись "localhost" ( Listen localhost:631 => Listen 631)

добавить в конец каждой секции " <Location />" и "<Location /admin>"  - "Allow @Local"

4. заметить стартовый скрипт "/opt/etc/init.d/S42avahi-daemon", присвоив другой номер (чтоб не переписывался при переустановке), типа;

5. запустить сервисы

/opt/etc/init.d/S20dbus  start
/opt/etc/init.d/S42avahi-daemon start
/opt/etc/init.d/S60cupsd  start

и настроить устройство через "морду" IP:631

6. создать 2 (два) файла (или забрать готовые)

7. забрать генератор (curl/wget/копипаста)  https://raw.github.com/tjfontaine/airprint-generate/master/airprint-generate.py

8. создать файл сервиса устройства для avahi

python airprint-generate.py -d /opt/etc/avahi/services/

9. перезапустить сервисы

/opt/etc/init.d/S42avahi-daemon restart
/opt/etc/init.d/S60cupsd restart

10. пытать ипон(ц)а
---
из неявного: имя хоста должно быть с суффиксом .local

screen_2023-04-09_17:55:05-cups.png

screen_2023-04-10_18:38:48-airprint.png

Edited by TheBB
пакеты в репах; typo
  • Thanks 2
  • Upvote 2
  • 4 months later...
Posted
В 13.04.2023 в 18:43, TheBB сказал:

http://bin.entware.net/aarch64-k3.10/test/airprint/

http://bin.entware.net/mipselsf-k3.4/test/airprint/

http://bin.entware.net/mipssf-k3.4/test/airprint/

1. установить пакеты:  avahi-dbus-daemon cups cups-filters ghostscript libnss-mdns python3-cups

opkg install http://bin.entware.net/mipselsf-k3.4/test/airprint/libcups_2.2.12-3_mipsel-3.4.ipk
opkg install http://bin.entware.net/mipselsf-k3.4/test/airprint/cups_2.2.12-3_mipsel-3.4.ipk
opkg install http://bin.entware.net/mipselsf-k3.4/test/airprint/libnss-mdns_0.15.1-1_mipsel-3.4.ipk
opkg install avahi-dbus-daemon cups-filters ghostscript python3-cups

остальные зависят от модели устройства (напр., для SCX-4220 - `opkg install splix`)

2. добавить группы "lpadmin sys" или удалить записи из файла "/opt/etc/cups/cups-files.conf"

echo "lpadmin:x:122:" >> /opt/etc/group
echo "sys:x:3:" >> /opt/etc/group

для avahi

 echo "nogroup:x:65535:" >> /opt/etc/group

3. для настройки через web отредактировать файл "/opt/etc/cups/cupsd.conf":

в строке "Listen localhost:631" удалить запись "localhost" ( Listen localhost:631 => Listen 631)

добавить в конец каждой секции " <Location />" и "<Location /admin>"  - "Allow @Local"

4. заметить стартовый скрипт "/opt/etc/init.d/S42avahi-daemon", присвоив другой номер (чтоб не переписывался при переустановке), типа;

/opt/etc/init.d/S43avahi-daemon

#!/bin/sh

# avahi-daemon init script

PROCS="avahi-daemon"
PROGS="/opt/sbin/$PROCS"
ARGS=""
DESC="$PROCS"

do_start() {
  $PROGS -c || $PROGS -D $ARGS
}

do_stop() {
  $PROGS -c && $PROGS -k
}

do_reload() {
  $PROGS -c && $PROGS -r $ARGS
}

case "$1" in
    start)
          do_start
    ;;
    stop)
          do_stop
    ;;
    reload)
          do_reload
    ;;
    restart)
          do_stop
          sleep 1
          do_start
    ;;
    *)
          echo "Usage: $0 {start|stop|reload|restart}" >&2
          exit 1
    ;;
esac
exit 0

5. запустить сервисы

/opt/etc/init.d/S20dbus  start
/opt/etc/init.d/S43avahi-daemon start
/opt/etc/init.d/S60cupsd  start

и настроить устройство через "морду" IP:631

6. создать 2 (два) файла (или забрать готовые)

"/opt/share/cups/mime/airprint.convs"

#
# "$Id: $"
#
# AirPrint
# Updated list with minimal set 25 Sept
image/urf application/pdf 100 pdftoraster
#
# End of "$Id: $".
#
wget http://bin.entware.net/mipselsf-k3.4/test/airprint/airprint.convs -P /opt/share/cups/mime/

"/opt/share/cups/mime/airprint.types"

#
# "$Id: $"
#
# AirPrint type 
image/urf urf string(0,UNIRAST<00>)
#
# End of "$Id: $".
#
wget http://bin.entware.net/mipselsf-k3.4/test/airprint/airprint.types -P /opt/share/cups/mime/

7. забрать генератор (curl/wget/копипаста)  https://raw.github.com/tjfontaine/airprint-generate/master/airprint-generate.py

или

wget http://bin.entware.net/mipselsf-k3.4/test/airprint/airprint-generate.py

8. создать файл сервиса устройства для avahi

python ./airprint-generate.py -d /opt/etc/avahi/services/

9. перезапустить сервисы

/opt/etc/init.d/S43avahi-daemon restart
/opt/etc/init.d/S60cupsd restart

10. пытать ипон(ц)а
---
из неявного: имя хоста должно быть с суффиксом .local

screen_2023-04-09_17:55:05-cups.png

screen_2023-04-10_18:38:48-airprint.png

Спасибо огромное!

Posted
В 13.04.2023 в 18:43, TheBB сказал:
python ./airprint-generate.py -d /opt/etc/avahi/services/

Наверное, всё же не ./, т.к. airprint-generate.py лежит в /opt/sbin, а не в текущем каталоге /opt/root

  • Thanks 1
Posted (edited)

Доброго дня!

Подскажите пожалуйста, в чём проблема... принтер AirPrint появился сам, но через печать на iPhone печатается лист с ошибкой... Когда пробую распечатать из web cups пробную страницу пишет Статус: ожидает - "No suitable destination host found by cups-browsed."

Так же когда пытаюсь изменить его и сделать общий доступ к нему, пишет ошибку: 

Не удается изменить принтер:

Cannot change printer-is-shared for remote queues.
Edited by Glushkov1991
  • 1 year later...
Posted

Всем привет. Роутер Keenetic Giga (KN-1012) EAEU. Захотел поиграться с Cups. Поставил через opkg install. Пробую запустить через /opt/etc/init.d/S60cupsd start, пишет, что done, но после S60cupsd status пишет dead. Никаких логов не появляется. Пробовал listen localhost:631 менять просто на 631 или на *:631. Ничего. Сервис dead, логов нет. Пробовал также запускать через cupsd с указанием конфига через -c. Ничего не выходит.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

This site uses cookies. By clicking "I accept" or continuing to browse the site, you authorize their use in accordance with the Privacy Policy.